MCPcopy Index your code
hub / github.com/anomalyco/opencode / uniqueModule

Function uniqueModule

packages/httpapi-codegen/src/index.ts:601–607  ·  view source on GitHub ↗
(base: string, index: number, modules: ReadonlySet<string>)

Source from the content-addressed store, hash-verified

599}
600
601function uniqueModule(base: string, index: number, modules: ReadonlySet<string>) {
602 if (!modules.has(base.toLowerCase())) return base
603 const seed = `${base}-${index}`
604 let suffix = 0
605 while (modules.has(`${seed}${suffix === 0 ? "" : `-${suffix}`}`.toLowerCase())) suffix++
606 return `${seed}${suffix === 0 ? "" : `-${suffix}`}`
607}
608
609function normalizeTransport(
610 schema: Schema.Top | undefined,

Callers 1

compileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected