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

Function readPluginId

packages/opencode/src/plugin/shared.ts:264–270  ·  view source on GitHub ↗
(id: unknown, spec: string)

Source from the content-addressed store, hash-verified

262}
263
264export function readPluginId(id: unknown, spec: string) {
265 if (id === undefined) return
266 if (typeof id !== "string") throw new TypeError(`Plugin ${spec} has invalid id type ${typeof id}`)
267 const value = id.trim()
268 if (!value) throw new TypeError(`Plugin ${spec} has an empty id`)
269 return value
270}
271
272export function readV1Plugin(
273 mod: Record<string, unknown>,

Callers 2

applyPluginFunction · 0.90
resolveExternalPluginsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected