const fs = require('fs');

const serverContent = fs.readFileSync('dist/server.cjs', 'utf8');
const clientContent = fs.readFileSync('dist/assets/index-D9sWWWv_.js', 'utf8');

function findOccurrences(content, name, filename) {
  let idx = 0;
  while ((idx = content.indexOf(name, idx)) !== -1) {
    console.log(`Found "${name}" in ${filename} around index ${idx}:`);
    console.log(content.substring(idx - 150, idx + 250));
    idx += name.length;
  }
}

findOccurrences(serverContent, 'isLocked', 'dist/server.cjs');
findOccurrences(clientContent, 'isLocked', 'dist/assets/index-D9sWWWv_.js');
