mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 17:54:15 +03:00
chore(es/minifier): Fix script for extracting test cases from next.js app (#8092)
This commit is contained in:
parent
7e4b2490e8
commit
a2d077958f
@ -8,12 +8,11 @@ const rl = readline.createInterface({
|
||||
terminal: false,
|
||||
});
|
||||
|
||||
function looseJsonParse(obj) {
|
||||
return Function('"use strict";return (' + obj + ")")();
|
||||
}
|
||||
|
||||
rl.on("line", async (data) => {
|
||||
try {
|
||||
const { name, source } = looseJsonParse(`(${data})`);
|
||||
data = data.replace('{ breakLength: Infinity, maxStringLength: Infinity }', '')
|
||||
const { name, source } = JSON.parse(data);
|
||||
const targetPath = path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
|
Loading…
Reference in New Issue
Block a user