@apache-arrow/es5-esm
Advanced tools
Comparing version 0.15.1 to 0.16.0
@@ -139,12 +139,13 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
var batch = batches[batchIndex]; | ||
// TODO: bind batches lazily | ||
// If predicate doesn't match anything in the batch we don't need | ||
// to bind the callback | ||
if (bind) { | ||
bind(batch); | ||
} | ||
var predicate = this._predicate.bind(batch); | ||
var isBound = false; | ||
// yield all indices | ||
for (var index = -1, numRows = batch.length; ++index < numRows;) { | ||
if (predicate(index, batch)) { | ||
// bind batches lazily - if predicate doesn't match anything | ||
// in the batch we don't need to call bind on the batch | ||
if (bind && !isBound) { | ||
bind(batch); | ||
isBound = true; | ||
} | ||
next(index, batch); | ||
@@ -161,12 +162,13 @@ } | ||
var batch = batches[batchIndex]; | ||
// TODO: bind batches lazily | ||
// If predicate doesn't match anything in the batch we don't need | ||
// to bind the callback | ||
if (bind) { | ||
bind(batch); | ||
} | ||
var predicate = this._predicate.bind(batch); | ||
var isBound = false; | ||
// yield all indices | ||
for (var index = batch.length; --index >= 0;) { | ||
if (predicate(index, batch)) { | ||
// bind batches lazily - if predicate doesn't match anything | ||
// in the batch we don't need to call bind on the batch | ||
if (bind && !isBound) { | ||
bind(batch); | ||
isBound = true; | ||
} | ||
next(index, batch); | ||
@@ -173,0 +175,0 @@ } |
@@ -161,3 +161,3 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
export { CombinationPredicate }; | ||
// add children to protoype so it doesn't get mangled in es2015/umd | ||
// add children to prototype so it doesn't get mangled in es2015/umd | ||
CombinationPredicate.prototype.children = Object.freeze([]); // freeze for safety | ||
@@ -257,3 +257,3 @@ /** @ignore */ | ||
Equals.prototype._bindLitCol = function (batch, lit, col) { | ||
// Equals is comutative | ||
// Equals is commutative | ||
return this._bindColLit(batch, col, lit); | ||
@@ -260,0 +260,0 @@ }; |
{ | ||
"version": "0.15.1", | ||
"version": "0.16.0", | ||
"name": "@apache-arrow/es5-esm", | ||
@@ -4,0 +4,0 @@ "browser": "Arrow.dom.js", |
@@ -46,2 +46,3 @@ <!--- | ||
* [Observable: Manipulating flat arrays arrow-style][6] | ||
* [Observable: Rich columnar data tables - Dictionary-encoded strings, 64bit ints, and nested structs][8] | ||
* [/js/test/unit](https://github.com/apache/arrow/tree/master/js/test/unit) - Unit tests for Table and Vector | ||
@@ -281,1 +282,2 @@ | ||
[7]: https://arrow.apache.org/docs/js/ | ||
[8]: https://observablehq.com/@lmeyerov/rich-data-types-in-apache-arrow-js-efficient-data-tables-wit |
@@ -581,3 +581,2 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
_this.children = children; | ||
_this.children = children; | ||
return _this; | ||
@@ -584,0 +583,0 @@ } |
@@ -42,3 +42,3 @@ import { ArrayBufferViewInput } from './buffer'; | ||
* Down-convert the bytes to a 53-bit precision integer. Invoked by JS for | ||
* arithmatic operators, like `+`. Easy (and unsafe) way to convert BN to | ||
* arithmetic operators, like `+`. Easy (and unsafe) way to convert BN to | ||
* number via `+bn_inst` | ||
@@ -45,0 +45,0 @@ */ |
@@ -87,7 +87,7 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
function createArrayLikeComparator(lhs) { | ||
var comparitors = []; | ||
var comparators = []; | ||
for (var i = -1, n = lhs.length; ++i < n;) { | ||
comparitors[i] = createElementComparator(lhs[i]); | ||
comparators[i] = createElementComparator(lhs[i]); | ||
} | ||
return createSubElementsComparator(comparitors); | ||
return createSubElementsComparator(comparators); | ||
} | ||
@@ -97,13 +97,13 @@ /** @ignore */ | ||
var i = -1; | ||
var comparitors = []; | ||
lhs.forEach(function (v) { return comparitors[++i] = createElementComparator(v); }); | ||
return createSubElementsComparator(comparitors); | ||
var comparators = []; | ||
lhs.forEach(function (v) { return comparators[++i] = createElementComparator(v); }); | ||
return createSubElementsComparator(comparators); | ||
} | ||
/** @ignore */ | ||
function createVectorComparator(lhs) { | ||
var comparitors = []; | ||
var comparators = []; | ||
for (var i = -1, n = lhs.length; ++i < n;) { | ||
comparitors[i] = createElementComparator(lhs.get(i)); | ||
comparators[i] = createElementComparator(lhs.get(i)); | ||
} | ||
return createSubElementsComparator(comparitors); | ||
return createSubElementsComparator(comparators); | ||
} | ||
@@ -117,9 +117,9 @@ /** @ignore */ | ||
} | ||
var comparitors = []; | ||
var comparators = []; | ||
for (var i = -1, n = keys.length; ++i < n;) { | ||
comparitors[i] = createElementComparator(lhs[keys[i]]); | ||
comparators[i] = createElementComparator(lhs[keys[i]]); | ||
} | ||
return createSubElementsComparator(comparitors, keys); | ||
return createSubElementsComparator(comparators, keys); | ||
} | ||
function createSubElementsComparator(comparitors, keys) { | ||
function createSubElementsComparator(comparators, keys) { | ||
return function (rhs) { | ||
@@ -130,16 +130,16 @@ if (!rhs || typeof rhs !== 'object') { | ||
switch (rhs.constructor) { | ||
case Array: return compareArray(comparitors, rhs); | ||
case Array: return compareArray(comparators, rhs); | ||
case Map: | ||
case MapRow: | ||
case StructRow: | ||
return compareObject(comparitors, rhs, rhs.keys()); | ||
return compareObject(comparators, rhs, rhs.keys()); | ||
case Object: | ||
case undefined: // support `Object.create(null)` objects | ||
return compareObject(comparitors, rhs, keys || Object.keys(rhs)); | ||
return compareObject(comparators, rhs, keys || Object.keys(rhs)); | ||
} | ||
return rhs instanceof Vector ? compareVector(comparitors, rhs) : false; | ||
return rhs instanceof Vector ? compareVector(comparators, rhs) : false; | ||
}; | ||
} | ||
function compareArray(comparitors, arr) { | ||
var n = comparitors.length; | ||
function compareArray(comparators, arr) { | ||
var n = comparators.length; | ||
if (arr.length !== n) { | ||
@@ -149,3 +149,3 @@ return false; | ||
for (var i = -1; ++i < n;) { | ||
if (!(comparitors[i](arr[i]))) { | ||
if (!(comparators[i](arr[i]))) { | ||
return false; | ||
@@ -156,4 +156,4 @@ } | ||
} | ||
function compareVector(comparitors, vec) { | ||
var n = comparitors.length; | ||
function compareVector(comparators, vec) { | ||
var n = comparators.length; | ||
if (vec.length !== n) { | ||
@@ -163,3 +163,3 @@ return false; | ||
for (var i = -1; ++i < n;) { | ||
if (!(comparitors[i](vec.get(i)))) { | ||
if (!(comparators[i](vec.get(i)))) { | ||
return false; | ||
@@ -170,3 +170,3 @@ } | ||
} | ||
function compareObject(comparitors, obj, keys) { | ||
function compareObject(comparators, obj, keys) { | ||
var lKeyItr = keys[Symbol.iterator](); | ||
@@ -176,3 +176,3 @@ var rKeyItr = obj instanceof Map ? obj.keys() : Object.keys(obj)[Symbol.iterator](); | ||
var i = 0; | ||
var n = comparitors.length; | ||
var n = comparators.length; | ||
var rVal = rValItr.next(); | ||
@@ -182,3 +182,3 @@ var lKey = lKeyItr.next(); | ||
for (; i < n && !lKey.done && !rKey.done && !rVal.done; ++i, lKey = lKeyItr.next(), rKey = rKeyItr.next(), rVal = rValItr.next()) { | ||
if (lKey.value !== rKey.value || !comparitors[i](rVal.value)) { | ||
if (lKey.value !== rKey.value || !comparators[i](rVal.value)) { | ||
break; | ||
@@ -185,0 +185,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2800487
27408
282