MCPcopy Create free account
hub / github.com/anomalyco/models.dev / sameModel

Function sameModel

packages/core/src/sync/index.ts:599–609  ·  view source on GitHub ↗
(
  relativePath: string,
  current: ExistingModel,
  desired: z.infer<typeof SyncedAuthoredModel>,
)

Source from the content-addressed store, hash-verified

597}
598
599function sameModel(
600 relativePath: string,
601 current: ExistingModel,
602 desired: z.infer<typeof SyncedAuthoredModel>,
603) {
604 const parsed = SyncedAuthoredModel.safeParse({
605 id: relativePath.slice(0, -5),
606 ...current,
607 });
608 return parsed.success && stable(parsed.data) === stable(desired);
609}
610
611function stable(value: unknown): string {
612 if (Array.isArray(value)) {

Callers 1

syncProviderFunction · 0.70

Calls 1

stableFunction · 0.70

Tested by

no test coverage detected