MCPcopy
hub / github.com/webpack/webpack / getViolatingMinSizes

Function getViolatingMinSizes

lib/optimize/SplitChunksPlugin.js:423–435  ·  view source on GitHub ↗
(sizes, minSize)

Source from the content-addressed store, hash-verified

421 * @returns {undefined | SourceTypes} list of size types that are below min size
422 */
423const getViolatingMinSizes = (sizes, minSize) => {
424 /** @type {SourceTypes | undefined} */
425 let list;
426 for (const key of /** @type {SourceType[]} */ (Object.keys(minSize))) {
427 const size = sizes[key];
428 if (size === undefined || size === 0) continue;
429 if (size < minSize[key]) {
430 if (list === undefined) list = [key];
431 else list.push(key);
432 }
433 }
434 return list;
435};
436
437/**
438 * Returns the total size.

Callers 2

applyMethod · 0.85

Calls 2

keysMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected