* 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)
| 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. |
no test coverage detected