Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extra-array

Package Overview
Dependencies
Maintainers
1
Versions
856
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-array - npm Package Compare versions

Comparing version 2.0.7 to 2.0.8

23

fresh.js

@@ -25,3 +25,3 @@ /**

function tail(x) {
return a.slice(1);
return x.slice(1);
}

@@ -39,8 +39,13 @@

/**
* Returns corresponding values from n arrays.
* @param {array} xs n arrays
* @returns {array} array of corresponding values
* Gets largest element, as per compare function.
* @param {array} x array
* @param {function?} fn compare function (a, b)
* @returns {*} largest element
*/
function zip(xs) {
return zipWith(xs ,args);
function max(x, fn) {
if(!fn) return Math.max.apply(null, x);
var a = undefined;
for(var e of x)
a = fn(a, e)<0? e:a;
return a;
}

@@ -55,3 +60,4 @@

*/
function zipWith(xs, fn, ths=null) {
function zip(xs, fn, ths=null) {
fn = fn||args;
var a = [], A = 0;

@@ -67,3 +73,2 @@ for(var r=0, R=xs.length; r<R; r++)

}
function args() {

@@ -76,3 +81,3 @@ return arguments;

exports.init = init;
exports.max = max;
exports.zip = zip;
exports.zipWith = zipWith;
{
"name": "extra-array",
"version": "2.0.7",
"version": "2.0.8",
"description": "Standard utility methods for Array.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,1 +1,7 @@

cons
uncons
intersperse
intercalate
xor

@@ -2,0 +8,0 @@ xorBy

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc