Skip to content

Commit 9947306

Browse files
authored
Merge pull request #2 from manifoldco/dan/bugfix/enum-whitespace
Remove spaces in enum names
2 parents c6a61fe + 6e9d3c8 commit 9947306

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/swagger-2.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ function capitalize(str: string) {
3131
}
3232

3333
function camelCase(name: string) {
34-
return name.replace(/(-|_|\.|\s)+[a-z]/g, letter =>
35-
letter.toUpperCase().replace(/[^0-9a-z]/gi, '')
36-
);
34+
return name.replace(/(-|_|\.|\s)+\w/g, letter => letter.toUpperCase().replace(/[^0-9a-z]/gi, ''));
3735
}
3836

3937
function parse(spec: Swagger2, namespace: string) {

0 commit comments

Comments
 (0)