X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FcompareAscending.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FcompareAscending.js;h=532866c137e9d06eb05153eb608740f9191edf00;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/internal/compareAscending.js b/node_modules/uncss/node_modules/lodash/internal/compareAscending.js new file mode 100644 index 000000000..532866c13 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/internal/compareAscending.js @@ -0,0 +1,33 @@ +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending;