extra-array
Advanced tools
Comparing version 4.0.131 to 4.0.132
130
index.js
@@ -944,52 +944,2 @@ 'use strict'; | ||
} | ||
function exclusiveScan(x, fr, acc) { | ||
var a = []; | ||
for (var i = 0, I = x.length; i < I; ++i) { | ||
a.push(acc); | ||
acc = fr(acc, x[i], i, x); | ||
} | ||
return a; | ||
} | ||
function exclusiveScan$(x, fr, acc) { | ||
for (var i = 0, I = x.length; i < I; ++i) { | ||
var v = x[i]; | ||
x[i] = acc; | ||
acc = fr(acc, v, i, x); | ||
} | ||
return x; | ||
} | ||
function inclusiveScan(x, fr, acc) { | ||
var a = []; | ||
for (var i = 0, I = x.length; i < I; ++i) { | ||
acc = fr(acc, x[i], i, x); | ||
a.push(acc); | ||
} | ||
return a; | ||
} | ||
function inclusiveScan$(x, fr, acc) { | ||
for (var i = 0, I = x.length; i < I; ++i) | ||
acc = x[i] = fr(acc, x[i], i, x); | ||
return x; | ||
} | ||
function adjacentCombine(x, fc, acc) { | ||
var a = []; | ||
if (x.length > 0) | ||
a.push(fc(acc, x[0])); | ||
for (var i = 1, I = x.length; i < I; ++i) | ||
a.push(fc(x[i - 1], x[i])); | ||
return a; | ||
} | ||
function adjacentCombine$(x, fc, acc) { | ||
var X = x.length; | ||
if (X === 0) | ||
return x; | ||
var v = x[0]; | ||
x[0] = fc(acc, v); | ||
for (var i = 1; i < X; ++i) { | ||
var w = x[i]; | ||
x[i] = fc(v, w); | ||
v = w; | ||
} | ||
return x; | ||
} | ||
function filter(x, ft) { | ||
@@ -1033,17 +983,2 @@ return x.filter(ft); | ||
} | ||
function accumulate(x, fr, acc) { | ||
var init = arguments.length <= 2; | ||
var i = -1, a = []; | ||
for (var v of x) { | ||
if (init) { | ||
init = false; | ||
acc = v; | ||
++i; | ||
} | ||
else | ||
acc = fr(acc, v, ++i, x); | ||
a.push(acc); | ||
} | ||
return a; | ||
} | ||
function zip(xs, fm = null, fe = null, vd) { | ||
@@ -1097,2 +1032,67 @@ var fm = fm || IDENTITY; | ||
} | ||
function accumulate(x, fr, acc) { | ||
var init = arguments.length <= 2; | ||
var i = -1, a = []; | ||
for (var v of x) { | ||
if (init) { | ||
init = false; | ||
acc = v; | ||
++i; | ||
} | ||
else | ||
acc = fr(acc, v, ++i, x); | ||
a.push(acc); | ||
} | ||
return a; | ||
} | ||
function exclusiveScan(x, fr, acc) { | ||
var a = []; | ||
for (var i = 0, I = x.length; i < I; ++i) { | ||
a.push(acc); | ||
acc = fr(acc, x[i], i, x); | ||
} | ||
return a; | ||
} | ||
function exclusiveScan$(x, fr, acc) { | ||
for (var i = 0, I = x.length; i < I; ++i) { | ||
var v = x[i]; | ||
x[i] = acc; | ||
acc = fr(acc, v, i, x); | ||
} | ||
return x; | ||
} | ||
function inclusiveScan(x, fr, acc) { | ||
var a = []; | ||
for (var i = 0, I = x.length; i < I; ++i) { | ||
acc = fr(acc, x[i], i, x); | ||
a.push(acc); | ||
} | ||
return a; | ||
} | ||
function inclusiveScan$(x, fr, acc) { | ||
for (var i = 0, I = x.length; i < I; ++i) | ||
acc = x[i] = fr(acc, x[i], i, x); | ||
return x; | ||
} | ||
function adjacentCombine(x, fc, acc) { | ||
var a = []; | ||
if (x.length > 0) | ||
a.push(fc(acc, x[0])); | ||
for (var i = 1, I = x.length; i < I; ++i) | ||
a.push(fc(x[i - 1], x[i])); | ||
return a; | ||
} | ||
function adjacentCombine$(x, fc, acc) { | ||
var X = x.length; | ||
if (X === 0) | ||
return x; | ||
var v = x[0]; | ||
x[0] = fc(acc, v); | ||
for (var i = 1; i < X; ++i) { | ||
var w = x[i]; | ||
x[i] = fc(v, w); | ||
v = w; | ||
} | ||
return x; | ||
} | ||
function fill(x, v, i = 0, I = x.length) { | ||
@@ -1099,0 +1099,0 @@ return x.slice().fill(v, i, I); |
{ | ||
"name": "extra-array", | ||
"version": "4.0.131", | ||
"version": "4.0.132", | ||
"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