MCPcopy Create free account
hub / github.com/vercel/vercel / unwrapDefaults

Function unwrapDefaults

packages/node/src/bundling-handler.js:82–88  ·  view source on GitHub ↗

* Unwrap nested default exports (common with TS/ESM compiled to CJS).

(mod)

Source from the content-addressed store, hash-verified

80 * Unwrap nested default exports (common with TS/ESM compiled to CJS).
81 */
82function 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.).

Callers 1

compileUserCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected