MCPcopy
hub / github.com/anomalyco/opencode / pick

Function pick

packages/desktop/scripts/finalize-latest-json.ts:101–106  ·  view source on GitHub ↗
(list: Item[], exts: string[])

Source from the content-addressed store, hash-verified

99}
100
101function pick(list: Item[], exts: string[]) {
102 for (const ext of exts) {
103 const found = list.find((item) => item.url.split("?")[0]?.toLowerCase().endsWith(ext))
104 if (found) return found.url
105 }
106}
107
108function link(raw: string) {
109 if (raw.startsWith("https://") || raw.startsWith("http://")) return raw

Callers 1

Calls 1

findMethod · 0.65

Tested by

no test coverage detected