fix decode function
This commit is contained in:
parent
1a61f86bea
commit
50a1b7e2d5
2 changed files with 41 additions and 3 deletions
|
@ -19,7 +19,7 @@ const decodeReplacer = (_: any, char: string) => ({
|
|||
f: '\f',
|
||||
"'": '\'',
|
||||
'"': '\"',
|
||||
u: String.fromCharCode(Number.parseInt(char.slice(1))),
|
||||
u: String.fromCharCode(Number.parseInt(`0x${char.slice(1)}`)),
|
||||
}[char.charAt(0)] ?? '');
|
||||
export const decode = (subject: string): string => subject.replace(decodeRegex, decodeReplacer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue