220 unmodified lines
Expand all
return undefined;
}
}
/** Sorted by id: the endpoint's order is not stable, and registration order follows this. */
export const toCatalog = (models: readonly ModelFacts[]): Catalog => ({
version: CATALOG_VERSION,
generatedAt: new Date().toISOString(),
models: [...models],
models: [...models].sort((a, b) => a.id.localeCompare(b.id)),
});
export function writeCatalog(path: string, catalog: Catalog): void {
writeFileSync(path, `${JSON.stringify(catalog, null, "\t")}\n`);