mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2025-02-20 15:07:26 -08:00
Handle numeric identifiers
This commit is contained in:
parent
ae0ff8745f
commit
e7c9595a08
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue