* Recursively processes package.json `exports` to remove dist prefixes * @param {Record } exports - The exports object to process * @returns {Record } The processed exports object
(exports)
| 49 | * @returns {Record<string, any>} The processed exports object |
| 50 | */ |
| 51 | function processExports(exports) { |
| 52 | return Object.fromEntries( |
| 53 | Object.entries(exports).map(([key, value]) => [ |
| 54 | key, |
| 55 | typeof value === 'string' |
| 56 | ? replaceDist(value) |
| 57 | : typeof value === 'object' && value !== null |
| 58 | ? processExports(value) |
| 59 | : value, |
| 60 | ]), |
| 61 | ) |
| 62 | } |
| 63 | |
| 64 | console.log('Copying modified package.json') |
| 65 |