Add ignore list for decorators

This commit is contained in:
Ibby Hadeed
2017-12-28 08:40:52 -05:00
parent 75675ea19f
commit 6416395727
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -19,13 +19,15 @@ function transformImports(file: ts.SourceFile, ctx: ts.TransformationContext, ng
const decoratorRegex: RegExp = /@([a-zA-Z]+)\(/g;
const ignored: string [] = ['Plugin', 'Component'];
let m;
while ((m = decoratorRegex.exec(file.text)) !== null) {
if (m.index === decoratorRegex.lastIndex) {
decoratorRegex.lastIndex++;
}
if (m && m[1] && decorators.indexOf(m[1]) === -1 && m[1] !== 'Plugin') decorators.push(m[1]);
if (m && m[1] && decorators.indexOf(m[1]) === -1 && ignored.indexOf(m[1]) === -1) decorators.push(m[1]);
}
if (decorators.length) {