Use Number.parseInt
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
parent
5be1773244
commit
824d6fe946
2 changed files with 3 additions and 4 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue