mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
18 lines
486 B
JavaScript
18 lines
486 B
JavaScript
#!/usr/bin/env node
|
|
|
|
let str1 = "window.screen.orientation \\x26\\x26 /^landscape/.tes";
|
|
str1 = str1
|
|
.replace(
|
|
/[^\\]((\\x[\da-f]{2}|\\u[\da-f]{4})){1,}/gi,
|
|
function ($0, $1, $2) {
|
|
console.log($0, eval('"' + $0 + '"'));
|
|
return eval('"' + $0 + '"');
|
|
}
|
|
)
|
|
.replace(/\\[\s\S]{1}/gi, function ($0, $1, $2) {
|
|
// console.log($0, $1)
|
|
const c = $0 === "\\n" ? "\n" : $0[1];
|
|
return c;
|
|
});
|
|
console.log(str1);
|