(exports: any, sourceModule: any)
| 424 | } |
| 425 | |
| 426 | function exportAll(exports: any, sourceModule: any) { |
| 427 | // when a module exports itself it causes |
| 428 | // call stack error |
| 429 | if (exports === sourceModule) return |
| 430 | |
| 431 | if ( |
| 432 | isPrimitive(sourceModule) || |
| 433 | Array.isArray(sourceModule) || |
| 434 | sourceModule instanceof Promise |
| 435 | ) |
| 436 | return |
| 437 | |
| 438 | for (const key in sourceModule) { |
| 439 | if (key !== 'default' && key !== '__esModule' && !(key in exports)) { |
| 440 | try { |
| 441 | Object.defineProperty(exports, key, { |
| 442 | enumerable: true, |
| 443 | configurable: true, |
| 444 | get: () => sourceModule[key], |
| 445 | }) |
| 446 | } catch {} |
| 447 | } |
| 448 | } |
| 449 | } |
no test coverage detected