Use Number.parseInt

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
Richie Bendall 2020-10-04 07:11:31 +13:00
parent 5be1773244
commit 824d6fe946
No known key found for this signature in database
GPG key ID: 94AE1ACB662A2A6D
2 changed files with 3 additions and 4 deletions

View file

@ -62,8 +62,7 @@
"@typescript-eslint/member-ordering": "off",
"no-redeclare": "off",
"unicorn/string-content": "off",
"unicorn/better-regex": "off",
"unicorn/prefer-number-properties": "off"
"unicorn/better-regex": "off"
}
}
}

View file

@ -22,11 +22,11 @@ function unescape(c) {
const bracket = c[1] === '{';
if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
return String.fromCharCode(parseInt(c.slice(1), 16));
return String.fromCharCode(Number.parseInt(c.slice(1), 16));
}
if (u && bracket) {
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
return String.fromCodePoint(Number.parseInt(c.slice(2, -1), 16));
}
return ESCAPES.get(c) || c;