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

Function extractExportValue

packages/opencode/src/plugin/shared.ts:71–79  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

69}
70
71function extractExportValue(value: unknown): string | undefined {
72 if (typeof value === "string") return value
73 if (!isRecord(value)) return undefined
74 for (const key of ["import", "default"]) {
75 const nested = value[key]
76 if (typeof nested === "string") return nested
77 }
78 return undefined
79}
80
81function packageMain(pkg: PluginPackage) {
82 const value = pkg.json.main

Callers 1

resolvePackageEntrypointFunction · 0.85

Calls 1

isRecordFunction · 0.90

Tested by

no test coverage detected