const fs = require('fs');
const content = fs.readFileSync('dist/assets/index-D9sWWWv_.js', 'utf8');

// Search for u.date_parsed in dist/assets/index-D9sWWWv_.js
let idx = 0;
let count = 0;
while ((idx = content.indexOf('u.date_parsed', idx)) !== -1) {
  console.log(`Found 'u.date_parsed' at index ${idx}:`);
  console.log(content.substring(idx - 100, idx + 200));
  console.log('-------------------------------------------');
  idx += 'u.date_parsed'.length;
  count++;
}
console.log(`Total occurrences found: ${count}`);
if (count !== 2) {
  console.error('ERROR: Expected exactly 2 occurrences of u.date_parsed, found ' + count);
  process.exit(1);
} else {
  console.log('SUCCESS: All 2 occurrences of u.date_parsed were updated correctly!');
}
