webpack 5.98.0 → 5.99.0
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.
- package/README.md +7 -3
- package/lib/AsyncDependenciesBlock.js +3 -1
- package/lib/BannerPlugin.js +1 -1
- package/lib/Cache.js +9 -7
- package/lib/CacheFacade.js +5 -5
- package/lib/Chunk.js +2 -2
- package/lib/ChunkGraph.js +21 -16
- package/lib/ChunkTemplate.js +6 -6
- package/lib/CleanPlugin.js +10 -10
- package/lib/CodeGenerationResults.js +4 -3
- package/lib/CompatibilityPlugin.js +4 -1
- package/lib/Compilation.js +326 -152
- package/lib/Compiler.js +13 -18
- package/lib/ConditionalInitFragment.js +1 -1
- package/lib/ConstPlugin.js +5 -3
- package/lib/ContextModule.js +4 -2
- package/lib/ContextModuleFactory.js +3 -3
- package/lib/ContextReplacementPlugin.js +43 -16
- package/lib/DefinePlugin.js +25 -24
- package/lib/DelegatedModule.js +4 -2
- package/lib/DelegatedModuleFactoryPlugin.js +2 -1
- package/lib/Dependency.js +19 -13
- package/lib/DependencyTemplates.js +4 -3
- package/lib/DllModule.js +4 -2
- package/lib/DllModuleFactory.js +2 -2
- package/lib/DllReferencePlugin.js +2 -1
- package/lib/DynamicEntryPlugin.js +1 -1
- package/lib/EnvironmentPlugin.js +4 -2
- package/lib/ExportsInfo.js +72 -40
- package/lib/ExternalModule.js +14 -5
- package/lib/ExternalModuleFactoryPlugin.js +24 -12
- package/lib/FileSystemInfo.js +129 -94
- package/lib/FlagDependencyExportsPlugin.js +6 -4
- package/lib/FlagDependencyUsagePlugin.js +1 -1
- package/lib/Generator.js +29 -1
- package/lib/HookWebpackError.js +2 -2
- package/lib/HotModuleReplacementPlugin.js +3 -9
- package/lib/IgnoreErrorModuleFactory.js +2 -2
- package/lib/IgnorePlugin.js +0 -5
- package/lib/InitFragment.js +1 -1
- package/lib/LoaderOptionsPlugin.js +8 -5
- package/lib/MainTemplate.js +7 -7
- package/lib/Module.js +40 -17
- package/lib/ModuleBuildError.js +3 -1
- package/lib/ModuleDependencyError.js +4 -3
- package/lib/ModuleDependencyWarning.js +4 -3
- package/lib/ModuleFactory.js +9 -3
- package/lib/ModuleFilenameHelpers.js +13 -13
- package/lib/ModuleGraph.js +20 -14
- package/lib/ModuleGraphConnection.js +7 -13
- package/lib/ModuleNotFoundError.js +1 -1
- package/lib/ModuleParseError.js +2 -1
- package/lib/ModuleSourceTypesConstants.js +11 -0
- package/lib/ModuleTemplate.js +5 -5
- package/lib/ModuleTypeConstants.js +15 -0
- package/lib/MultiCompiler.js +4 -4
- package/lib/MultiStats.js +1 -1
- package/lib/NormalModule.js +101 -54
- package/lib/NormalModuleFactory.js +38 -33
- package/lib/NormalModuleReplacementPlugin.js +3 -2
- package/lib/NullFactory.js +2 -2
- package/lib/Parser.js +4 -3
- package/lib/ProgressPlugin.js +1 -2
- package/lib/RawModule.js +4 -2
- package/lib/RecordIdsPlugin.js +6 -2
- package/lib/RequestShortener.js +3 -1
- package/lib/ResolverFactory.js +12 -9
- package/lib/RuntimeModule.js +4 -2
- package/lib/RuntimeTemplate.js +2 -1
- package/lib/SelfModuleFactory.js +2 -2
- package/lib/SourceMapDevToolPlugin.js +0 -8
- package/lib/Template.js +6 -5
- package/lib/TemplatedPathPlugin.js +15 -12
- package/lib/WebpackOptionsApply.js +1 -1
- package/lib/asset/AssetGenerator.js +237 -170
- package/lib/asset/AssetModulesPlugin.js +50 -8
- package/lib/asset/AssetSourceGenerator.js +18 -0
- package/lib/asset/RawDataUrlModule.js +4 -2
- package/lib/buildChunkGraph.js +14 -4
- package/lib/cache/MemoryWithGcCachePlugin.js +6 -2
- package/lib/cache/PackFileCacheStrategy.js +137 -121
- package/lib/cache/ResolverCachePlugin.js +15 -7
- package/lib/cache/getLazyHashedEtag.js +4 -3
- package/lib/cli.js +23 -15
- package/lib/config/defaults.js +93 -26
- package/lib/config/normalization.js +14 -13
- package/lib/config/target.js +8 -8
- package/lib/container/ContainerEntryModule.js +4 -2
- package/lib/container/ContainerEntryModuleFactory.js +2 -2
- package/lib/container/FallbackModule.js +4 -2
- package/lib/container/FallbackModuleFactory.js +2 -2
- package/lib/container/RemoteModule.js +4 -2
- package/lib/container/options.js +5 -5
- package/lib/css/CssGenerator.js +71 -9
- package/lib/css/CssModulesPlugin.js +30 -5
- package/lib/css/CssParser.js +37 -17
- package/lib/css/walkCssTokens.js +17 -17
- package/lib/debug/ProfilingPlugin.js +98 -38
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +10 -4
- package/lib/dependencies/AMDPlugin.js +5 -2
- package/lib/dependencies/AMDRequireArrayDependency.js +4 -3
- package/lib/dependencies/AMDRequireContextDependency.js +2 -1
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +15 -7
- package/lib/dependencies/AMDRuntimeModules.js +3 -1
- package/lib/dependencies/CommonJsExportRequireDependency.js +4 -5
- package/lib/dependencies/CommonJsExportsParserPlugin.js +3 -3
- package/lib/dependencies/CommonJsImportsParserPlugin.js +8 -7
- package/lib/dependencies/CommonJsRequireContextDependency.js +2 -1
- package/lib/dependencies/ContextDependencyHelpers.js +13 -6
- package/lib/dependencies/CssIcssExportDependency.js +15 -12
- package/lib/dependencies/CssIcssImportDependency.js +4 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +17 -14
- package/lib/dependencies/ExportsInfoDependency.js +6 -1
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +5 -5
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +22 -15
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +23 -8
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +2 -2
- package/lib/dependencies/HarmonyImportDependency.js +8 -6
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +19 -14
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +5 -5
- package/lib/dependencies/ImportContextDependency.js +2 -1
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +8 -4
- package/lib/dependencies/JsonExportsDependency.js +24 -8
- package/lib/dependencies/LoaderPlugin.js +4 -14
- package/lib/dependencies/RequireContextDependency.js +2 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +6 -3
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +3 -2
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +11 -5
- package/lib/dependencies/RequireResolveContextDependency.js +1 -1
- package/lib/dependencies/WebAssemblyExportImportedDependency.js +1 -1
- package/lib/dependencies/WorkerDependency.js +6 -3
- package/lib/dependencies/WorkerPlugin.js +100 -41
- package/lib/esm/ModuleChunkFormatPlugin.js +5 -0
- package/lib/hmr/HotModuleReplacement.runtime.js +1 -0
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +1 -0
- package/lib/hmr/LazyCompilationPlugin.js +32 -24
- package/lib/hmr/lazyCompilationBackend.js +1 -1
- package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
- package/lib/ids/HashedModuleIdsPlugin.js +2 -1
- package/lib/ids/IdHelpers.js +15 -14
- package/lib/ids/SyncModuleIdsPlugin.js +9 -5
- package/lib/index.js +5 -5
- package/lib/javascript/BasicEvaluatedExpression.js +6 -6
- package/lib/javascript/JavascriptGenerator.js +11 -1
- package/lib/javascript/JavascriptModulesPlugin.js +51 -31
- package/lib/javascript/JavascriptParser.js +272 -188
- package/lib/javascript/JavascriptParserHelpers.js +10 -9
- package/lib/javascript/StartupHelpers.js +4 -1
- package/lib/json/JsonData.js +4 -4
- package/lib/json/JsonGenerator.js +54 -22
- package/lib/json/JsonModulesPlugin.js +16 -2
- package/lib/json/JsonParser.js +8 -4
- package/lib/library/AbstractLibraryPlugin.js +7 -3
- package/lib/library/AssignLibraryPlugin.js +29 -1
- package/lib/library/EnableLibraryPlugin.js +7 -10
- package/lib/library/ExportPropertyLibraryPlugin.js +4 -1
- package/lib/library/ModuleLibraryPlugin.js +121 -15
- package/lib/logging/Logger.js +2 -2
- package/lib/logging/createConsoleLogger.js +4 -4
- package/lib/node/NodeEnvironmentPlugin.js +6 -2
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -2
- package/lib/node/ReadFileCompileWasmPlugin.js +1 -2
- package/lib/node/nodeConsole.js +3 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +1 -1
- package/lib/optimize/ConcatenatedModule.js +19 -12
- package/lib/optimize/InnerGraph.js +3 -2
- package/lib/optimize/InnerGraphPlugin.js +13 -7
- package/lib/optimize/LimitChunkCountPlugin.js +20 -0
- package/lib/optimize/ModuleConcatenationPlugin.js +10 -7
- package/lib/optimize/RealContentHashPlugin.js +8 -4
- package/lib/optimize/SideEffectsFlagPlugin.js +4 -2
- package/lib/optimize/SplitChunksPlugin.js +87 -65
- package/lib/rules/BasicEffectRulePlugin.js +9 -1
- package/lib/rules/BasicMatcherRulePlugin.js +15 -4
- package/lib/rules/ObjectMatcherRulePlugin.js +12 -3
- package/lib/rules/RuleSetCompiler.js +25 -14
- package/lib/rules/UseEffectRulePlugin.js +47 -17
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -6
- package/lib/schemes/HttpUriPlugin.js +38 -17
- package/lib/serialization/BinaryMiddleware.js +52 -19
- package/lib/serialization/FileMiddleware.js +78 -48
- package/lib/serialization/ObjectMiddleware.js +78 -29
- package/lib/serialization/PlainObjectSerializer.js +1 -1
- package/lib/serialization/Serializer.js +15 -10
- package/lib/serialization/SerializerMiddleware.js +80 -41
- package/lib/serialization/SingleItemMiddleware.js +10 -7
- package/lib/serialization/types.js +1 -1
- package/lib/sharing/ConsumeSharedModule.js +4 -2
- package/lib/sharing/ProvideSharedModule.js +4 -2
- package/lib/sharing/ProvideSharedModuleFactory.js +5 -3
- package/lib/sharing/utils.js +2 -2
- package/lib/stats/DefaultStatsFactoryPlugin.js +80 -78
- package/lib/stats/DefaultStatsPresetPlugin.js +43 -23
- package/lib/stats/DefaultStatsPrinterPlugin.js +85 -43
- package/lib/stats/StatsFactory.js +11 -11
- package/lib/stats/StatsPrinter.js +7 -7
- package/lib/util/ArrayHelpers.js +2 -4
- package/lib/util/ArrayQueue.js +1 -1
- package/lib/util/AsyncQueue.js +4 -4
- package/lib/util/IterableHelpers.js +1 -1
- package/lib/util/LazyBucketSortedSet.js +41 -23
- package/lib/util/LazySet.js +3 -2
- package/lib/util/MapHelpers.js +1 -1
- package/lib/util/ParallelismFactorCalculator.js +1 -1
- package/lib/util/Semaphore.js +3 -3
- package/lib/util/SetHelpers.js +1 -1
- package/lib/util/SortableSet.js +9 -7
- package/lib/util/TupleQueue.js +9 -8
- package/lib/util/TupleSet.js +2 -2
- package/lib/util/WeakTupleMap.js +12 -11
- package/lib/util/binarySearchBounds.js +2 -1
- package/lib/util/cleverMerge.js +84 -54
- package/lib/util/comparators.js +22 -21
- package/lib/util/compileBooleanMatcher.js +3 -3
- package/lib/util/concatenate.js +6 -4
- package/lib/util/create-schema-validation.js +4 -4
- package/lib/util/createHash.js +2 -2
- package/lib/util/deprecation.js +35 -33
- package/lib/util/deterministicGrouping.js +6 -6
- package/lib/util/findGraphRoots.js +1 -1
- package/lib/util/fs.js +39 -39
- package/lib/util/hash/wasm-hash.js +2 -2
- package/lib/util/identifier.js +15 -18
- package/lib/util/makeSerializable.js +1 -1
- package/lib/util/memoize.js +4 -1
- package/lib/util/objectToMap.js +3 -2
- package/lib/util/processAsyncTree.js +2 -2
- package/lib/util/propertyName.js +0 -1
- package/lib/util/registerExternalSerializer.js +15 -18
- package/lib/util/removeBOM.js +25 -0
- package/lib/util/runtime.js +34 -27
- package/lib/util/serialization.js +5 -16
- package/lib/util/smartGrouping.js +3 -3
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +3 -3
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +11 -0
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +10 -0
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -0
- package/lib/wasm-sync/WebAssemblyGenerator.js +28 -12
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +10 -0
- package/lib/wasm-sync/WebAssemblyParser.js +9 -4
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -0
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +30 -25
- package/package.json +19 -17
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +48 -13
- package/schemas/plugins/JsonModulesPluginGenerator.check.d.ts +7 -0
- package/schemas/plugins/JsonModulesPluginGenerator.check.js +6 -0
- package/schemas/plugins/JsonModulesPluginGenerator.json +11 -0
- package/schemas/plugins/SourceMapDevToolPlugin.json +2 -2
- package/types.d.ts +918 -615
- package/lib/library/ModernModuleLibraryPlugin.js +0 -144
@@ -7,9 +7,15 @@
|
|
7
7
|
|
8
8
|
/** @typedef {import("../Compiler")} Compiler */
|
9
9
|
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsChunkGroup} KnownStatsChunkGroup */
|
10
|
+
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsError} KnownStatsError */
|
11
|
+
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsModuleIssuer} KnownStatsModuleIssuer */
|
12
|
+
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsModuleTraceDependency} KnownStatsModuleTraceDependency */
|
13
|
+
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsModuleTraceItem} KnownStatsModuleTraceItem */
|
14
|
+
/** @typedef {import("./DefaultStatsFactoryPlugin").KnownStatsProfile} KnownStatsProfile */
|
10
15
|
/** @typedef {import("./StatsPrinter")} StatsPrinter */
|
11
16
|
/** @typedef {import("./StatsPrinter").KnownStatsPrinterColorFn} KnownStatsPrinterColorFn */
|
12
|
-
/** @typedef {import("./StatsPrinter").
|
17
|
+
/** @typedef {import("./StatsPrinter").KnownStatsPrinterContext} KnownStatsPrinterContext */
|
18
|
+
/** @typedef {import("./StatsPrinter").KnownStatsPrinterFormatters} KnownStatsPrinterFormatters */
|
13
19
|
/** @typedef {import("./StatsPrinter").StatsPrinterContext} StatsPrinterContext */
|
14
20
|
|
15
21
|
const DATA_URI_CONTENT_LENGTH = 16;
|
@@ -59,7 +65,7 @@ const getResourceName = resource => {
|
|
59
65
|
*/
|
60
66
|
const getModuleName = name => {
|
61
67
|
const [, prefix, resource] =
|
62
|
-
/** @type {[
|
68
|
+
/** @type {[string, string, string]} */
|
63
69
|
(/** @type {unknown} */ (/^(.*!)?([^!]*)$/.exec(name)));
|
64
70
|
|
65
71
|
if (resource.length > MAX_MODULE_IDENTIFIER_LENGTH) {
|
@@ -79,7 +85,7 @@ const getModuleName = name => {
|
|
79
85
|
|
80
86
|
/**
|
81
87
|
* @param {string} str string
|
82
|
-
* @param {
|
88
|
+
* @param {(item: string) => string} fn function to apply to each line
|
83
89
|
* @returns {string} joined string
|
84
90
|
*/
|
85
91
|
const mapLines = (str, fn) => str.split("\n").map(fn).join("\n");
|
@@ -111,7 +117,42 @@ const moreCount = (list, count) =>
|
|
111
117
|
* @typedef {{ [P in K]-?: T[P] }} WithRequired
|
112
118
|
*/
|
113
119
|
|
114
|
-
/**
|
120
|
+
/**
|
121
|
+
* @template {keyof StatsPrinterContext} RequiredStatsPrinterContextKeys
|
122
|
+
* @typedef {Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | RequiredStatsPrinterContextKeys>} DefineStatsPrinterContext
|
123
|
+
*/
|
124
|
+
|
125
|
+
/**
|
126
|
+
* @template T
|
127
|
+
* @template {keyof StatsPrinterContext} RequiredStatsPrinterContextKeys
|
128
|
+
* @typedef {(thing: Exclude<T, undefined>, context: DefineStatsPrinterContext<RequiredStatsPrinterContextKeys>, printer: StatsPrinter) => string | undefined} ModuleSimplePrinter
|
129
|
+
*/
|
130
|
+
|
131
|
+
/**
|
132
|
+
* @template T
|
133
|
+
* @typedef {T extends (infer U)[] ? U : T} Unpacked
|
134
|
+
*/
|
135
|
+
|
136
|
+
/**
|
137
|
+
* @template {object} O
|
138
|
+
* @template {keyof O} P
|
139
|
+
* @template {string} B
|
140
|
+
* @typedef {P extends string ? `${B}.${P}` : never} PropertyName
|
141
|
+
*/
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @template {string} T
|
145
|
+
* @typedef {{ [property in `${T}.separator!`]: () => string }} Separator
|
146
|
+
*/
|
147
|
+
|
148
|
+
/**
|
149
|
+
* @template {object} O
|
150
|
+
* @template {string} B
|
151
|
+
* @template {string} [R=B]
|
152
|
+
* @typedef {{ [P in keyof O as PropertyName<O, P, B>]?: ModuleSimplePrinter<O[P], R> }} Printers
|
153
|
+
*/
|
154
|
+
|
155
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation">, printer: StatsPrinter) => string | undefined>} */
|
115
156
|
const COMPILATION_SIMPLE_PRINTERS = {
|
116
157
|
"compilation.summary!": (
|
117
158
|
_,
|
@@ -318,7 +359,7 @@ const COMPILATION_SIMPLE_PRINTERS = {
|
|
318
359
|
}
|
319
360
|
};
|
320
361
|
|
321
|
-
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<
|
362
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | "asset">, printer: StatsPrinter) => string | undefined>} */
|
322
363
|
const ASSET_SIMPLE_PRINTERS = {
|
323
364
|
"asset.type": type => type,
|
324
365
|
"asset.name": (name, { formatFilename, asset: { isOverSizeLimit } }) =>
|
@@ -339,13 +380,7 @@ const ASSET_SIMPLE_PRINTERS = {
|
|
339
380
|
"asset.info.javascriptModule": (javascriptModule, { formatFlag }) =>
|
340
381
|
javascriptModule ? formatFlag("javascript module") : undefined,
|
341
382
|
"asset.info.sourceFilename": (sourceFilename, { formatFlag }) =>
|
342
|
-
sourceFilename
|
343
|
-
? formatFlag(
|
344
|
-
sourceFilename === true
|
345
|
-
? "from source file"
|
346
|
-
: `from: ${sourceFilename}`
|
347
|
-
)
|
348
|
-
: undefined,
|
383
|
+
sourceFilename ? formatFlag(`from: ${sourceFilename}`) : undefined,
|
349
384
|
"asset.info.development": (development, { green, formatFlag }) =>
|
350
385
|
development ? green(formatFlag("dev")) : undefined,
|
351
386
|
"asset.info.hotModuleReplacement": (
|
@@ -376,7 +411,7 @@ const ASSET_SIMPLE_PRINTERS = {
|
|
376
411
|
assetChunkIdHint: name => name
|
377
412
|
};
|
378
413
|
|
379
|
-
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<
|
414
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | "module">, printer: StatsPrinter) => string | undefined>} */
|
380
415
|
const MODULE_SIMPLE_PRINTERS = {
|
381
416
|
"module.type": type => (type !== "module" ? type : undefined),
|
382
417
|
"module.id": (id, { formatModuleId }) =>
|
@@ -493,13 +528,13 @@ const MODULE_SIMPLE_PRINTERS = {
|
|
493
528
|
"module.separator!": () => "\n"
|
494
529
|
};
|
495
530
|
|
496
|
-
/** @type {
|
531
|
+
/** @type {Printers<KnownStatsModuleIssuer, "moduleIssuer"> & Printers<KnownStatsModuleIssuer["profile"], "moduleIssuer.profile", "moduleIssuer">} */
|
497
532
|
const MODULE_ISSUER_PRINTERS = {
|
498
533
|
"moduleIssuer.id": (id, { formatModuleId }) => formatModuleId(id),
|
499
534
|
"moduleIssuer.profile.total": (value, { formatTime }) => formatTime(value)
|
500
535
|
};
|
501
536
|
|
502
|
-
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<
|
537
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | "moduleReason">, printer: StatsPrinter) => string | undefined>} */
|
503
538
|
const MODULE_REASON_PRINTERS = {
|
504
539
|
"moduleReason.type": type => type,
|
505
540
|
"moduleReason.userRequest": (userRequest, { cyan }) =>
|
@@ -525,7 +560,7 @@ const MODULE_REASON_PRINTERS = {
|
|
525
560
|
: undefined
|
526
561
|
};
|
527
562
|
|
528
|
-
/** @type {
|
563
|
+
/** @type {Printers<KnownStatsProfile, "module.profile", "profile">} */
|
529
564
|
const MODULE_PROFILE_PRINTERS = {
|
530
565
|
"module.profile.total": (value, { formatTime }) => formatTime(value),
|
531
566
|
"module.profile.resolving": (value, { formatTime }) =>
|
@@ -544,7 +579,7 @@ const MODULE_PROFILE_PRINTERS = {
|
|
544
579
|
value ? `additional integration: ${formatTime(value)}` : undefined
|
545
580
|
};
|
546
581
|
|
547
|
-
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<
|
582
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | "chunkGroupKind" | "chunkGroup">, printer: StatsPrinter) => string | undefined>} */
|
548
583
|
const CHUNK_GROUP_PRINTERS = {
|
549
584
|
"chunkGroup.kind!": (_, { chunkGroupKind }) => chunkGroupKind,
|
550
585
|
"chunkGroup.separator!": () => "\n",
|
@@ -596,7 +631,7 @@ const CHUNK_GROUP_PRINTERS = {
|
|
596
631
|
"chunkGroupChild.name": name => (name ? `(name: ${name})` : undefined)
|
597
632
|
};
|
598
633
|
|
599
|
-
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<
|
634
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | "chunk">, printer: StatsPrinter) => string | undefined>} */
|
600
635
|
const CHUNK_PRINTERS = {
|
601
636
|
"chunk.id": (id, { formatChunkId }) => formatChunkId(id),
|
602
637
|
"chunk.files[]": (file, { formatFilename }) => formatFilename(file),
|
@@ -650,7 +685,7 @@ const CHUNK_PRINTERS = {
|
|
650
685
|
"chunkOrigin.loc": loc => loc
|
651
686
|
};
|
652
687
|
|
653
|
-
/** @type {
|
688
|
+
/** @type {Printers<KnownStatsError, "error"> & { ["error.filteredDetails"]?: (filteredDetails: number) => string | undefined } & Separator<"error">} */
|
654
689
|
const ERROR_PRINTERS = {
|
655
690
|
"error.compilerPath": (compilerPath, { bold }) =>
|
656
691
|
compilerPath ? bold(`(${compilerPath})`) : undefined,
|
@@ -676,7 +711,7 @@ const ERROR_PRINTERS = {
|
|
676
711
|
"error.separator!": () => "\n"
|
677
712
|
};
|
678
713
|
|
679
|
-
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<
|
714
|
+
/** @type {Record<string, (thing: any, context: Required<KnownStatsPrinterColorFn> & Required<KnownStatsPrinterFormatters> & WithRequired<StatsPrinterContext, "type" | "compilation" | "logging">, printer: StatsPrinter) => string | undefined>} */
|
680
715
|
const LOG_ENTRY_PRINTERS = {
|
681
716
|
"loggingEntry(error).loggingEntry.message": (message, { red }) =>
|
682
717
|
mapLines(message, x => `<e> ${red(x)}`),
|
@@ -716,17 +751,19 @@ const LOG_ENTRY_PRINTERS = {
|
|
716
751
|
filteredEntries > 0 ? `+ ${filteredEntries} hidden lines` : undefined
|
717
752
|
};
|
718
753
|
|
719
|
-
/** @type {
|
754
|
+
/** @type {Printers<KnownStatsModuleTraceItem, "moduleTraceItem">} */
|
720
755
|
const MODULE_TRACE_ITEM_PRINTERS = {
|
721
756
|
"moduleTraceItem.originName": originName => originName
|
722
757
|
};
|
723
758
|
|
724
|
-
/** @type {
|
759
|
+
/** @type {Printers<KnownStatsModuleTraceDependency, "moduleTraceDependency">} */
|
725
760
|
const MODULE_TRACE_DEPENDENCY_PRINTERS = {
|
726
761
|
"moduleTraceDependency.loc": loc => loc
|
727
762
|
};
|
728
763
|
|
729
|
-
/**
|
764
|
+
/**
|
765
|
+
* @type {Record<string, string | ((item: EXPECTED_ANY) => string)>}
|
766
|
+
*/
|
730
767
|
const ITEM_NAMES = {
|
731
768
|
"compilation.assets[]": "asset",
|
732
769
|
"compilation.modules[]": "module",
|
@@ -969,7 +1006,7 @@ const itemsJoinComma = items => items.filter(Boolean).join(", ");
|
|
969
1006
|
/** @type {SimpleItemsJoiner} */
|
970
1007
|
const itemsJoinCommaBrackets = items =>
|
971
1008
|
items.length > 0 ? `(${items.filter(Boolean).join(", ")})` : undefined;
|
972
|
-
/** @type {
|
1009
|
+
/** @type {(item: string) => SimpleItemsJoiner} */
|
973
1010
|
const itemsJoinCommaBracketsWithName = name => items =>
|
974
1011
|
items.length > 0
|
975
1012
|
? `(${name}: ${items.filter(Boolean).join(", ")})`
|
@@ -1300,7 +1337,7 @@ const AVAILABLE_COLORS = {
|
|
1300
1337
|
magenta: "\u001B[1m\u001B[35m"
|
1301
1338
|
};
|
1302
1339
|
|
1303
|
-
/** @type {Record<string,
|
1340
|
+
/** @type {Record<string, (value: any, options: Required<KnownStatsPrinterColorFn> & StatsPrinterContext, ...args: any) => string>} */
|
1304
1341
|
const AVAILABLE_FORMATS = {
|
1305
1342
|
formatChunkId: (id, { yellow }, direction) => {
|
1306
1343
|
switch (direction) {
|
@@ -1391,7 +1428,7 @@ const AVAILABLE_FORMATS = {
|
|
1391
1428
|
}
|
1392
1429
|
};
|
1393
1430
|
|
1394
|
-
/** @typedef {
|
1431
|
+
/** @typedef {(result: string) => string} ResultModifierFn */
|
1395
1432
|
/** @type {Record<string, ResultModifierFn>} */
|
1396
1433
|
const RESULT_MODIFIER = {
|
1397
1434
|
"module.modules": result => indent(result, "| ")
|
@@ -1498,7 +1535,7 @@ class DefaultStatsPrinterPlugin {
|
|
1498
1535
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1499
1536
|
COMPILATION_SIMPLE_PRINTERS[key](
|
1500
1537
|
obj,
|
1501
|
-
/** @type {
|
1538
|
+
/** @type {DefineStatsPrinterContext<"compilation">} */
|
1502
1539
|
(ctx),
|
1503
1540
|
stats
|
1504
1541
|
)
|
@@ -1511,7 +1548,7 @@ class DefaultStatsPrinterPlugin {
|
|
1511
1548
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1512
1549
|
ASSET_SIMPLE_PRINTERS[key](
|
1513
1550
|
obj,
|
1514
|
-
/** @type {
|
1551
|
+
/** @type {DefineStatsPrinterContext<"asset">} */
|
1515
1552
|
(ctx),
|
1516
1553
|
stats
|
1517
1554
|
)
|
@@ -1524,7 +1561,7 @@ class DefaultStatsPrinterPlugin {
|
|
1524
1561
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1525
1562
|
MODULE_SIMPLE_PRINTERS[key](
|
1526
1563
|
obj,
|
1527
|
-
/** @type {
|
1564
|
+
/** @type {DefineStatsPrinterContext<"module">} */
|
1528
1565
|
(ctx),
|
1529
1566
|
stats
|
1530
1567
|
)
|
@@ -1535,9 +1572,10 @@ class DefaultStatsPrinterPlugin {
|
|
1535
1572
|
stats.hooks.print
|
1536
1573
|
.for(key)
|
1537
1574
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1538
|
-
|
1575
|
+
/** @type {Record<string, ModuleSimplePrinter<KnownStatsModuleIssuer[keyof KnownStatsModuleIssuer] | KnownStatsModuleIssuer["profile"][keyof KnownStatsModuleIssuer["profile"]], "type" | "compilation" | "moduleIssuer">>} */
|
1576
|
+
(MODULE_ISSUER_PRINTERS)[key](
|
1539
1577
|
obj,
|
1540
|
-
/** @type {
|
1578
|
+
/** @type {DefineStatsPrinterContext<"moduleIssuer">} */
|
1541
1579
|
(ctx),
|
1542
1580
|
stats
|
1543
1581
|
)
|
@@ -1550,7 +1588,7 @@ class DefaultStatsPrinterPlugin {
|
|
1550
1588
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1551
1589
|
MODULE_REASON_PRINTERS[key](
|
1552
1590
|
obj,
|
1553
|
-
/** @type {
|
1591
|
+
/** @type {DefineStatsPrinterContext<"moduleReason">} */
|
1554
1592
|
(ctx),
|
1555
1593
|
stats
|
1556
1594
|
)
|
@@ -1561,9 +1599,10 @@ class DefaultStatsPrinterPlugin {
|
|
1561
1599
|
stats.hooks.print
|
1562
1600
|
.for(key)
|
1563
1601
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1564
|
-
|
1602
|
+
/** @type {Record<string, ModuleSimplePrinter<KnownStatsProfile[keyof KnownStatsProfile], "type" | "compilation" | "profile">>} */
|
1603
|
+
(MODULE_PROFILE_PRINTERS)[key](
|
1565
1604
|
obj,
|
1566
|
-
/** @type {
|
1605
|
+
/** @type {DefineStatsPrinterContext<"profile">} */
|
1567
1606
|
(ctx),
|
1568
1607
|
stats
|
1569
1608
|
)
|
@@ -1576,7 +1615,7 @@ class DefaultStatsPrinterPlugin {
|
|
1576
1615
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1577
1616
|
CHUNK_GROUP_PRINTERS[key](
|
1578
1617
|
obj,
|
1579
|
-
/** @type {
|
1618
|
+
/** @type {DefineStatsPrinterContext<"chunkGroupKind" | "chunkGroup">} */
|
1580
1619
|
(ctx),
|
1581
1620
|
stats
|
1582
1621
|
)
|
@@ -1589,7 +1628,7 @@ class DefaultStatsPrinterPlugin {
|
|
1589
1628
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1590
1629
|
CHUNK_PRINTERS[key](
|
1591
1630
|
obj,
|
1592
|
-
/** @type {
|
1631
|
+
/** @type {DefineStatsPrinterContext<"chunk">} */
|
1593
1632
|
(ctx),
|
1594
1633
|
stats
|
1595
1634
|
)
|
@@ -1600,9 +1639,10 @@ class DefaultStatsPrinterPlugin {
|
|
1600
1639
|
stats.hooks.print
|
1601
1640
|
.for(key)
|
1602
1641
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1603
|
-
|
1642
|
+
/** @type {Record<string, ModuleSimplePrinter<KnownStatsError[keyof KnownStatsError], "type" | "compilation" | "error">>} */
|
1643
|
+
(ERROR_PRINTERS)[key](
|
1604
1644
|
obj,
|
1605
|
-
/** @type {
|
1645
|
+
/** @type {DefineStatsPrinterContext<"error">} */
|
1606
1646
|
(ctx),
|
1607
1647
|
stats
|
1608
1648
|
)
|
@@ -1615,7 +1655,7 @@ class DefaultStatsPrinterPlugin {
|
|
1615
1655
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1616
1656
|
LOG_ENTRY_PRINTERS[key](
|
1617
1657
|
obj,
|
1618
|
-
/** @type {
|
1658
|
+
/** @type {DefineStatsPrinterContext<"logging">} */
|
1619
1659
|
(ctx),
|
1620
1660
|
stats
|
1621
1661
|
)
|
@@ -1626,9 +1666,10 @@ class DefaultStatsPrinterPlugin {
|
|
1626
1666
|
stats.hooks.print
|
1627
1667
|
.for(key)
|
1628
1668
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1629
|
-
|
1669
|
+
/** @type {Record<string, ModuleSimplePrinter<KnownStatsModuleTraceDependency[keyof KnownStatsModuleTraceDependency], "type" | "compilation" | "moduleTraceDependency">>} */
|
1670
|
+
(MODULE_TRACE_DEPENDENCY_PRINTERS)[key](
|
1630
1671
|
obj,
|
1631
|
-
/** @type {
|
1672
|
+
/** @type {DefineStatsPrinterContext<"moduleTraceDependency">} */
|
1632
1673
|
(ctx),
|
1633
1674
|
stats
|
1634
1675
|
)
|
@@ -1639,9 +1680,10 @@ class DefaultStatsPrinterPlugin {
|
|
1639
1680
|
stats.hooks.print
|
1640
1681
|
.for(key)
|
1641
1682
|
.tap("DefaultStatsPrinterPlugin", (obj, ctx) =>
|
1642
|
-
|
1683
|
+
/** @type {Record<string, ModuleSimplePrinter<KnownStatsModuleTraceItem[keyof KnownStatsModuleTraceItem], "type" | "compilation" | "moduleTraceItem">>} */
|
1684
|
+
(MODULE_TRACE_ITEM_PRINTERS)[key](
|
1643
1685
|
obj,
|
1644
|
-
/** @type {
|
1686
|
+
/** @type {DefineStatsPrinterContext<"moduleTraceItem">} */
|
1645
1687
|
(ctx),
|
1646
1688
|
stats
|
1647
1689
|
)
|
@@ -14,24 +14,24 @@ const smartGrouping = require("../util/smartGrouping");
|
|
14
14
|
/** @typedef {import("../Compilation").NormalizedStatsOptions} NormalizedStatsOptions */
|
15
15
|
/** @typedef {import("../Module")} Module */
|
16
16
|
/** @typedef {import("../WebpackError")} WebpackError */
|
17
|
-
/** @typedef {import("../util/comparators").Comparator<
|
17
|
+
/** @typedef {import("../util/comparators").Comparator<TODO>} Comparator */
|
18
18
|
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
19
|
-
/** @typedef {import("../util/smartGrouping").GroupConfig<
|
19
|
+
/** @typedef {import("../util/smartGrouping").GroupConfig<TODO, EXPECTED_OBJECT>} GroupConfig */
|
20
20
|
|
21
21
|
/**
|
22
22
|
* @typedef {object} KnownStatsFactoryContext
|
23
23
|
* @property {string} type
|
24
|
-
* @property {
|
24
|
+
* @property {(path: string) => string} makePathsRelative
|
25
25
|
* @property {Compilation} compilation
|
26
26
|
* @property {Set<Module>} rootModules
|
27
|
-
* @property {Map<string,Chunk[]>} compilationFileToChunks
|
28
|
-
* @property {Map<string,Chunk[]>} compilationAuxiliaryFileToChunks
|
27
|
+
* @property {Map<string, Chunk[]>} compilationFileToChunks
|
28
|
+
* @property {Map<string, Chunk[]>} compilationAuxiliaryFileToChunks
|
29
29
|
* @property {RuntimeSpec} runtime
|
30
|
-
* @property {
|
31
|
-
* @property {
|
30
|
+
* @property {(compilation: Compilation) => WebpackError[]} cachedGetErrors
|
31
|
+
* @property {(compilation: Compilation) => WebpackError[]} cachedGetWarnings
|
32
32
|
*/
|
33
33
|
|
34
|
-
/** @typedef {Record<string,
|
34
|
+
/** @typedef {KnownStatsFactoryContext & Record<string, EXPECTED_ANY>} StatsFactoryContext */
|
35
35
|
|
36
36
|
/** @typedef {any} CreatedObject */
|
37
37
|
/** @typedef {any} FactoryData */
|
@@ -128,7 +128,7 @@ class StatsFactory {
|
|
128
128
|
* @param {HM} hookMap hook map
|
129
129
|
* @param {Caches<H>} cache cache
|
130
130
|
* @param {string} type type
|
131
|
-
* @param {
|
131
|
+
* @param {(hook: H) => R | void} fn fn
|
132
132
|
* @returns {R | void} hook
|
133
133
|
* @private
|
134
134
|
*/
|
@@ -146,7 +146,7 @@ class StatsFactory {
|
|
146
146
|
* @param {Caches<H>} cache cache
|
147
147
|
* @param {string} type type
|
148
148
|
* @param {FactoryData} data data
|
149
|
-
* @param {
|
149
|
+
* @param {(hook: H, factoryData: FactoryData) => FactoryData} fn fn
|
150
150
|
* @returns {FactoryData} data
|
151
151
|
* @private
|
152
152
|
*/
|
@@ -165,7 +165,7 @@ class StatsFactory {
|
|
165
165
|
* @param {Caches<H>} cache cache
|
166
166
|
* @param {string} type type
|
167
167
|
* @param {Array<FactoryData>} items items
|
168
|
-
* @param {
|
168
|
+
* @param {(hook: H, item: R, idx: number, i: number) => R | undefined} fn fn
|
169
169
|
* @param {boolean} forceClone force clone
|
170
170
|
* @returns {R[]} result for each level
|
171
171
|
* @private
|
@@ -55,10 +55,10 @@ const { HookMap, SyncWaterfallHook, SyncBailHook } = require("tapable");
|
|
55
55
|
*/
|
56
56
|
|
57
57
|
/**
|
58
|
-
* @typedef {object}
|
58
|
+
* @typedef {object} KnownStatsPrinterFormatters
|
59
59
|
* @property {(file: string, oversize?: boolean) => string=} formatFilename
|
60
|
-
* @property {(id: string) => string=} formatModuleId
|
61
|
-
* @property {(id: string, direction?: "parent"|"child"|"sibling") => string=} formatChunkId
|
60
|
+
* @property {(id: string | number) => string=} formatModuleId
|
61
|
+
* @property {(id: string | number, direction?: "parent" | "child" | "sibling") => string=} formatChunkId
|
62
62
|
* @property {(size: number) => string=} formatSize
|
63
63
|
* @property {(size: string) => string=} formatLayer
|
64
64
|
* @property {(dateTime: number) => string=} formatDateTime
|
@@ -67,8 +67,8 @@ const { HookMap, SyncWaterfallHook, SyncBailHook } = require("tapable");
|
|
67
67
|
* @property {(message: string) => string=} formatError
|
68
68
|
*/
|
69
69
|
|
70
|
-
/** @typedef {
|
71
|
-
/** @typedef {
|
70
|
+
/** @typedef {KnownStatsPrinterColorFn & KnownStatsPrinterFormatters & KnownStatsPrinterContext & Record<string, EXPECTED_ANY>} StatsPrinterContext */
|
71
|
+
/** @typedef {TODO} PrintObject */
|
72
72
|
|
73
73
|
/**
|
74
74
|
* @typedef {object} StatsPrintHooks
|
@@ -147,7 +147,7 @@ class StatsPrinter {
|
|
147
147
|
* @template {H extends import("tapable").Hook<any, infer R> ? R : never} R
|
148
148
|
* @param {HM} hookMap hook map
|
149
149
|
* @param {string} type type
|
150
|
-
* @param {
|
150
|
+
* @param {(hooK: H) => R | void} fn fn
|
151
151
|
* @returns {R | void} hook
|
152
152
|
*/
|
153
153
|
_forEachLevel(hookMap, type, fn) {
|
@@ -165,7 +165,7 @@ class StatsPrinter {
|
|
165
165
|
* @param {HM} hookMap hook map
|
166
166
|
* @param {string} type type
|
167
167
|
* @param {string} data data
|
168
|
-
* @param {
|
168
|
+
* @param {(hook: H, data: string) => string} fn fn
|
169
169
|
* @returns {string} result of `fn`
|
170
170
|
*/
|
171
171
|
_forEachLevelWaterfall(hookMap, type, data, fn) {
|
package/lib/util/ArrayHelpers.js
CHANGED
@@ -7,12 +7,11 @@
|
|
7
7
|
|
8
8
|
/**
|
9
9
|
* Compare two arrays or strings by performing strict equality check for each value.
|
10
|
-
* @template T
|
10
|
+
* @template T
|
11
11
|
* @param {ArrayLike<T>} a Array of values to be compared
|
12
12
|
* @param {ArrayLike<T>} b Array of values to be compared
|
13
13
|
* @returns {boolean} returns true if all the elements of passed arrays are strictly equal.
|
14
14
|
*/
|
15
|
-
|
16
15
|
module.exports.equals = (a, b) => {
|
17
16
|
if (a.length !== b.length) return false;
|
18
17
|
for (let i = 0; i < a.length; i++) {
|
@@ -23,12 +22,11 @@ module.exports.equals = (a, b) => {
|
|
23
22
|
|
24
23
|
/**
|
25
24
|
* Partition an array by calling a predicate function on each value.
|
26
|
-
* @template T
|
25
|
+
* @template T
|
27
26
|
* @param {Array<T>} arr Array of values to be partitioned
|
28
27
|
* @param {(value: T) => boolean} fn Partition function which partitions based on truthiness of result.
|
29
28
|
* @returns {[Array<T>, Array<T>]} returns the values of `arr` partitioned into two new arrays based on fn predicate.
|
30
29
|
*/
|
31
|
-
|
32
30
|
module.exports.groupBy = (
|
33
31
|
// eslint-disable-next-line default-param-last
|
34
32
|
arr = [],
|
package/lib/util/ArrayQueue.js
CHANGED
package/lib/util/AsyncQueue.js
CHANGED
@@ -50,12 +50,12 @@ class AsyncQueueEntry {
|
|
50
50
|
|
51
51
|
/**
|
52
52
|
* @template T, K
|
53
|
-
* @typedef {
|
53
|
+
* @typedef {(item: T) => K} getKey
|
54
54
|
*/
|
55
55
|
|
56
56
|
/**
|
57
57
|
* @template T, R
|
58
|
-
* @typedef {
|
58
|
+
* @typedef {(item: T, callback: Callback<R>) => void} Processor
|
59
59
|
*/
|
60
60
|
|
61
61
|
/**
|
@@ -85,13 +85,13 @@ class AsyncQueue {
|
|
85
85
|
this._entries = new Map();
|
86
86
|
/** @type {ArrayQueue<AsyncQueueEntry<T, K, R>>} */
|
87
87
|
this._queued = new ArrayQueue();
|
88
|
-
/** @type {AsyncQueue<
|
88
|
+
/** @type {AsyncQueue<T, K, R>[] | undefined} */
|
89
89
|
this._children = undefined;
|
90
90
|
this._activeTasks = 0;
|
91
91
|
this._willEnsureProcessing = false;
|
92
92
|
this._needProcessing = false;
|
93
93
|
this._stopped = false;
|
94
|
-
/** @type {AsyncQueue<
|
94
|
+
/** @type {AsyncQueue<T, K, R>} */
|
95
95
|
this._root = parent ? parent._root : this;
|
96
96
|
if (parent) {
|
97
97
|
if (this._root._children === undefined) {
|
@@ -19,7 +19,7 @@ const last = set => {
|
|
19
19
|
/**
|
20
20
|
* @template T
|
21
21
|
* @param {Iterable<T>} iterable iterable
|
22
|
-
* @param {
|
22
|
+
* @param {(value: T) => boolean | null | undefined} filter predicate
|
23
23
|
* @returns {boolean} true, if some items match the filter predicate
|
24
24
|
*/
|
25
25
|
const someInIterable = (iterable, filter) => {
|