mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 18:18:43 +00:00
fix(cliproxy): preserve explicit false values in catalog --json
Use !== undefined checks instead of truthy checks so that explicitly set false booleans (e.g. extendedContext: false) appear in JSON output, allowing consumers to distinguish "not set" from "explicitly disabled". Built [OnSteroids](https://onsteroids.ai)
This commit is contained in:
@@ -198,13 +198,13 @@ export function handleCatalogJson(): void {
|
|||||||
for (const [provider, catalog] of Object.entries(catalogs)) {
|
for (const [provider, catalog] of Object.entries(catalogs)) {
|
||||||
result[provider] = catalog.models.map((m) => {
|
result[provider] = catalog.models.map((m) => {
|
||||||
const entry: CatalogJsonModel = { id: m.id, name: m.name };
|
const entry: CatalogJsonModel = { id: m.id, name: m.name };
|
||||||
if (m.tier) entry.tier = m.tier;
|
if (m.tier !== undefined) entry.tier = m.tier;
|
||||||
if (m.description) entry.description = m.description;
|
if (m.description !== undefined) entry.description = m.description;
|
||||||
if (m.deprecated) entry.deprecated = m.deprecated;
|
if (m.deprecated !== undefined) entry.deprecated = m.deprecated;
|
||||||
if (m.deprecationReason) entry.deprecationReason = m.deprecationReason;
|
if (m.deprecationReason !== undefined) entry.deprecationReason = m.deprecationReason;
|
||||||
if (m.broken) entry.broken = m.broken;
|
if (m.broken !== undefined) entry.broken = m.broken;
|
||||||
if (m.extendedContext) entry.extendedContext = m.extendedContext;
|
if (m.extendedContext !== undefined) entry.extendedContext = m.extendedContext;
|
||||||
if (m.nativeImageInput) entry.nativeImageInput = m.nativeImageInput;
|
if (m.nativeImageInput !== undefined) entry.nativeImageInput = m.nativeImageInput;
|
||||||
return entry;
|
return entry;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user