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:
1 parent
7f89ae70bd
commit
953401a431
4 files changed
+27
-6
No files matched your search
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user