MCPcopy
hub / github.com/webpack/webpack / createOrderedArrayFunction

Function createOrderedArrayFunction

lib/ChunkGraph.js:158–167  ·  view source on GitHub ↗
(comparator)

Source from the content-addressed store, hash-verified

156 * @returns {ModuleSetToArrayFunction} set as ordered array
157 */
158const createOrderedArrayFunction = (comparator) => {
159 let fn = createOrderedArrayFunctionMap.get(comparator);
160 if (fn !== undefined) return fn;
161 fn = (set) => {
162 set.sortWith(comparator);
163 return [...set];
164 };
165 createOrderedArrayFunctionMap.set(comparator, fn);
166 return fn;
167};
168
169/**
170 * Returns the size of the modules.

Callers 1

Calls 3

sortWithMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected