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

Function packageExportTargetMatches

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

Source from the content-addressed store, hash-verified

707}
708
709function packageExportTargetMatches(value: unknown, star: string | null, expectedTarget: string): boolean {
710 if (typeof value === "string") {
711 const target = normalizePackagePath(star === null ? value : value.replaceAll("*", star))
712 return target === expectedTarget
713 }
714 if (value === null || value === undefined) {
715 return false
716 }
717 if (Array.isArray(value)) {
718 return value.some((item) => packageExportTargetMatches(item, star, expectedTarget))
719 }
720 if (isRecord(value)) {
721 return Object.values(value).some((item) => packageExportTargetMatches(item, star, expectedTarget))
722 }
723 return false
724}
725
726function isPackageSubpathExported(
727 packageExports: unknown,

Callers 1

isPackageSubpathExportedFunction · 0.85

Calls 3

normalizePackagePathFunction · 0.85
someMethod · 0.80
isRecordFunction · 0.70

Tested by

no test coverage detected