Handle numeric identifiers

pull/27/head
Mingwei Samuel 2021-05-30 22:27:06 -07:00
parent 1c4cadb6d9
commit 2b1f109427
1 changed files with 3 additions and 1 deletions

View File

@ -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;