webpack 5.85.0 → 5.88.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +5 -2
- package/lib/APIPlugin.js +150 -99
- package/lib/AsyncDependenciesBlock.js +3 -3
- package/lib/BannerPlugin.js +2 -1
- package/lib/CaseSensitiveModulesWarning.js +3 -1
- package/lib/Chunk.js +35 -17
- package/lib/ChunkGraph.js +4 -4
- package/lib/ChunkGroup.js +20 -9
- package/lib/CompatibilityPlugin.js +50 -30
- package/lib/Compilation.js +2 -1
- package/lib/Compiler.js +10 -9
- package/lib/ConcatenationScope.js +2 -2
- package/lib/ConditionalInitFragment.js +11 -1
- package/lib/ConstPlugin.js +73 -32
- package/lib/ContextModule.js +8 -3
- package/lib/ContextModuleFactory.js +1 -0
- package/lib/ContextReplacementPlugin.js +13 -0
- package/lib/DelegatedModule.js +15 -3
- package/lib/DelegatedModuleFactoryPlugin.js +6 -0
- package/lib/DependenciesBlock.js +1 -1
- package/lib/Dependency.js +11 -5
- package/lib/DependencyTemplates.js +1 -1
- package/lib/DllEntryPlugin.js +11 -1
- package/lib/DllModule.js +6 -0
- package/lib/DllReferencePlugin.js +13 -1
- package/lib/Entrypoint.js +1 -1
- package/lib/ErrorHelpers.js +1 -0
- package/lib/EvalSourceMapDevToolPlugin.js +6 -1
- package/lib/ExportsInfo.js +22 -4
- package/lib/ExportsInfoApiPlugin.js +14 -5
- package/lib/ExternalModule.js +20 -8
- package/lib/FileSystemInfo.js +52 -24
- package/lib/FlagAllModulesAsUsedPlugin.js +6 -1
- package/lib/FlagDependencyUsagePlugin.js +3 -1
- package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
- package/lib/Generator.js +7 -0
- package/lib/HotModuleReplacementPlugin.js +8 -0
- package/lib/InitFragment.js +28 -5
- package/lib/JavascriptMetaInfoPlugin.js +11 -6
- package/lib/LibManifestPlugin.js +20 -4
- package/lib/Module.js +14 -3
- package/lib/ModuleDependencyError.js +4 -2
- package/lib/ModuleDependencyWarning.js +4 -2
- package/lib/ModuleGraph.js +31 -24
- package/lib/ModuleGraphConnection.js +19 -6
- package/lib/ModuleInfoHeaderPlugin.js +9 -2
- package/lib/ModuleNotFoundError.js +5 -2
- package/lib/ModuleProfile.js +1 -0
- package/lib/ModuleRestoreError.js +2 -0
- package/lib/ModuleStoreError.js +2 -1
- package/lib/ModuleTypeConstants.js +7 -0
- package/lib/MultiWatching.js +4 -0
- package/lib/NodeStuffPlugin.js +32 -6
- package/lib/ProgressPlugin.js +71 -15
- package/lib/ProvidePlugin.js +13 -4
- package/lib/RawModule.js +3 -1
- package/lib/RequireJsStuffPlugin.js +7 -0
- package/lib/RuntimeGlobals.js +5 -0
- package/lib/RuntimeModule.js +3 -3
- package/lib/RuntimePlugin.js +6 -3
- package/lib/RuntimeTemplate.js +22 -4
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
- package/lib/SourceMapDevToolPlugin.js +7 -2
- package/lib/UseStrictPlugin.js +10 -3
- package/lib/Watching.js +62 -25
- package/lib/WebpackError.js +6 -5
- package/lib/WebpackIsIncludedPlugin.js +6 -4
- package/lib/WebpackOptionsApply.js +4 -2
- package/lib/WebpackOptionsDefaulter.js +10 -3
- package/lib/asset/AssetGenerator.js +2 -1
- package/lib/asset/AssetParser.js +11 -6
- package/lib/asset/AssetSourceParser.js +8 -3
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
- package/lib/buildChunkGraph.js +37 -21
- package/lib/cache/IdleFileCachePlugin.js +2 -1
- package/lib/cache/PackFileCacheStrategy.js +53 -22
- package/lib/config/browserslistTargetHandler.js +7 -7
- package/lib/config/defaults.js +43 -26
- package/lib/container/RemoteRuntimeModule.js +1 -1
- package/lib/css/CssExportsGenerator.js +9 -0
- package/lib/css/CssGenerator.js +1 -1
- package/lib/css/CssLoadingRuntimeModule.js +43 -19
- package/lib/css/CssModulesPlugin.js +42 -14
- package/lib/css/CssParser.js +22 -0
- package/lib/dependencies/AMDDefineDependency.js +34 -4
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +5 -0
- package/lib/dependencies/AMDRuntimeModules.js +2 -2
- package/lib/dependencies/CommonJsExportsParserPlugin.js +14 -4
- package/lib/dependencies/CommonJsImportsParserPlugin.js +169 -59
- package/lib/dependencies/CommonJsPlugin.js +13 -8
- package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
- package/lib/dependencies/ConstDependency.js +2 -2
- package/lib/dependencies/ContextDependency.js +7 -2
- package/lib/dependencies/CssImportDependency.js +1 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +5 -0
- package/lib/dependencies/CssUrlDependency.js +3 -3
- package/lib/dependencies/DllEntryDependency.js +5 -0
- package/lib/dependencies/DynamicExports.js +10 -6
- package/lib/dependencies/ExportsInfoDependency.js +14 -4
- package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +3 -1
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +12 -5
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +4 -4
- package/lib/dependencies/HarmonyExports.js +9 -5
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +40 -27
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +1 -2
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +31 -21
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
- package/lib/dependencies/ImportDependency.js +5 -3
- package/lib/dependencies/ImportEagerDependency.js +5 -3
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
- package/lib/dependencies/ImportMetaPlugin.js +31 -15
- package/lib/dependencies/ImportParserPlugin.js +62 -25
- package/lib/dependencies/ImportWeakDependency.js +5 -3
- package/lib/dependencies/JsonExportsDependency.js +1 -1
- package/lib/dependencies/ModuleDependency.js +1 -1
- package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
- package/lib/dependencies/ProvidedDependency.js +4 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +5 -2
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
- package/lib/dependencies/RequireHeaderDependency.js +4 -0
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +26 -5
- package/lib/dependencies/RequireResolveHeaderDependency.js +9 -0
- package/lib/dependencies/SystemPlugin.js +17 -5
- package/lib/dependencies/SystemRuntimeModule.js +1 -1
- package/lib/dependencies/URLDependency.js +2 -2
- package/lib/dependencies/URLPlugin.js +9 -4
- package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +59 -22
- package/lib/esm/ExportWebpackRequireRuntimeModule.js +1 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
- package/lib/ids/HashedModuleIdsPlugin.js +1 -1
- package/lib/ids/SyncModuleIdsPlugin.js +1 -0
- package/lib/javascript/BasicEvaluatedExpression.js +28 -19
- package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
- package/lib/javascript/JavascriptModulesPlugin.js +25 -5
- package/lib/javascript/JavascriptParser.js +157 -85
- package/lib/javascript/JavascriptParserHelpers.js +37 -15
- package/lib/json/JsonData.js +2 -2
- package/lib/json/JsonParser.js +25 -12
- package/lib/library/AmdLibraryPlugin.js +2 -2
- package/lib/library/AssignLibraryPlugin.js +13 -1
- package/lib/library/EnableLibraryPlugin.js +4 -0
- package/lib/library/SystemLibraryPlugin.js +1 -1
- package/lib/library/UmdLibraryPlugin.js +20 -2
- package/lib/logging/runtime.js +1 -1
- package/lib/logging/truncateArgs.js +4 -0
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +10 -6
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +10 -6
- package/lib/optimize/AggressiveMergingPlugin.js +8 -0
- package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
- package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
- package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
- package/lib/optimize/InnerGraph.js +5 -5
- package/lib/optimize/InnerGraphPlugin.js +2 -1
- package/lib/optimize/LimitChunkCountPlugin.js +29 -4
- package/lib/optimize/MangleExportsPlugin.js +1 -1
- package/lib/optimize/MinMaxSizeWarning.js +5 -0
- package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
- package/lib/optimize/RealContentHashPlugin.js +80 -30
- package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
- package/lib/optimize/RuntimeChunkPlugin.js +9 -1
- package/lib/optimize/SideEffectsFlagPlugin.js +10 -1
- package/lib/optimize/SplitChunksPlugin.js +71 -31
- package/lib/performance/SizeLimitsPlugin.js +7 -4
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
- package/lib/rules/BasicEffectRulePlugin.js +4 -0
- package/lib/rules/BasicMatcherRulePlugin.js +5 -0
- package/lib/rules/RuleSetCompiler.js +3 -3
- package/lib/rules/UseEffectRulePlugin.js +6 -4
- package/lib/runtime/AsyncModuleRuntimeModule.js +8 -5
- package/lib/runtime/AutoPublicPathRuntimeModule.js +4 -2
- package/lib/runtime/BaseUriRuntimeModule.js +3 -3
- package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
- package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
- package/lib/runtime/CompatRuntimeModule.js +7 -2
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
- package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
- package/lib/runtime/EnsureChunkRuntimeModule.js +15 -4
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -10
- package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
- package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +4 -2
- package/lib/runtime/GlobalRuntimeModule.js +1 -1
- package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
- package/lib/runtime/LoadScriptRuntimeModule.js +64 -48
- package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/NonceRuntimeModule.js +1 -1
- package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
- package/lib/runtime/PublicPathRuntimeModule.js +4 -2
- package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
- package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +9 -3
- package/lib/runtime/StartupEntrypointRuntimeModule.js +3 -2
- package/lib/runtime/SystemContextRuntimeModule.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +143 -1
- package/lib/serialization/ErrorObjectSerializer.js +3 -0
- package/lib/serialization/ObjectMiddleware.js +9 -3
- package/lib/serialization/types.js +1 -1
- package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
- package/lib/sharing/ConsumeSharedRuntimeModule.js +14 -5
- package/lib/sharing/ProvideSharedDependency.js +11 -0
- package/lib/sharing/ProvideSharedModule.js +4 -0
- package/lib/sharing/ProvideSharedPlugin.js +22 -21
- package/lib/sharing/ShareRuntimeModule.js +12 -5
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/sharing/utils.js +32 -5
- package/lib/util/AsyncQueue.js +4 -2
- package/lib/util/ParallelismFactorCalculator.js +10 -0
- package/lib/util/Semaphore.js +1 -1
- package/lib/util/StackedCacheMap.js +1 -1
- package/lib/util/URLAbsoluteSpecifier.js +1 -1
- package/lib/util/createHash.js +30 -9
- package/lib/util/deprecation.js +10 -3
- package/lib/util/deterministicGrouping.js +50 -11
- package/lib/util/findGraphRoots.js +4 -2
- package/lib/util/memoize.js +3 -3
- package/lib/util/processAsyncTree.js +7 -1
- package/lib/util/registerExternalSerializer.js +1 -1
- package/lib/util/runtime.js +84 -21
- package/lib/util/semver.js +1 -0
- package/lib/util/smartGrouping.js +1 -1
- package/lib/validateSchema.js +6 -2
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +6 -2
- package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +14 -7
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
- package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
- package/lib/wasm-sync/WebAssemblyParser.js +6 -2
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +14 -4
- package/lib/webpack.js +11 -2
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +15 -16
- package/module.d.ts +1 -0
- package/package.json +5 -4
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +52 -6
- package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
- package/schemas/plugins/css/CssParserOptions.json +1 -1
- package/types.d.ts +606 -292
package/lib/util/createHash.js
CHANGED
@@ -11,11 +11,14 @@ const BULK_SIZE = 2000;
|
|
11
11
|
|
12
12
|
// We are using an object instead of a Map as this will stay static during the runtime
|
13
13
|
// so access to it can be optimized by v8
|
14
|
+
/** @type {Object<string, Map<string, string>>} */
|
14
15
|
const digestCaches = {};
|
15
16
|
|
17
|
+
/** @typedef {function(): Hash} HashFactory */
|
18
|
+
|
16
19
|
class BulkUpdateDecorator extends Hash {
|
17
20
|
/**
|
18
|
-
* @param {Hash |
|
21
|
+
* @param {Hash | HashFactory} hashOrFactory function to create a hash
|
19
22
|
* @param {string=} hashKey key for caching
|
20
23
|
*/
|
21
24
|
constructor(hashOrFactory, hashKey) {
|
@@ -43,7 +46,8 @@ class BulkUpdateDecorator extends Hash {
|
|
43
46
|
typeof data !== "string" ||
|
44
47
|
data.length > BULK_SIZE
|
45
48
|
) {
|
46
|
-
if (this.hash === undefined)
|
49
|
+
if (this.hash === undefined)
|
50
|
+
this.hash = /** @type {HashFactory} */ (this.hashFactory)();
|
47
51
|
if (this.buffer.length > 0) {
|
48
52
|
this.hash.update(this.buffer);
|
49
53
|
this.buffer = "";
|
@@ -52,7 +56,8 @@ class BulkUpdateDecorator extends Hash {
|
|
52
56
|
} else {
|
53
57
|
this.buffer += data;
|
54
58
|
if (this.buffer.length > BULK_SIZE) {
|
55
|
-
if (this.hash === undefined)
|
59
|
+
if (this.hash === undefined)
|
60
|
+
this.hash = /** @type {HashFactory} */ (this.hashFactory)();
|
56
61
|
this.hash.update(this.buffer);
|
57
62
|
this.buffer = "";
|
58
63
|
}
|
@@ -77,7 +82,7 @@ class BulkUpdateDecorator extends Hash {
|
|
77
82
|
}
|
78
83
|
const cacheEntry = digestCache.get(buffer);
|
79
84
|
if (cacheEntry !== undefined) return cacheEntry;
|
80
|
-
this.hash = this.hashFactory();
|
85
|
+
this.hash = /** @type {HashFactory} */ (this.hashFactory)();
|
81
86
|
}
|
82
87
|
if (buffer.length > 0) {
|
83
88
|
this.hash.update(buffer);
|
@@ -111,7 +116,9 @@ class DebugHash extends Hash {
|
|
111
116
|
if (data.startsWith(prefix)) {
|
112
117
|
data = Buffer.from(data.slice(prefix.length), "hex").toString();
|
113
118
|
}
|
114
|
-
this.string += `[${data}](${
|
119
|
+
this.string += `[${data}](${
|
120
|
+
/** @type {string} */ (new Error().stack).split("\n", 3)[2]
|
121
|
+
})\n`;
|
115
122
|
return this;
|
116
123
|
}
|
117
124
|
|
@@ -125,9 +132,13 @@ class DebugHash extends Hash {
|
|
125
132
|
}
|
126
133
|
}
|
127
134
|
|
135
|
+
/** @type {typeof import("crypto") | undefined} */
|
128
136
|
let crypto = undefined;
|
137
|
+
/** @type {typeof import("./hash/xxhash64") | undefined} */
|
129
138
|
let createXXHash64 = undefined;
|
139
|
+
/** @type {typeof import("./hash/md4") | undefined} */
|
130
140
|
let createMd4 = undefined;
|
141
|
+
/** @type {typeof import("./hash/BatchedHash") | undefined} */
|
131
142
|
let BatchedHash = undefined;
|
132
143
|
|
133
144
|
/**
|
@@ -150,7 +161,9 @@ module.exports = algorithm => {
|
|
150
161
|
BatchedHash = require("./hash/BatchedHash");
|
151
162
|
}
|
152
163
|
}
|
153
|
-
return new BatchedHash(
|
164
|
+
return new /** @type {typeof import("./hash/BatchedHash")} */ (
|
165
|
+
BatchedHash
|
166
|
+
)(createXXHash64());
|
154
167
|
case "md4":
|
155
168
|
if (createMd4 === undefined) {
|
156
169
|
createMd4 = require("./hash/md4");
|
@@ -158,14 +171,22 @@ module.exports = algorithm => {
|
|
158
171
|
BatchedHash = require("./hash/BatchedHash");
|
159
172
|
}
|
160
173
|
}
|
161
|
-
return new BatchedHash(
|
174
|
+
return new /** @type {typeof import("./hash/BatchedHash")} */ (
|
175
|
+
BatchedHash
|
176
|
+
)(createMd4());
|
162
177
|
case "native-md4":
|
163
178
|
if (crypto === undefined) crypto = require("crypto");
|
164
|
-
return new BulkUpdateDecorator(
|
179
|
+
return new BulkUpdateDecorator(
|
180
|
+
() => /** @type {typeof import("crypto")} */ (crypto).createHash("md4"),
|
181
|
+
"md4"
|
182
|
+
);
|
165
183
|
default:
|
166
184
|
if (crypto === undefined) crypto = require("crypto");
|
167
185
|
return new BulkUpdateDecorator(
|
168
|
-
() =>
|
186
|
+
() =>
|
187
|
+
/** @type {typeof import("crypto")} */ (crypto).createHash(
|
188
|
+
/** @type {string} */ (algorithm)
|
189
|
+
),
|
169
190
|
algorithm
|
170
191
|
);
|
171
192
|
}
|
package/lib/util/deprecation.js
CHANGED
@@ -78,7 +78,7 @@ exports.arrayToSetDeprecation = (set, name) => {
|
|
78
78
|
);
|
79
79
|
/**
|
80
80
|
* @deprecated
|
81
|
-
* @this {Set}
|
81
|
+
* @this {Set<any>}
|
82
82
|
* @returns {number} count
|
83
83
|
*/
|
84
84
|
set[method] = function () {
|
@@ -101,7 +101,7 @@ exports.arrayToSetDeprecation = (set, name) => {
|
|
101
101
|
);
|
102
102
|
/**
|
103
103
|
* @deprecated
|
104
|
-
* @this {Set}
|
104
|
+
* @this {Set<any>}
|
105
105
|
* @returns {number} count
|
106
106
|
*/
|
107
107
|
set.push = function () {
|
@@ -119,9 +119,13 @@ exports.arrayToSetDeprecation = (set, name) => {
|
|
119
119
|
);
|
120
120
|
};
|
121
121
|
}
|
122
|
+
/**
|
123
|
+
* @param {number} index index
|
124
|
+
* @returns {any} value
|
125
|
+
*/
|
122
126
|
const createIndexGetter = index => {
|
123
127
|
/**
|
124
|
-
* @this {Set} a Set
|
128
|
+
* @this {Set<any>} a Set
|
125
129
|
* @returns {any} the value at this location
|
126
130
|
*/
|
127
131
|
const fn = function () {
|
@@ -134,6 +138,9 @@ exports.arrayToSetDeprecation = (set, name) => {
|
|
134
138
|
};
|
135
139
|
return fn;
|
136
140
|
};
|
141
|
+
/**
|
142
|
+
* @param {number} index index
|
143
|
+
*/
|
137
144
|
const defineIndexGetter = index => {
|
138
145
|
Object.defineProperty(set, index, {
|
139
146
|
get: createIndexGetter(index),
|
@@ -94,7 +94,8 @@ const subtractSizeFrom = (total, size) => {
|
|
94
94
|
};
|
95
95
|
|
96
96
|
/**
|
97
|
-
* @
|
97
|
+
* @template T
|
98
|
+
* @param {Iterable<Node<T>>} nodes some nodes
|
98
99
|
* @returns {Record<string, number>} total size
|
99
100
|
*/
|
100
101
|
const sumSize = nodes => {
|
@@ -105,6 +106,11 @@ const sumSize = nodes => {
|
|
105
106
|
return sum;
|
106
107
|
};
|
107
108
|
|
109
|
+
/**
|
110
|
+
* @param {Record<string, number>} size size
|
111
|
+
* @param {Record<string, number>} maxSize minimum size
|
112
|
+
* @returns {boolean} true, when size is too big
|
113
|
+
*/
|
108
114
|
const isTooBig = (size, maxSize) => {
|
109
115
|
for (const key of Object.keys(size)) {
|
110
116
|
const s = size[key];
|
@@ -117,6 +123,11 @@ const isTooBig = (size, maxSize) => {
|
|
117
123
|
return false;
|
118
124
|
};
|
119
125
|
|
126
|
+
/**
|
127
|
+
* @param {Record<string, number>} size size
|
128
|
+
* @param {Record<string, number>} minSize minimum size
|
129
|
+
* @returns {boolean} true, when size is too small
|
130
|
+
*/
|
120
131
|
const isTooSmall = (size, minSize) => {
|
121
132
|
for (const key of Object.keys(size)) {
|
122
133
|
const s = size[key];
|
@@ -129,6 +140,11 @@ const isTooSmall = (size, minSize) => {
|
|
129
140
|
return false;
|
130
141
|
};
|
131
142
|
|
143
|
+
/**
|
144
|
+
* @param {Record<string, number>} size size
|
145
|
+
* @param {Record<string, number>} minSize minimum size
|
146
|
+
* @returns {Set<string>} set of types that are too small
|
147
|
+
*/
|
132
148
|
const getTooSmallTypes = (size, minSize) => {
|
133
149
|
const types = new Set();
|
134
150
|
for (const key of Object.keys(size)) {
|
@@ -142,6 +158,12 @@ const getTooSmallTypes = (size, minSize) => {
|
|
142
158
|
return types;
|
143
159
|
};
|
144
160
|
|
161
|
+
/**
|
162
|
+
* @template T
|
163
|
+
* @param {TODO} size size
|
164
|
+
* @param {Set<string>} types types
|
165
|
+
* @returns {number} number of matching size types
|
166
|
+
*/
|
145
167
|
const getNumberOfMatchingSizeTypes = (size, types) => {
|
146
168
|
let i = 0;
|
147
169
|
for (const key of Object.keys(size)) {
|
@@ -150,6 +172,11 @@ const getNumberOfMatchingSizeTypes = (size, types) => {
|
|
150
172
|
return i;
|
151
173
|
};
|
152
174
|
|
175
|
+
/**
|
176
|
+
* @param {Record<string, number>} size size
|
177
|
+
* @param {Set<string>} types types
|
178
|
+
* @returns {number} selective size sum
|
179
|
+
*/
|
153
180
|
const selectiveSizeSum = (size, types) => {
|
154
181
|
let sum = 0;
|
155
182
|
for (const key of Object.keys(size)) {
|
@@ -180,20 +207,20 @@ class Node {
|
|
180
207
|
class Group {
|
181
208
|
/**
|
182
209
|
* @param {Node<T>[]} nodes nodes
|
183
|
-
* @param {number[]} similarities similarities between the nodes (length = nodes.length - 1)
|
210
|
+
* @param {number[] | null} similarities similarities between the nodes (length = nodes.length - 1)
|
184
211
|
* @param {Record<string, number>=} size size of the group
|
185
212
|
*/
|
186
213
|
constructor(nodes, similarities, size) {
|
187
214
|
this.nodes = nodes;
|
188
215
|
this.similarities = similarities;
|
189
216
|
this.size = size || sumSize(nodes);
|
190
|
-
/** @type {string} */
|
217
|
+
/** @type {string | undefined} */
|
191
218
|
this.key = undefined;
|
192
219
|
}
|
193
220
|
|
194
221
|
/**
|
195
|
-
* @param {function(Node): boolean} filter filter function
|
196
|
-
* @returns {Node[]} removed nodes
|
222
|
+
* @param {function(Node<T>): boolean} filter filter function
|
223
|
+
* @returns {Node<T>[] | undefined} removed nodes
|
197
224
|
*/
|
198
225
|
popNodes(filter) {
|
199
226
|
const newNodes = [];
|
@@ -208,7 +235,7 @@ class Group {
|
|
208
235
|
if (newNodes.length > 0) {
|
209
236
|
newSimilarities.push(
|
210
237
|
lastNode === this.nodes[i - 1]
|
211
|
-
? this.similarities[i - 1]
|
238
|
+
? /** @type {number[]} */ (this.similarities)[i - 1]
|
212
239
|
: similarity(lastNode.key, node.key)
|
213
240
|
);
|
214
241
|
}
|
@@ -225,7 +252,8 @@ class Group {
|
|
225
252
|
}
|
226
253
|
|
227
254
|
/**
|
228
|
-
* @
|
255
|
+
* @template T
|
256
|
+
* @param {Iterable<Node<T>>} nodes nodes
|
229
257
|
* @returns {number[]} similarities
|
230
258
|
*/
|
231
259
|
const getSimilarities = nodes => {
|
@@ -297,6 +325,11 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
|
|
297
325
|
if (initialNodes.length > 0) {
|
298
326
|
const initialGroup = new Group(initialNodes, getSimilarities(initialNodes));
|
299
327
|
|
328
|
+
/**
|
329
|
+
* @param {Group<T>} group group
|
330
|
+
* @param {Record<string, number>} consideredSize size of the group to consider
|
331
|
+
* @returns {boolean} true, if the group was modified
|
332
|
+
*/
|
300
333
|
const removeProblematicNodes = (group, consideredSize = group.size) => {
|
301
334
|
const problemTypes = getTooSmallTypes(consideredSize, minSize);
|
302
335
|
if (problemTypes.size > 0) {
|
@@ -347,7 +380,7 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
|
|
347
380
|
const queue = [initialGroup];
|
348
381
|
|
349
382
|
while (queue.length) {
|
350
|
-
const group = queue.pop();
|
383
|
+
const group = /** @type {Group<T>} */ (queue.pop());
|
351
384
|
// only groups bigger than maxSize need to be splitted
|
352
385
|
if (!isTooBig(group.size, maxSize)) {
|
353
386
|
result.push(group);
|
@@ -428,7 +461,9 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
|
|
428
461
|
// rightSize ^^^^^^^^^^^^^^^
|
429
462
|
|
430
463
|
while (pos <= right + 1) {
|
431
|
-
const similarity = group.similarities[
|
464
|
+
const similarity = /** @type {number[]} */ (group.similarities)[
|
465
|
+
pos - 1
|
466
|
+
];
|
432
467
|
if (
|
433
468
|
similarity < bestSimilarity &&
|
434
469
|
!isTooSmall(leftSize, minSize) &&
|
@@ -458,7 +493,9 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
|
|
458
493
|
/** @type {number[]} */
|
459
494
|
const rightSimilarities = [];
|
460
495
|
for (let i = right + 2; i < group.nodes.length; i++) {
|
461
|
-
rightSimilarities.push(
|
496
|
+
rightSimilarities.push(
|
497
|
+
/** @type {number[]} */ (group.similarities)[i - 1]
|
498
|
+
);
|
462
499
|
rightNodes.push(group.nodes[i]);
|
463
500
|
}
|
464
501
|
queue.push(new Group(rightNodes, rightSimilarities));
|
@@ -467,7 +504,9 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
|
|
467
504
|
/** @type {number[]} */
|
468
505
|
const leftSimilarities = [];
|
469
506
|
for (let i = 1; i < left; i++) {
|
470
|
-
leftSimilarities.push(
|
507
|
+
leftSimilarities.push(
|
508
|
+
/** @type {number[]} */ (group.similarities)[i - 1]
|
509
|
+
);
|
471
510
|
leftNodes.push(group.nodes[i]);
|
472
511
|
}
|
473
512
|
queue.push(new Group(leftNodes, leftSimilarities));
|
@@ -109,7 +109,9 @@ module.exports = (items, getDependencies) => {
|
|
109
109
|
// Are there still edges unprocessed in the current node?
|
110
110
|
if (topOfStack.openEdges.length > 0) {
|
111
111
|
// Process one dependency
|
112
|
-
const dependency =
|
112
|
+
const dependency =
|
113
|
+
/** @type {Node<T>} */
|
114
|
+
(topOfStack.openEdges.pop());
|
113
115
|
switch (dependency.marker) {
|
114
116
|
case NO_MARKER:
|
115
117
|
// dependency has not be visited yet
|
@@ -169,7 +171,7 @@ module.exports = (items, getDependencies) => {
|
|
169
171
|
// so it's not really a root cycle
|
170
172
|
// remove the cycle from the root cycles
|
171
173
|
// and convert it to a normal node
|
172
|
-
rootCycles.delete(dependency.cycle);
|
174
|
+
rootCycles.delete(/** @type {Cycle<T>} */ (dependency.cycle));
|
173
175
|
dependency.marker = DONE_MARKER;
|
174
176
|
break;
|
175
177
|
// DONE_MARKER: nothing to do, don't recurse into dependencies
|
package/lib/util/memoize.js
CHANGED
@@ -13,18 +13,18 @@
|
|
13
13
|
*/
|
14
14
|
const memoize = fn => {
|
15
15
|
let cache = false;
|
16
|
-
/** @type {T} */
|
16
|
+
/** @type {T | undefined} */
|
17
17
|
let result = undefined;
|
18
18
|
return () => {
|
19
19
|
if (cache) {
|
20
|
-
return result;
|
20
|
+
return /** @type {T} */ (result);
|
21
21
|
} else {
|
22
22
|
result = fn();
|
23
23
|
cache = true;
|
24
24
|
// Allow to clean up memory for fn
|
25
25
|
// and all dependent resources
|
26
26
|
fn = undefined;
|
27
|
-
return result;
|
27
|
+
return /** @type {T} */ (result);
|
28
28
|
}
|
29
29
|
};
|
30
30
|
};
|
@@ -21,6 +21,9 @@ const processAsyncTree = (items, concurrency, processor, callback) => {
|
|
21
21
|
let finished = false;
|
22
22
|
let processScheduled = true;
|
23
23
|
|
24
|
+
/**
|
25
|
+
* @param {T} item item
|
26
|
+
*/
|
24
27
|
const push = item => {
|
25
28
|
queue.push(item);
|
26
29
|
if (!processScheduled && processing < concurrency) {
|
@@ -29,6 +32,9 @@ const processAsyncTree = (items, concurrency, processor, callback) => {
|
|
29
32
|
}
|
30
33
|
};
|
31
34
|
|
35
|
+
/**
|
36
|
+
* @param {E | null | undefined} err error
|
37
|
+
*/
|
32
38
|
const processorCallback = err => {
|
33
39
|
processing--;
|
34
40
|
if (err && !finished) {
|
@@ -46,7 +52,7 @@ const processAsyncTree = (items, concurrency, processor, callback) => {
|
|
46
52
|
if (finished) return;
|
47
53
|
while (processing < concurrency && queue.length > 0) {
|
48
54
|
processing++;
|
49
|
-
const item = queue.pop();
|
55
|
+
const item = /** @type {T} */ (queue.pop());
|
50
56
|
processor(item, push, processorCallback);
|
51
57
|
}
|
52
58
|
processScheduled = false;
|
@@ -26,7 +26,7 @@ const {
|
|
26
26
|
/** @typedef {import("./serialization").ObjectDeserializerContext} ObjectDeserializerContext */
|
27
27
|
/** @typedef {import("./serialization").ObjectSerializerContext} ObjectSerializerContext */
|
28
28
|
|
29
|
-
/** @typedef {ObjectSerializerContext & { writeLazy?: (any) => void }} WebpackObjectSerializerContext */
|
29
|
+
/** @typedef {ObjectSerializerContext & { writeLazy?: (value: any) => void }} WebpackObjectSerializerContext */
|
30
30
|
|
31
31
|
const CURRENT_MODULE = "webpack/lib/util/registerExternalSerializer";
|
32
32
|
|
package/lib/util/runtime.js
CHANGED
@@ -53,7 +53,7 @@ exports.getEntryRuntime = (compilation, name, options) => {
|
|
53
53
|
|
54
54
|
/**
|
55
55
|
* @param {RuntimeSpec} runtime runtime
|
56
|
-
* @param {function(string): void} fn functor
|
56
|
+
* @param {function(string | undefined): void} fn functor
|
57
57
|
* @param {boolean} deterministicOrder enforce a deterministic order
|
58
58
|
* @returns {void}
|
59
59
|
*/
|
@@ -70,6 +70,11 @@ exports.forEachRuntime = (runtime, fn, deterministicOrder = false) => {
|
|
70
70
|
}
|
71
71
|
};
|
72
72
|
|
73
|
+
/**
|
74
|
+
* @template T
|
75
|
+
* @param {SortableSet<T>} set set
|
76
|
+
* @returns {string} runtime key
|
77
|
+
*/
|
73
78
|
const getRuntimesKey = set => {
|
74
79
|
set.sort();
|
75
80
|
return Array.from(set).join("\n");
|
@@ -98,6 +103,11 @@ const keyToRuntime = key => {
|
|
98
103
|
};
|
99
104
|
exports.keyToRuntime = keyToRuntime;
|
100
105
|
|
106
|
+
/**
|
107
|
+
* @template T
|
108
|
+
* @param {SortableSet<T>} set set
|
109
|
+
* @returns {string} runtime string
|
110
|
+
*/
|
101
111
|
const getRuntimesString = set => {
|
102
112
|
set.sort();
|
103
113
|
return Array.from(set).join("+");
|
@@ -415,6 +425,11 @@ exports.filterRuntime = (runtime, filter) => {
|
|
415
425
|
return result;
|
416
426
|
};
|
417
427
|
|
428
|
+
/**
|
429
|
+
* @template T
|
430
|
+
* @typedef {Map<string, T>} RuntimeSpecMapInnerMap
|
431
|
+
* */
|
432
|
+
|
418
433
|
/**
|
419
434
|
* @template T
|
420
435
|
*/
|
@@ -426,15 +441,15 @@ class RuntimeSpecMap {
|
|
426
441
|
this._mode = clone ? clone._mode : 0; // 0 = empty, 1 = single entry, 2 = map
|
427
442
|
/** @type {RuntimeSpec} */
|
428
443
|
this._singleRuntime = clone ? clone._singleRuntime : undefined;
|
429
|
-
/** @type {T} */
|
444
|
+
/** @type {T | undefined} */
|
430
445
|
this._singleValue = clone ? clone._singleValue : undefined;
|
431
|
-
/** @type {
|
446
|
+
/** @type {RuntimeSpecMapInnerMap<T> | undefined} */
|
432
447
|
this._map = clone && clone._map ? new Map(clone._map) : undefined;
|
433
448
|
}
|
434
449
|
|
435
450
|
/**
|
436
451
|
* @param {RuntimeSpec} runtime the runtimes
|
437
|
-
* @returns {T} value
|
452
|
+
* @returns {T | undefined} value
|
438
453
|
*/
|
439
454
|
get(runtime) {
|
440
455
|
switch (this._mode) {
|
@@ -445,7 +460,9 @@ class RuntimeSpecMap {
|
|
445
460
|
? this._singleValue
|
446
461
|
: undefined;
|
447
462
|
default:
|
448
|
-
return this._map.get(
|
463
|
+
return /** @type {RuntimeSpecMapInnerMap<T>} */ (this._map).get(
|
464
|
+
getRuntimeKey(runtime)
|
465
|
+
);
|
449
466
|
}
|
450
467
|
}
|
451
468
|
|
@@ -460,10 +477,16 @@ class RuntimeSpecMap {
|
|
460
477
|
case 1:
|
461
478
|
return runtimeEqual(this._singleRuntime, runtime);
|
462
479
|
default:
|
463
|
-
return this._map.has(
|
480
|
+
return /** @type {RuntimeSpecMapInnerMap<T>} */ (this._map).has(
|
481
|
+
getRuntimeKey(runtime)
|
482
|
+
);
|
464
483
|
}
|
465
484
|
}
|
466
485
|
|
486
|
+
/**
|
487
|
+
* @param {RuntimeSpec} runtime the runtimes
|
488
|
+
* @param {T} value the value
|
489
|
+
*/
|
467
490
|
set(runtime, value) {
|
468
491
|
switch (this._mode) {
|
469
492
|
case 0:
|
@@ -478,15 +501,24 @@ class RuntimeSpecMap {
|
|
478
501
|
}
|
479
502
|
this._mode = 2;
|
480
503
|
this._map = new Map();
|
481
|
-
this._map.set(
|
504
|
+
this._map.set(
|
505
|
+
getRuntimeKey(this._singleRuntime),
|
506
|
+
/** @type {T} */ (this._singleValue)
|
507
|
+
);
|
482
508
|
this._singleRuntime = undefined;
|
483
509
|
this._singleValue = undefined;
|
484
510
|
/* falls through */
|
485
511
|
default:
|
486
|
-
|
512
|
+
/** @type {RuntimeSpecMapInnerMap<T>} */
|
513
|
+
(this._map).set(getRuntimeKey(runtime), value);
|
487
514
|
}
|
488
515
|
}
|
489
516
|
|
517
|
+
/**
|
518
|
+
* @param {RuntimeSpec} runtime the runtimes
|
519
|
+
* @param {() => TODO} computer function to compute the value
|
520
|
+
* @returns {TODO} true, when the runtime was deleted
|
521
|
+
*/
|
490
522
|
provide(runtime, computer) {
|
491
523
|
switch (this._mode) {
|
492
524
|
case 0:
|
@@ -495,11 +527,14 @@ class RuntimeSpecMap {
|
|
495
527
|
return (this._singleValue = computer());
|
496
528
|
case 1: {
|
497
529
|
if (runtimeEqual(this._singleRuntime, runtime)) {
|
498
|
-
return this._singleValue;
|
530
|
+
return /** @type {T} */ (this._singleValue);
|
499
531
|
}
|
500
532
|
this._mode = 2;
|
501
533
|
this._map = new Map();
|
502
|
-
this._map.set(
|
534
|
+
this._map.set(
|
535
|
+
getRuntimeKey(this._singleRuntime),
|
536
|
+
/** @type {T} */ (this._singleValue)
|
537
|
+
);
|
503
538
|
this._singleRuntime = undefined;
|
504
539
|
this._singleValue = undefined;
|
505
540
|
const newValue = computer();
|
@@ -508,15 +543,19 @@ class RuntimeSpecMap {
|
|
508
543
|
}
|
509
544
|
default: {
|
510
545
|
const key = getRuntimeKey(runtime);
|
511
|
-
const value = this._map.get(key);
|
546
|
+
const value = /** @type {Map<string, T>} */ (this._map).get(key);
|
512
547
|
if (value !== undefined) return value;
|
513
548
|
const newValue = computer();
|
514
|
-
|
549
|
+
/** @type {Map<string, T>} */
|
550
|
+
(this._map).set(key, newValue);
|
515
551
|
return newValue;
|
516
552
|
}
|
517
553
|
}
|
518
554
|
}
|
519
555
|
|
556
|
+
/**
|
557
|
+
* @param {RuntimeSpec} runtime the runtimes
|
558
|
+
*/
|
520
559
|
delete(runtime) {
|
521
560
|
switch (this._mode) {
|
522
561
|
case 0:
|
@@ -529,10 +568,15 @@ class RuntimeSpecMap {
|
|
529
568
|
}
|
530
569
|
return;
|
531
570
|
default:
|
532
|
-
|
571
|
+
/** @type {RuntimeSpecMapInnerMap<T>} */
|
572
|
+
(this._map).delete(getRuntimeKey(runtime));
|
533
573
|
}
|
534
574
|
}
|
535
575
|
|
576
|
+
/**
|
577
|
+
* @param {RuntimeSpec} runtime the runtimes
|
578
|
+
* @param {function(T | undefined): T} fn function to update the value
|
579
|
+
*/
|
536
580
|
update(runtime, fn) {
|
537
581
|
switch (this._mode) {
|
538
582
|
case 0:
|
@@ -546,7 +590,10 @@ class RuntimeSpecMap {
|
|
546
590
|
if (newValue !== undefined) {
|
547
591
|
this._mode = 2;
|
548
592
|
this._map = new Map();
|
549
|
-
this._map.set(
|
593
|
+
this._map.set(
|
594
|
+
getRuntimeKey(this._singleRuntime),
|
595
|
+
/** @type {T} */ (this._singleValue)
|
596
|
+
);
|
550
597
|
this._singleRuntime = undefined;
|
551
598
|
this._singleValue = undefined;
|
552
599
|
this._map.set(getRuntimeKey(runtime), newValue);
|
@@ -555,9 +602,11 @@ class RuntimeSpecMap {
|
|
555
602
|
}
|
556
603
|
default: {
|
557
604
|
const key = getRuntimeKey(runtime);
|
558
|
-
const oldValue = this._map.get(key);
|
605
|
+
const oldValue = /** @type {Map<string, T>} */ (this._map).get(key);
|
559
606
|
const newValue = fn(oldValue);
|
560
|
-
if (newValue !== oldValue)
|
607
|
+
if (newValue !== oldValue)
|
608
|
+
/** @type {RuntimeSpecMapInnerMap<T>} */
|
609
|
+
(this._map).set(key, newValue);
|
561
610
|
}
|
562
611
|
}
|
563
612
|
}
|
@@ -569,7 +618,11 @@ class RuntimeSpecMap {
|
|
569
618
|
case 1:
|
570
619
|
return [this._singleRuntime];
|
571
620
|
default:
|
572
|
-
return Array.from(
|
621
|
+
return Array.from(
|
622
|
+
/** @type {RuntimeSpecMapInnerMap<T>} */
|
623
|
+
(this._map).keys(),
|
624
|
+
keyToRuntime
|
625
|
+
);
|
573
626
|
}
|
574
627
|
}
|
575
628
|
|
@@ -578,21 +631,24 @@ class RuntimeSpecMap {
|
|
578
631
|
case 0:
|
579
632
|
return [][Symbol.iterator]();
|
580
633
|
case 1:
|
581
|
-
return [this._singleValue][Symbol.iterator]();
|
634
|
+
return [/** @type {T} */ (this._singleValue)][Symbol.iterator]();
|
582
635
|
default:
|
583
|
-
return this._map.values();
|
636
|
+
return /** @type {Map<string, T>} */ (this._map).values();
|
584
637
|
}
|
585
638
|
}
|
586
639
|
|
587
640
|
get size() {
|
588
|
-
if (this._mode <= 1) return this._mode;
|
589
|
-
return this._map.size;
|
641
|
+
if (/** @type {number} */ (this._mode) <= 1) return this._mode;
|
642
|
+
return /** @type {Map<string, T>} */ (this._map).size;
|
590
643
|
}
|
591
644
|
}
|
592
645
|
|
593
646
|
exports.RuntimeSpecMap = RuntimeSpecMap;
|
594
647
|
|
595
648
|
class RuntimeSpecSet {
|
649
|
+
/**
|
650
|
+
* @param {Iterable<RuntimeSpec>=} iterable iterable
|
651
|
+
*/
|
596
652
|
constructor(iterable) {
|
597
653
|
/** @type {Map<string, RuntimeSpec>} */
|
598
654
|
this._map = new Map();
|
@@ -603,10 +659,17 @@ class RuntimeSpecSet {
|
|
603
659
|
}
|
604
660
|
}
|
605
661
|
|
662
|
+
/**
|
663
|
+
* @param {RuntimeSpec} runtime runtime
|
664
|
+
*/
|
606
665
|
add(runtime) {
|
607
666
|
this._map.set(getRuntimeKey(runtime), runtime);
|
608
667
|
}
|
609
668
|
|
669
|
+
/**
|
670
|
+
* @param {RuntimeSpec} runtime runtime
|
671
|
+
* @returns {boolean} true, when the runtime exists
|
672
|
+
*/
|
610
673
|
has(runtime) {
|
611
674
|
return this._map.has(getRuntimeKey(runtime));
|
612
675
|
}
|
package/lib/util/semver.js
CHANGED
@@ -110,7 +110,7 @@ const smartGrouping = (items, groupConfigs) => {
|
|
110
110
|
/** @type {(T | R)[]} */
|
111
111
|
const results = [];
|
112
112
|
for (;;) {
|
113
|
-
/** @type {Group<T, R>} */
|
113
|
+
/** @type {Group<T, R> | undefined} */
|
114
114
|
let bestGroup = undefined;
|
115
115
|
let bestGroupSize = -1;
|
116
116
|
let bestGroupItems = undefined;
|
package/lib/validateSchema.js
CHANGED
@@ -119,7 +119,9 @@ const validateSchema = (schema, options, validationConfiguration) => {
|
|
119
119
|
)
|
120
120
|
) {
|
121
121
|
return `${formattedError}\nDid you mean ${
|
122
|
-
DID_YOU_MEAN[
|
122
|
+
DID_YOU_MEAN[
|
123
|
+
/** @type {keyof DID_YOU_MEAN} */ (params.additionalProperty)
|
124
|
+
]
|
123
125
|
}?`;
|
124
126
|
}
|
125
127
|
|
@@ -129,7 +131,9 @@ const validateSchema = (schema, options, validationConfiguration) => {
|
|
129
131
|
params.additionalProperty
|
130
132
|
)
|
131
133
|
) {
|
132
|
-
return `${formattedError}\n${
|
134
|
+
return `${formattedError}\n${
|
135
|
+
REMOVED[/** @type {keyof REMOVED} */ (params.additionalProperty)]
|
136
|
+
}?`;
|
133
137
|
}
|
134
138
|
|
135
139
|
if (!error.dataPath) {
|