const fs = require('fs');
const content = fs.readFileSync('dist/server.cjs', 'utf8');

const target = 'getCustomProfiles';
let idx = content.indexOf(target);
if (idx !== -1) {
  console.log(`Found "${target}" at index ${idx}:`);
  console.log(content.substring(idx - 100, idx + 2000));
} else {
  console.log(`"${target}" not found`);
  // search for "custom_profiles" or "data/" instead
  const searchTerms = ['custom_profiles', 'custom-profiles', 'data/profiles'];
  searchTerms.forEach(term => {
    idx = content.indexOf(term);
    if (idx !== -1) {
      console.log(`Found "${term}" at index ${idx}:`);
      console.log(content.substring(idx - 100, idx + 1000));
    }
  });
}
