24 lines
783 B
JavaScript
24 lines
783 B
JavaScript
const fs = require('fs');
|
|
const content = fs.readFileSync('D:/cumin/ghaymah_dns_net_sec_tests/ghaymah_bundle.js', 'utf8');
|
|
|
|
// Find all mutation names
|
|
const mutations = content.match(/mutation\s+([a-zA-Z0-9_]+)/g) || [];
|
|
console.log('Unique mutations:', [...new Set(mutations)]);
|
|
|
|
// Find all occurrences of build or artifact
|
|
const idxs = [];
|
|
let p = 0;
|
|
while (true) {
|
|
const i = content.indexOf('build', p);
|
|
if (i === -1) break;
|
|
if (content.substring(i - 20, i + 30).includes('mutation') || content.substring(i - 20, i + 30).includes('api')) {
|
|
idxs.push(i);
|
|
}
|
|
p = i + 1;
|
|
}
|
|
console.log('Matches near build:', idxs.length);
|
|
for (const i of idxs.slice(0, 10)) {
|
|
console.log('--- snippet at', i, '---');
|
|
console.log(content.substring(Math.max(0, i - 100), i + 200));
|
|
}
|