@apache-arrow/esnext-esm
Advanced tools
Comparing version 0.15.1 to 0.16.0
@@ -125,12 +125,13 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
const 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); | ||
} | ||
const predicate = this._predicate.bind(batch); | ||
let isBound = false; | ||
// yield all indices | ||
for (let 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); | ||
@@ -147,12 +148,13 @@ } | ||
const 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); | ||
} | ||
const predicate = this._predicate.bind(batch); | ||
let isBound = false; | ||
// yield all indices | ||
for (let 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); | ||
@@ -159,0 +161,0 @@ } |
@@ -120,3 +120,3 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
} | ||
// 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 | ||
@@ -194,3 +194,3 @@ /** @ignore */ | ||
_bindLitCol(batch, lit, col) { | ||
// Equals is comutative | ||
// Equals is commutative | ||
return this._bindColLit(batch, col, lit); | ||
@@ -197,0 +197,0 @@ } |
{ | ||
"version": "0.15.1", | ||
"version": "0.16.0", | ||
"name": "@apache-arrow/esnext-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 |
@@ -345,3 +345,2 @@ // Licensed to the Apache Software Foundation (ASF) under one | ||
this.children = children; | ||
this.children = children; | ||
} | ||
@@ -348,0 +347,0 @@ get typeId() { return Type.Struct; } |
@@ -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) { | ||
const comparitors = []; | ||
const comparators = []; | ||
for (let 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 */ | ||
let i = -1; | ||
const comparitors = []; | ||
lhs.forEach((v) => comparitors[++i] = createElementComparator(v)); | ||
return createSubElementsComparator(comparitors); | ||
const comparators = []; | ||
lhs.forEach((v) => comparators[++i] = createElementComparator(v)); | ||
return createSubElementsComparator(comparators); | ||
} | ||
/** @ignore */ | ||
function createVectorComparator(lhs) { | ||
const comparitors = []; | ||
const comparators = []; | ||
for (let 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 */ | ||
} | ||
const comparitors = []; | ||
const comparators = []; | ||
for (let 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 (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) { | ||
const n = comparitors.length; | ||
function compareArray(comparators, arr) { | ||
const n = comparators.length; | ||
if (arr.length !== n) { | ||
@@ -149,3 +149,3 @@ return false; | ||
for (let i = -1; ++i < n;) { | ||
if (!(comparitors[i](arr[i]))) { | ||
if (!(comparators[i](arr[i]))) { | ||
return false; | ||
@@ -156,4 +156,4 @@ } | ||
} | ||
function compareVector(comparitors, vec) { | ||
const n = comparitors.length; | ||
function compareVector(comparators, vec) { | ||
const n = comparators.length; | ||
if (vec.length !== n) { | ||
@@ -163,3 +163,3 @@ return false; | ||
for (let 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) { | ||
const lKeyItr = keys[Symbol.iterator](); | ||
@@ -176,3 +176,3 @@ const rKeyItr = obj instanceof Map ? obj.keys() : Object.keys(obj)[Symbol.iterator](); | ||
let i = 0; | ||
let n = comparitors.length; | ||
let n = comparators.length; | ||
let rVal = rValItr.next(); | ||
@@ -182,3 +182,3 @@ let 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
2560028
23082
282