MCPcopy Create free account
hub / github.com/Snapchat/Valdi / toPascalCase

Method toPascalCase

compiler/companion/src/JSXProcessor.ts:108–121  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

106 return false;
107 }
108
109 private toPascalCase(key: string): string {
110 for (let i = 0; i < key.length; i++) {
111 const charCode = key.charCodeAt(i);
112
113 if (!this.isAlphaNum(charCode)) {
114 const prefix = key.substr(0, i);
115 const suffix = key.substr(i + 1);
116 key = prefix + suffix;
117 i--;
118 }
119 }
120
121 return key.substr(0, 1).toUpperCase() + key.substr(1);
122 }
123
124 private resolveJSXAttributeStatements(

Callers 1

makeIdentifierMethod · 0.95

Calls 2

isAlphaNumMethod · 0.95
substrMethod · 0.80

Tested by

no test coverage detected