mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-27 01:38:21 +01:00
fix unescape
This commit is contained in:
parent
5ff637138c
commit
023e61c01e
@ -659,19 +659,8 @@ namespace OS {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
String.prototype.unescape = function (): string {
|
String.prototype.unescape = function (): string {
|
||||||
let d = this;
|
let json = JSON.parse(`{ "text": "${this}"}`)
|
||||||
d = d.replace(/\\\\/g, "\\");
|
return json.text;
|
||||||
d = d.replace(/\\"/g, '"');
|
|
||||||
d = d.replace(/\\'/g, "'");
|
|
||||||
d = d.replace(/\\%/g, '%');
|
|
||||||
d = d.replace(/\\0/g, "\0");
|
|
||||||
d = d.replace(/\\n/g, "\n");
|
|
||||||
d = d.replace(/\\t/g, "\t");
|
|
||||||
d = d.replace(/\\b/g, "\b");
|
|
||||||
d = d.replace(/\\f/g, "\f");
|
|
||||||
d = d.replace(/\\r/g, "\r");
|
|
||||||
d = d.replace(/\\z/g, "\x1a");
|
|
||||||
return d;
|
|
||||||
};
|
};
|
||||||
String.prototype.asUint8Array = function (): Uint8Array {
|
String.prototype.asUint8Array = function (): Uint8Array {
|
||||||
let bytes = [];
|
let bytes = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user