MCPcopy
hub / github.com/webpack/webpack / normalizeSizes

Function normalizeSizes

lib/optimize/SplitChunksPlugin.js:323–333  ·  view source on GitHub ↗
(value, defaultSizeTypes)

Source from the content-addressed store, hash-verified

321 * @returns {SplitChunksSizes} normalized representation
322 */
323const normalizeSizes = (value, defaultSizeTypes) => {
324 if (typeof value === "number") {
325 /** @type {SplitChunksSizes} */
326 const o = {};
327 for (const sizeType of defaultSizeTypes) o[sizeType] = value;
328 return o;
329 } else if (typeof value === "object" && value !== null) {
330 return { ...value };
331 }
332 return {};
333};
334
335/**
336 * Merges the provided values into a single result.

Callers 2

createCacheGroupSourceFunction · 0.85
constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected