WMS_MAIN/temp_find_trailing_commas.js
2026-04-27 16:09:26 +08:00

2 lines
438 B
JavaScript

const fs = require('fs'); const s = fs.readFileSync('methods/system.json', 'utf8'); const re = /(,\s*\n\s*\])/g; let m; let found = false; while (m = re.exec(s)) { found = true; const idx = m.index; const start = Math.max(0, idx - 60); const end = Math.min(s.length, idx + 60); console.log('---trailing comma before ] at', idx); console.log(s.slice(start, end)); console.log('---'); } if (!found) console.log('No ",\n]" patterns found');