MCPcopy
hub / github.com/webpack/webpack / sortModules

Function sortModules

lib/WarnCaseSensitiveModulesPlugin.js:20–30  ·  view source on GitHub ↗
(modules)

Source from the content-addressed store, hash-verified

18 * @returns {Module[]} sorted version of original modules
19 */
20const sortModules = (modules) =>
21 modules.sort((a, b) => {
22 const aIdent = a.identifier();
23 const bIdent = b.identifier();
24 /* istanbul ignore next */
25 if (aIdent < bIdent) return -1;
26 /* istanbul ignore next */
27 if (aIdent > bIdent) return 1;
28 /* istanbul ignore next */
29 return 0;
30 });
31
32/**
33 * Formats the conflicting modules and one representative incoming reason for

Callers 1

constructorMethod · 0.85

Calls 2

sortMethod · 0.80
identifierMethod · 0.45

Tested by

no test coverage detected