extra-array
Advanced tools
Comparing version 4.0.129 to 4.0.130
44
index.js
@@ -829,24 +829,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) { | ||
return x.indexOf(v, i); | ||
} | ||
function lastIndexOf(x, v, i = x.length - 1) { | ||
return x.lastIndexOf(v, i); | ||
} | ||
function scanWhile(x, ft) { | ||
@@ -878,2 +856,24 @@ var i = -1; | ||
} | ||
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) { | ||
return x.indexOf(v, i); | ||
} | ||
function lastIndexOf(x, v, i = x.length - 1) { | ||
return x.lastIndexOf(v, i); | ||
} | ||
function search(x, ft) { | ||
@@ -880,0 +880,0 @@ return x.findIndex(ft); |
{ | ||
"name": "extra-array", | ||
"version": "4.0.129", | ||
"version": "4.0.130", | ||
"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