INNER CODE UNIT · JavaScript
ok
Zaki-1052/GPTPortal · scripts/smoke-test.js:12
const ok = (msg) => console.log(` ✓ ${msg}`);
const catalogPath = path.join(__dirname, '..', 'public', 'js', 'data', 'models.json');
const raw = fs.readFileSync(catalogPath, 'utf8');
// --- 1. JSON validity ---
let catalog;
try {
catalog = JSON.parse(raw);
ok('models.json parses as valid JSON');
} catch (e) {
fail(`models.json is not valid JSON: ${e.message}`);
report();
}
const models = catalog.models || {};
const categories = catalog.categories || {};
const ids = Object.keys(models);