* Unwrap nested default exports (common with TS/ESM compiled to CJS).
(mod)
| 80 | * Unwrap nested default exports (common with TS/ESM compiled to CJS). |
| 81 | */ |
| 82 | function unwrapDefaults(mod) { |
| 83 | for (let i = 0; i < 5; i++) { |
| 84 | if (mod && mod.default) mod = mod.default; |
| 85 | else break; |
| 86 | } |
| 87 | return mod; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Create a Node.js (req, res) handler from web handler exports (GET, POST, fetch, etc.). |