forked from mirror/Riven
Handle numeric identifiers
parent
ae0ff8745f
commit
e7c9595a08
|
@ -65,7 +65,9 @@ function normalizeArgName(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizePropName(propName) {
|
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)
|
if ('type' === out)
|
||||||
return 'r#' + out;
|
return 'r#' + out;
|
||||||
return out;
|
return out;
|
||||||
|
|
Loading…
Reference in New Issue