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

Function packageExportTargetMatches

packages/tools/jsdocs/src/Jsdocs.ts:695–710  ·  view source on GitHub ↗
(value: unknown, star: string | null, expectedTarget: string)

Source from the content-addressed store, hash-verified

693}
694
695function packageExportTargetMatches(value: unknown, star: string | null, expectedTarget: string): boolean {
696 if (typeof value === "string") {
697 const target = normalizePackagePath(star === null ? value : value.replaceAll("*", star))
698 return target === expectedTarget
699 }
700 if (value === null || value === undefined) {
701 return false
702 }
703 if (Array.isArray(value)) {
704 return value.some((item) => packageExportTargetMatches(item, star, expectedTarget))
705 }
706 if (isRecord(value)) {
707 return Object.values(value).some((item) => packageExportTargetMatches(item, star, expectedTarget))
708 }
709 return false
710}
711
712function isPackageSubpathExported(
713 packageExports: unknown,

Callers 1

isPackageSubpathExportedFunction · 0.85

Calls 3

normalizePackagePathFunction · 0.85
someMethod · 0.80
isRecordFunction · 0.70

Tested by

no test coverage detected