20c03acdaa
Deploy to route.crispygoat.com / deploy (push) Successful in 3m26s
The script kept failing on deploy (ESM vs CJS issue, plus the script file wasn't being shipped). User decided not to worry about it. The 26 manual rows will remain in the sheet without Entry IDs; the cron will retry them with a manual cleanup of any duplicates if needed.
44 lines
1.5 KiB
JavaScript
44 lines
1.5 KiB
JavaScript
// Extract eval string with proper escape handling
|
|
const fs = require('fs');
|
|
const acorn = require('acorn');
|
|
|
|
const content = fs.readFileSync('/tmp/layout.js', 'utf8');
|
|
const lines = content.split('\n');
|
|
const line1305 = lines[1304]; // 0-indexed, line 1305 1-indexed
|
|
|
|
// Match: eval(__webpack_require__.ts("..."));
|
|
const m = line1305.match(/^eval\(__webpack_require__\.ts\("([\s\S]*?)"\)\);?$/);
|
|
if (!m) {
|
|
console.log('NO MATCH, line preview:', line1305.slice(0, 200));
|
|
process.exit(1);
|
|
}
|
|
|
|
// Convert escaped chars in the string literal
|
|
// Use eval to interpret the string
|
|
const stringContent = m[1];
|
|
console.log('String content length:', stringContent.length);
|
|
|
|
// Use eval to decode JS escapes
|
|
const decoded = eval('"' + stringContent + '"');
|
|
console.log('Decoded length:', decoded.length);
|
|
console.log('First 500 chars of decoded:');
|
|
console.log(decoded.slice(0, 500));
|
|
|
|
// Save decoded for further analysis
|
|
fs.writeFileSync('/tmp/eval_decoded.js', decoded);
|
|
|
|
// Try parsing
|
|
try {
|
|
acorn.parse(decoded, { ecmaVersion: 'latest', sourceType: 'script' });
|
|
console.log('\nParse OK');
|
|
} catch (e) {
|
|
console.log('\nParse error:', e.message);
|
|
console.log('Position:', e.pos);
|
|
if (e.pos != null) {
|
|
const start = Math.max(0, e.pos - 200);
|
|
const end = Math.min(decoded.length, e.pos + 200);
|
|
console.log('BEFORE:', JSON.stringify(decoded.slice(start, e.pos)));
|
|
console.log('ERROR :', JSON.stringify(decoded.slice(e.pos, e.pos + 5)));
|
|
console.log('AFTER :', JSON.stringify(decoded.slice(e.pos + 5, end)));
|
|
}
|
|
} |