MCPcopy
hub / github.com/webpack/webpack / compareNumbers

Function compareNumbers

lib/util/comparators.js:207–214  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

205 * @returns {-1 | 0 | 1} compare result
206 */
207const compareNumbers = (a, b) => {
208 if (typeof a !== typeof b) {
209 return typeof a < typeof b ? -1 : 1;
210 }
211 if (a < b) return -1;
212 if (a > b) return 1;
213 return 0;
214};
215
216/**
217 * Compares strings numeric.

Calls

no outgoing calls

Tested by

no test coverage detected