MCPcopy
hub / github.com/angular/angular / maybeUnwrapDefaultExport

Function maybeUnwrapDefaultExport

packages/core/src/util/default_export.ts:26–30  ·  view source on GitHub ↗
(input: T | DefaultExport<T>)

Source from the content-addressed store, hash-verified

24}
25
26export function maybeUnwrapDefaultExport<T>(input: T | DefaultExport<T>): T {
27 // As per `isWrappedDefaultExport`, the `default` key here is generated by the browser and not
28 // subject to property renaming, so we reference it with bracket access.
29 return isWrappedDefaultExport(input) ? input['default'] : input;
30}
31
32function isWrappedDefaultExport<T>(value: T | DefaultExport<T>): value is DefaultExport<T> {
33 // We use `in` here with a string key `'default'`, because we expect `DefaultExport` objects to be

Callers 3

injectAsyncFunction · 0.90
loadComponentMethod · 0.85
loadChildrenFunction · 0.85

Calls 1

isWrappedDefaultExportFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…