extra-iterable
Advanced tools
Comparing version 2.0.35 to 2.0.36
23
index.js
@@ -624,2 +624,12 @@ /** | ||
/** | ||
* Adds values to the end. | ||
* @param {Iterable} x an iterable | ||
* @param {...any} vs values to add | ||
* @returns {Iterable} iterable | ||
*/ | ||
function* push(x, ...vs) { | ||
yield* x; | ||
yield* vs; | ||
} | ||
/** | ||
* Compares two values. | ||
@@ -630,6 +640,6 @@ * @param {*} a a value | ||
*/ | ||
function cmp49(a, b) { | ||
function cmp50(a, b) { | ||
return a<b? -1:(a>b? 1:0); | ||
} | ||
const cmp50 = cmp49; | ||
const cmp51 = cmp50; | ||
@@ -643,3 +653,3 @@ /** | ||
function range(x, fn=null) { | ||
var fn = fn||cmp50, m = x[0], n = m; | ||
var fn = fn||cmp51, m = x[0], n = m; | ||
for(var v of x) { | ||
@@ -656,6 +666,6 @@ if(fn(v, m)<0) m = v; | ||
*/ | ||
function id51(v) { | ||
function id52(v) { | ||
return v; | ||
} | ||
const id52 = id51; | ||
const id53 = id52; | ||
@@ -670,3 +680,3 @@ /** | ||
function rangeOn(x, fn=null, ths=null) { | ||
var fn = fn||id52, i = -1; | ||
var fn = fn||id53, i = -1; | ||
var mk = fn.call(ths, x[0], 0, x), mv = x[0]; | ||
@@ -838,2 +848,3 @@ var nk = mk, nv = mv; | ||
exports.partitionOn = partitionOn; | ||
exports.push = push; | ||
exports.range = range; | ||
@@ -840,0 +851,0 @@ exports.rangeOn = rangeOn; |
{ | ||
"name": "extra-iterable", | ||
"version": "2.0.35", | ||
"version": "2.0.36", | ||
"description": "Standard utility methods for Iterable.", | ||
@@ -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
25199
842