mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-26 19:06:32 +00:00
Handle numeric identifiers
This commit is contained in:
parent
1c4cadb6d9
commit
2b1f109427
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue