Skip to content

Commit e8965d2

Browse files
committed
Remove spaces in enum names
Enum values can be more than one word, so replace whitespace so that enum names are valid
1 parent c6a61fe commit e8965d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/swagger-2.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function capitalize(str: string) {
3131
}
3232

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

0 commit comments

Comments
 (0)