MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / buildIndex

Function buildIndex

test/model-resolve.test.ts:26–34  ·  view source on GitHub ↗
(models: Array<{ provider: string; id: string }>)

Source from the content-addressed store, hash-verified

24
25// Build an index the way the router does: each model under `${provider}/${id}` AND `${id}`.
26function buildIndex(models: Array<{ provider: string; id: string }>): Map<string, Val> {
27 const m = new Map<string, Val>();
28 for (const { provider, id } of models) {
29 const val: Val = { provider: { name: provider }, info: { id } };
30 m.set(`${provider}/${id}`, val);
31 m.set(id, val);
32 }
33 return m;
34}
35
36let passed = 0, failed = 0;
37function check(name: string, cond: boolean) {

Callers 1

Calls 1

setMethod · 0.45

Tested by

no test coverage detected