@awesome-fe/translate
Version:
Translation utils
24 lines • 816 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ngDocDirectiveTokenizer = void 0;
function ngDocDirectiveTokenizer(eat, value, silent) {
const matches = /^@(\w+)\b(.*)/.exec(value);
if (matches) {
try {
if (silent || !matches) {
// either we are not eating (silent) or the match failed
return !!matches;
}
return eat(matches[0])({
type: 'ngDocDirective',
name: matches[1],
value: matches[2]?.trim(),
});
}
catch (e) {
this.file.fail('Unmatched ngDocDirective: ' + e.message);
}
}
}
exports.ngDocDirectiveTokenizer = ngDocDirectiveTokenizer;
//# sourceMappingURL=ng-doc-directive-tokenizer.js.map