Skip to content

Commit ce52740

Browse files
Use camel case on the attribute name to match templating. (#1730)
1 parent 3f2d351 commit ce52740

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

features/support/templating.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ String.prototype.toOperationName = function (): string {
126126
};
127127

128128
String.prototype.toAttributeName = function (): string {
129-
return String(this)
129+
let val = String(this)
130130
.replace(/[^A-Za-z0-9]+(.)/g, function (...matches) {
131131
return matches[1].toUpperCase();
132132
})
133133
.replace(/[^A-Za-z0-9]+/g, "");
134+
135+
return val.charAt(0).toLowerCase() + val.slice(1);
134136
};
135137

136138
function getProperty<T, K extends keyof T>(obj: T, name: string): T[K] {

0 commit comments

Comments
 (0)