Skip to content

extractDefaultExportInterop<T>

Extracts the default export from a module.

Useful to handle incorrect default export interop between ESM and CJS.

Import:

import { extractDefaultExportInterop } from '@mnaoumov/typescript-lib/object-utils';

Signature:

function extractDefaultExportInterop(module: T | ModuleWithDefaultExport<T>): T

Parameters:

Parameter Type Description
module T | ModuleWithDefaultExport<T> The module to extract the default export from.

Returns: T — The default export.