forked from mirror/Riven
Handle numeric identifiers
parent
1c4cadb6d9
commit
2b1f109427
|
@ -56,7 +56,9 @@ function normalizeArgName(name) {
|
|||
}
|
||||
|
||||
function normalizePropName(propName) {
|
||||
const out = changeCase.snakeCase(propName);
|
||||
let out = changeCase.snakeCase(propName);
|
||||
if (/^\d/.test(out)) // No leading digits.
|
||||
out = 'x' + out;
|
||||
if ('type' === out)
|
||||
return 'r#' + out;
|
||||
return out;
|
||||
|
|
Loading…
Reference in New Issue