MCPcopy
hub / github.com/webpack/webpack / isLazy

Method isLazy

lib/serialization/SerializerMiddleware.js:94–98  ·  view source on GitHub ↗

* Checks whether this serializer middleware is lazy. * @template {LazyTarget} TLazyTarget * @param {EXPECTED_ANY} fn lazy function * @param {TLazyTarget=} target target middleware * @returns {fn is LazyFunction<EXPECTED_ANY, EXPECTED_ANY, TLazyTarget, EXPECTED_ANY>} true, when fn is a lazy f

(fn, target)

Source from the content-addressed store, hash-verified

92 * @returns {fn is LazyFunction<EXPECTED_ANY, EXPECTED_ANY, TLazyTarget, EXPECTED_ANY>} true, when fn is a lazy function (optionally of that target)
93 */
94 static isLazy(fn, target) {
95 if (typeof fn !== "function") return false;
96 const t = fn[LAZY_TARGET];
97 return target ? t === target : Boolean(t);
98 }
99
100 /**
101 * Returns options.

Callers 5

serializeFunction · 0.45
processMethod · 0.45
_serializeMethod · 0.45
createLazyMethod · 0.45
unMemoizeLazyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected