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

With `esModuleInterop: true` and `module: "commonjs"`, default-importing a module that has the `__esModule: true` marker behaves differently from default-importing one without it. What does the emitted `__importDefault` helper do, and why does the marker matter?

// __importDefault roughly: function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; }