fix(qmd): reject unreliable npm listings and restore non-mapping models verbatim

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian lechnerandClaude Opus 5.5 committed 2026-10-08 11:55:47 +02:00
1 parent 7f89ae70bd
commit 953401a431
4 files changed
+27 -6

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ async function main(action, argument) {
next = setModels(current, YAML);
} else if (action === 'restore-models') {
const mapping = JSON.parse(argument ?? '');
if (mapping === null || typeof mapping !== 'object' || Array.isArray(mapping)) throw new Error('restore-models needs a JSON object');
if (mapping === undefined) throw new Error('restore-models needs a JSON value');
next = restoreModels(current, YAML, mapping);
} else next = unsetModels(current, YAML);
mkdirSync(dirname(path), { recursive: true });