From 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 四月 2026 11:46:41 +0800
Subject: [PATCH] 推送
---
node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js b/node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js
index 4a8828e..fc7546e 100644
--- a/node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js
+++ b/node_modules/webpack/lib/stats/DefaultStatsPresetPlugin.js
@@ -17,6 +17,7 @@
/** @typedef {import("./DefaultStatsFactoryPlugin").StatsError} StatsError */
/**
+ * Processes the provided normalized stats option.
* @param {Partial<NormalizedStatsOptions>} options options
* @param {StatsOptions} defaults default options
*/
@@ -30,7 +31,7 @@
}
};
-/** @typedef {{ [Key in Exclude<StatsValue, boolean | object | "normal">]: StatsOptions }} NamedPresets */
+/** @typedef {{ [Key in Exclude<StatsValue, boolean | EXPECTED_OBJECT | "normal">]: StatsOptions }} NamedPresets */
/** @type {NamedPresets} */
const NAMED_PRESETS = {
@@ -144,16 +145,19 @@
};
/**
+ * Returns true when enabled, otherwise false.
* @param {Partial<NormalizedStatsOptions>} all stats options
* @returns {boolean} true when enabled, otherwise false
*/
const NORMAL_ON = ({ all }) => all !== false;
/**
+ * Returns true when enabled, otherwise false.
* @param {Partial<NormalizedStatsOptions>} all stats options
* @returns {boolean} true when enabled, otherwise false
*/
const NORMAL_OFF = ({ all }) => all === true;
/**
+ * Returns true when enabled, otherwise false.
* @param {Partial<NormalizedStatsOptions>} all stats options
* @param {CreateStatsOptionsContext} forToString stats options context
* @returns {boolean} true when enabled, otherwise false
@@ -161,6 +165,7 @@
const ON_FOR_TO_STRING = ({ all }, { forToString }) =>
forToString ? all !== false : all === true;
/**
+ * Returns true when enabled, otherwise false.
* @param {Partial<NormalizedStatsOptions>} all stats options
* @param {CreateStatsOptionsContext} forToString stats options context
* @returns {boolean} true when enabled, otherwise false
@@ -168,6 +173,7 @@
const OFF_FOR_TO_STRING = ({ all }, { forToString }) =>
forToString ? all === true : all !== false;
/**
+ * Auto for to string.
* @param {Partial<NormalizedStatsOptions>} all stats options
* @param {CreateStatsOptionsContext} forToString stats options context
* @returns {boolean | "auto"} true when enabled, otherwise false
@@ -285,11 +291,13 @@
};
/**
+ * Defines the normalize function type used by this module.
* @template T
* @typedef {(value: T, ...args: EXPECTED_ANY[]) => boolean} NormalizeFunction
*/
/**
+ * Returns normalize fn.
* @template {string} T
* @param {string | ({ test: (value: T) => boolean }) | NormalizeFunction<T> | boolean} item item to normalize
* @returns {NormalizeFunction<T>} normalize fn
@@ -315,6 +323,7 @@
/** @typedef {{ [Key in NormalizerKeys]?: (value: StatsOptions[Key]) => KnownNormalizedStatsOptions[Key] }} Normalizers */
/**
+ * Defines the warning filter fn callback.
* @callback WarningFilterFn
* @param {StatsError} warning warning
* @param {string} warningString warning string
@@ -343,6 +352,7 @@
}
return value.map(
/**
+ * Handles the warnings filter callback for this hook.
* @param {StatsOptions["warningsFilter"]} filter a warning filter
* @returns {WarningFilterFn} result
*/
@@ -380,7 +390,7 @@
class DefaultStatsPresetPlugin {
/**
- * Apply the plugin
+ * Applies the plugin by registering its hooks on the compiler.
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
--
Gitblit v1.9.3