extra-array
Advanced tools
Comparing version 2.0.8 to 2.0.9
15
fresh.js
@@ -52,2 +52,16 @@ /** | ||
/** | ||
* Gets least element, as per compare function. | ||
* @param {array} x array | ||
* @param {function?} fn compare function (a, b) | ||
* @returns {*} least element | ||
*/ | ||
function min(x, fn) { | ||
if(!fn) return Math.min.apply(null, x); | ||
var a = undefined; | ||
for(var e of x) | ||
a = fn(a, e)<0? a:e; | ||
return a; | ||
} | ||
/** | ||
* Combines values from n arrays, with a function. | ||
@@ -79,2 +93,3 @@ * @param {array} xs n arrays | ||
exports.max = max; | ||
exports.min = min; | ||
exports.zip = zip; |
{ | ||
"name": "extra-array", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"description": "Standard utility methods for Array.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20930
519