MCPcopy
hub / github.com/webpack/webpack / _forEachLevel

Method _forEachLevel

lib/stats/StatsPrinter.js:165–170  ·  view source on GitHub ↗

* Run `fn` for each level * @private * @template {StatsPrintHooks[keyof StatsPrintHooks]} HM * @template {HM extends HookMap<infer H> ? H : never} H * @template {H extends import("tapable").Hook<infer A, infer R> ? R : never} R * @param {HM} hookMap hook map * @param {string} type type

(hookMap, type, fn)

Source from the content-addressed store, hash-verified

163 * @returns {R | undefined} hook
164 */
165 _forEachLevel(hookMap, type, fn) {
166 for (const hook of this._getAllLevelHooks(hookMap, type)) {
167 const result = fn(/** @type {H} */ (hook));
168 if (result !== undefined) return /** @type {R} */ (result);
169 }
170 }
171
172 /**
173 * Run `fn` for each level

Callers 1

_printMethod · 0.95

Calls 2

_getAllLevelHooksMethod · 0.95
fnFunction · 0.50

Tested by

no test coverage detected