MCPcopy
hub / github.com/webpack/webpack / _forEachLevelWaterfall

Method _forEachLevelWaterfall

lib/stats/StatsPrinter.js:183–188  ·  view source on GitHub ↗

* Run `fn` for each level * @private * @template {StatsPrintHooks[keyof StatsPrintHooks]} HM * @template {HM extends HookMap<infer H> ? H : never} H * @param {HM} hookMap hook map * @param {string} type type * @param {string} data data * @param {(hook: H, data: string) => string} fn fn

(hookMap, type, data, fn)

Source from the content-addressed store, hash-verified

181 * @returns {string | undefined} result of `fn`
182 */
183 _forEachLevelWaterfall(hookMap, type, data, fn) {
184 for (const hook of this._getAllLevelHooks(hookMap, type)) {
185 data = fn(/** @type {H} */ (hook), data);
186 }
187 return data;
188 }
189
190 /**
191 * Returns printed result.

Callers 1

_printMethod · 0.95

Calls 2

_getAllLevelHooksMethod · 0.95
fnFunction · 0.50

Tested by

no test coverage detected