| 34 | const decodePackageManifest = Schema.decodeUnknownEffect(Schema.fromJsonString(PackageManifest)) |
| 35 | |
| 36 | const exportedTarget = (value: unknown): string | null | undefined => { |
| 37 | if (value === null || typeof value === "string") { |
| 38 | return value |
| 39 | } |
| 40 | if (typeof value !== "object" || value === null) { |
| 41 | return undefined |
| 42 | } |
| 43 | for (const condition of ["types", "import", "default", "node", "browser"]) { |
| 44 | const target = exportedTarget(Reflect.get(value, condition)) |
| 45 | if (target !== undefined) { |
| 46 | return target |
| 47 | } |
| 48 | } |
| 49 | return undefined |
| 50 | } |
| 51 | |
| 52 | const matchPattern = (pattern: string, value: string): string | undefined => { |
| 53 | const star = pattern.indexOf("*") |