Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptESM CJS interopSingle-choice MCQ

In a CommonJS module loaded via Node's ESM interop, `import pkg from "some-cjs-pkg"` gives `pkg` as the module's `module.exports`. Given `esModuleInterop: true`, how does TypeScript's emitted `__importDefault` helper decide what the default binding becomes?

// some-cjs-pkg's module.exports = function () {} import fn from "some-cjs-pkg"; fn();