Skip to content

Commit 8e4d97c

Browse files
committed
feat: add pascalCase helper
1 parent c1fa4d0 commit 8e4d97c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const handlebarsPlugin = () => ({
3737
escapeComment: true,
3838
escapeDescription: true,
3939
camelCase: true,
40+
pascalCase: true,
4041
},
4142
});
4243
return `export default ${templateSpec};`;

src/utils/registerHandlebarHelpers.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ describe('registerHandlebarHelpers', () => {
2121
expect(helpers).toContain('escapeComment');
2222
expect(helpers).toContain('escapeDescription');
2323
expect(helpers).toContain('camelCase');
24+
expect(helpers).toContain('pascalCase');
2425
});
2526
});

src/utils/registerHandlebarHelpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,8 @@ export const registerHandlebarHelpers = (root: {
104104
Handlebars.registerHelper('camelCase', function (value: string): string {
105105
return camelCase(value);
106106
});
107+
108+
Handlebars.registerHelper('pascalCase', function (value: string): string {
109+
return camelCase(value, { pascalCase: true });
110+
});
107111
};

0 commit comments

Comments
 (0)