MCPcopy
hub / github.com/anomalyco/models.dev / loadExisting

Function loadExisting

packages/core/script/generate-digitalocean.ts:236–246  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

234}
235
236async function loadExisting(filePath: string): Promise<ExistingModel | null> {
237 const file = Bun.file(filePath);
238 if (!(await file.exists())) return null;
239 try {
240 const mod = await import(filePath, { with: { type: "toml" } });
241 return mod.default as ExistingModel;
242 } catch (e) {
243 console.warn(`Warning: failed to parse ${filePath}:`, e);
244 return null;
245 }
246}
247
248// ---------------------------------------------------------------------------
249// Merged model shape (what we write)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected