INNER CODE UNIT · TypeScript
scanManifest
cyanheads/pubmed-mcp-server · scripts/check-dependency-specifiers.ts:77
function scanManifest(manifest: SectionedManifest, label: string): Offender[] {
const offenders: Offender[] = [];
for (const section of DEP_SECTIONS) {
const deps = manifest[section];
if (!deps || typeof deps !== 'object') continue;
for (const [name, specifier] of Object.entries(deps)) {
if (typeof specifier === 'string' && isFloating(specifier, section)) {
offenders.push({ name, specifier, location: `${label} ${section}` });
}
}
}
return offenders;
}
/**
* Minimal JSONC → object parse: strips `//` and block comments and trailing
* commas while preserving string contents verbatim, then `JSON.parse`s.
* `bun.lock` is emitted with trailing commas, which strict `JSON.parse` rejects.