Skip to content

Commit

Permalink
fix typings issues (ARROW-1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jan 11, 2018
1 parent b49e8f3 commit 74e828a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
4 changes: 0 additions & 4 deletions js/src/text-encoding-utf-8.d.ts

This file was deleted.

7 changes: 4 additions & 3 deletions js/src/vector/numeric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export class NumericVector<T, TArray extends TypedArray> extends Vector<T> {
concat(...vectors: Vector<T>[]): Vector<T> {
return new VirtualVector(this.data.constructor as TypedArrayConstructor, this, ...vectors);
}
slice(start?: number, end?: number) {
slice<R = TArray>(start?: number, end?: number): R {
const { data, stride } = this, from = start! | 0;
const to = end === undefined ? data.length : Math.max(end | 0, from);
return data.subarray(Math.min(from, to) * stride | 0, to * stride | 0);
return data.subarray(Math.min(from, to) * stride | 0, to * stride | 0) as any as R;
}
}

Expand All @@ -49,7 +49,8 @@ export class FixedWidthNumericVector<T, TArray extends TypedArray> extends Numer

export class BoolVector extends NumericVector<boolean, Uint8Array> {
static pack(values: Iterable<any>) {
let xs = [], n, i = 0;
let n = 0, i = 0;
let xs: number[] = [];
let bit = 0, byte = 0;
for (const value of values) {
value && (byte |= 1 << bit);
Expand Down
2 changes: 1 addition & 1 deletion js/src/vector/virtual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class VirtualVector<T> implements Vector<T> {
// this is a significant improvement as we avoid the memcpy 🎉
if ((source.length / vector.stride | 0) < total) {
let vectorsLength = vectors.length;
let count = 0, length = 0, sources = [];
let count = 0, length = 0, sources = [] as any[];
do {
sources.push(source);
length += source.length;
Expand Down
2 changes: 1 addition & 1 deletion js/test/Arrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.

/* tslint:disable */
// Dynamically load an Ix target build based on command line arguments
// Dynamically load an Arrow target build based on command line arguments

const path = require('path');
const target = process.env.TEST_TARGET!;
Expand Down
2 changes: 1 addition & 1 deletion js/test/integration/validate-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const arrowBuffers: Uint8Array[] = [fs.readFileSync(arrowPath)];

import Arrow from '../Arrow';
import { zip } from 'ix/iterable/zip';
import { toArray } from 'ix/iterable/toArray';
import { toArray } from 'ix/iterable/toarray';

const { Table, read } = Arrow;

Expand Down

0 comments on commit 74e828a

Please sign in to comment.