extra-array
Advanced tools
Comparing version 4.0.133 to 4.0.134
74
index.js
@@ -855,18 +855,2 @@ 'use strict'; | ||
} | ||
function count(x, ft) { | ||
var i = -1, a = 0; | ||
for (var v of x) | ||
if (ft(v, ++i, x)) | ||
++a; | ||
return a; | ||
} | ||
function countEach(x, fm = null) { | ||
var fm = fm || IDENTITY; | ||
var i = -1, a = new Map(); | ||
for (var v of x) { | ||
var w = fm(v, ++i, x); | ||
a.set(w, (a.get(w) || 0) + 1); | ||
} | ||
return a; | ||
} | ||
function indexOf(x, v, i = 0) { | ||
@@ -1299,23 +1283,2 @@ return x.indexOf(v, i); | ||
} | ||
function partition(x, ft) { | ||
var t = [], f = [], i = -1; | ||
for (var v of x) { | ||
if (ft(v, ++i, x)) | ||
t.push(v); | ||
else | ||
f.push(v); | ||
} | ||
return [t, f]; | ||
} | ||
function partitionEach(x, fm = null) { | ||
var fm = fm || IDENTITY; | ||
var i = -1, a = new Map(); | ||
for (var v of x) { | ||
var w = fm(v, ++i, x); | ||
if (!a.has(w)) | ||
a.set(w, []); | ||
a.get(w).push(v); | ||
} | ||
return a; | ||
} | ||
function chunk(x, n = 1, s = n) { | ||
@@ -1359,2 +1322,39 @@ var a = []; | ||
} | ||
function count(x, ft) { | ||
var i = -1, a = 0; | ||
for (var v of x) | ||
if (ft(v, ++i, x)) | ||
++a; | ||
return a; | ||
} | ||
function countEach(x, fm = null) { | ||
var fm = fm || IDENTITY; | ||
var i = -1, a = new Map(); | ||
for (var v of x) { | ||
var w = fm(v, ++i, x); | ||
a.set(w, (a.get(w) || 0) + 1); | ||
} | ||
return a; | ||
} | ||
function partition(x, ft) { | ||
var t = [], f = [], i = -1; | ||
for (var v of x) { | ||
if (ft(v, ++i, x)) | ||
t.push(v); | ||
else | ||
f.push(v); | ||
} | ||
return [t, f]; | ||
} | ||
function partitionEach(x, fm = null) { | ||
var fm = fm || IDENTITY; | ||
var i = -1, a = new Map(); | ||
for (var v of x) { | ||
var w = fm(v, ++i, x); | ||
if (!a.has(w)) | ||
a.set(w, []); | ||
a.get(w).push(v); | ||
} | ||
return a; | ||
} | ||
function concat(...xs) { | ||
@@ -1361,0 +1361,0 @@ return [].concat(...xs); |
{ | ||
"name": "extra-array", | ||
"version": "4.0.133", | ||
"version": "4.0.134", | ||
"description": "An array is a collection of values, stored contiguously.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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