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

Function exportTarget

packages/opencode/src/plugin/install.ts:128–137  ·  view source on GitHub ↗
(pkg: Record<string, unknown>, kind: Kind)

Source from the content-addressed store, hash-verified

126}
127
128function exportTarget(pkg: Record<string, unknown>, kind: Kind) {
129 const exports = pkg.exports
130 if (!isRecord(exports)) return
131 const value = exports[`./${kind}`]
132 const entry = exportValue(value)
133 if (!entry) return
134 return {
135 opts: exportOptions(value),
136 }
137}
138
139function hasMainTarget(pkg: Record<string, unknown>) {
140 const main = pkg.main

Callers 1

packageTargetsFunction · 0.85

Calls 3

isRecordFunction · 0.90
exportValueFunction · 0.85
exportOptionsFunction · 0.85

Tested by

no test coverage detected