MCPcopy Create free account
hub / github.com/Effect-TS/effect / targetToDeclaration

Method targetToDeclaration

packages/tools/api-diff/src/Discovery.ts:139–145  ·  view source on GitHub ↗
(packageInfo: PackageInfo, target: string)

Source from the content-addressed store, hash-verified

137 })
138
139 const targetToDeclaration = (packageInfo: PackageInfo, target: string): string | undefined => {
140 const relativeTarget = target.replace(/^\.\//, "")
141 const declaration = relativeTarget.endsWith(".d.ts")
142 ? relativeTarget
143 : relativeTarget.replace(/\.(?:mjs|cjs|js|mts|cts|ts)$/, ".d.ts")
144 return declaration.endsWith(".d.ts") ? path.resolve(packageInfo.root, declaration) : undefined
145 }
146
147 const expandPattern = Effect.fnUntraced(function*(
148 packageInfo: PackageInfo,

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected