Handle numeric identifiers

This commit is contained in:
Mingwei Samuel 2021-05-30 22:27:06 -07:00
parent 1c4cadb6d9
commit 2b1f109427

View file

@ -56,7 +56,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;