* Recursively processes package.json `exports` to remove dist prefixes * @param {Record } exports - The exports object to process * @returns {Record } The processed exports object
(exports)
| 56 | * @returns {Record<string, any>} The processed exports object |
| 57 | */ |
| 58 | function processExports(exports) { |
| 59 | return Object.fromEntries( |
| 60 | Object.entries(exports) |
| 61 | .filter(([key]) => key !== '@tanstack/custom-condition') |
| 62 | .map(([key, value]) => [ |
| 63 | key, |
| 64 | typeof value === 'string' |
| 65 | ? replaceDist(value) |
| 66 | : typeof value === 'object' && value !== null |
| 67 | ? processExports(value) |
| 68 | : value, |
| 69 | ]), |
| 70 | ) |
| 71 | } |
| 72 | |
| 73 | console.log('Copying modified package.json') |
| 74 |