MCPcopy
hub / github.com/webpack/webpack / isSorted

Function isSorted

lib/Compiler.js:137–142  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

135 * @returns {boolean} true, if the array is sorted
136 */
137const isSorted = (array) => {
138 for (let i = 1; i < array.length; i++) {
139 if (array[i - 1] > array[i]) return false;
140 }
141 return true;
142};
143
144/**
145 * Returns the object with properties sorted by property name.

Callers 1

writeFileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected