Skip to content

Commit 385aeda

Browse files
alan-agius4clydin
authored andcommitted
refactor(@schematics/angular): use includes instead of RegExp
1 parent 539e754 commit 385aeda

File tree

1 file changed

+4
-6
lines changed
  • packages/schematics/angular/component

1 file changed

+4
-6
lines changed

packages/schematics/angular/component/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,12 @@ export default function (options: ComponentOptions): Rule {
158158
...options,
159159
}),
160160
!options.type ? forEach((file => {
161-
if (!!file.path.match(new RegExp('..'))) {
162-
return {
161+
return file.path.includes('..')
162+
? {
163163
content: file.content,
164164
path: file.path.replace('..', '.'),
165-
};
166-
} else {
167-
return file;
168-
}
165+
}
166+
: file;
169167
}) as FileOperator) : noop(),
170168
move(parsedPath.path),
171169
]);

0 commit comments

Comments
 (0)