MCPcopy
hub / github.com/angular/angular / maybeUnwrapFn

Function maybeUnwrapFn

packages/core/src/render3/util/misc_utils.ts:54–60  ·  view source on GitHub ↗
(value: T | (() => T))

Source from the content-addressed store, hash-verified

52 * Unwrap a value which might be behind a closure (for forward declaration reasons).
53 */
54export function maybeUnwrapFn<T>(value: T | (() => T)): T {
55 if (value instanceof Function) {
56 return value();
57 } else {
58 return value;
59 }
60}

Callers 6

constructorMethod · 0.90
computeCombinedExportsFunction · 0.90
resolveNgModulesDeclsMethod · 0.90
computeNgModuleScopeMethod · 0.90

Calls 1

valueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…