(value: unknown, star: string | null, expectedTarget: string)
| 693 | } |
| 694 | |
| 695 | function 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 | |
| 712 | function isPackageSubpathExported( |
| 713 | packageExports: unknown, |
no test coverage detected