(value: unknown, star: string | null, expectedTarget: string)
| 707 | } |
| 708 | |
| 709 | function 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 | |
| 726 | function isPackageSubpathExported( |
| 727 | packageExports: unknown, |
no test coverage detected