Skip to content

Commit 9dc4a62

Browse files
hanslBrocco
authored andcommitted
feat(@angular-devkit/schematics): support underscores in path options
1 parent 7b84c6a commit 9dc4a62

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/angular_devkit/schematics/src/rules/template.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class InvalidPipeException extends BaseException {
2727
}
2828

2929

30-
export const kPathTemplateComponentRE = /__([^_]+)__/g;
30+
export const kPathTemplateComponentRE = /__(.+?)__/g;
3131
export const kPathTemplatePipeRE = /@([^@]+)/;
3232

3333

packages/angular_devkit/schematics/src/rules/template_spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ describe('applyPathTemplate', () => {
4949
expect(_applyPathTemplate('/a__c__b__d__c', { c: '1', d: '2' })).toBe('/a1b2c');
5050
});
5151

52+
it('works with single _', () => {
53+
expect(_applyPathTemplate('/a_b_c/d__e_f__g', { e_f: 1 })).toBe('/a_b_c/d1g');
54+
});
55+
5256
it('works with functions', () => {
5357
let arg = '';
5458
expect(_applyPathTemplate('/a__c__b', {

0 commit comments

Comments
 (0)