Skip to content

Commit 2e118ab

Browse files
author
Brian Hulette
committed
linter
1 parent a788db3 commit 2e118ab

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

js/src/Arrow.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ export {
8787
FixedSizeListVector,
8888
};
8989

90-
91-
9290
/* These exports are needed for the closure umd targets */
9391
try {
9492
const Arrow = eval('exports');

js/src/predicate.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import { Vector } from "./vector/vector";
2-
import { DictionaryVector } from "./vector/dictionary";
1+
import { Vector } from './vector/vector';
2+
import { DictionaryVector } from './vector/dictionary';
33

44
export type ValueFunc<T> = (idx: number, cols: Vector[]) => T|null;
55
export type PredicateFunc = (idx: number, cols: Vector[]) => boolean;
66

77
export abstract class Value<T> {
88
eq(other: Value<T>|T): Predicate {
9-
if (!(other instanceof Value)) other = new Literal(other);
9+
if (!(other instanceof Value)) { other = new Literal(other); }
1010
return new Equals(this, other);
1111
}
1212
lteq(other: Value<T>|T): Predicate {
13-
if (!(other instanceof Value)) other = new Literal(other);
13+
if (!(other instanceof Value)) { other = new Literal(other); }
1414
return new LTeq(this, other);
1515
}
1616
gteq(other: Value<T>|T): Predicate {
17-
if (!(other instanceof Value)) other = new Literal(other);
17+
if (!(other instanceof Value)) { other = new Literal(other); }
1818
return new GTeq(this, other);
1919
}
2020
}
2121

22-
class Literal<T=any> extends Value<T> {
22+
class Literal<T= any> extends Value<T> {
2323
constructor(public v: T) { super(); }
2424
}
2525

26-
class Col<T=any> extends Value<T> {
26+
class Col<T= any> extends Value<T> {
2727
vector: Vector<T>;
2828
colidx: number;
2929

@@ -39,9 +39,9 @@ class Col<T=any> extends Value<T> {
3939
break;
4040
}
4141
}
42-
if (this.colidx < 0) throw new Error(`Failed to bind Col "${this.name}"`)
42+
if (this.colidx < 0) { throw new Error(`Failed to bind Col "${this.name}"`); }
4343
}
44-
this.vector = cols[this.colidx]
44+
this.vector = cols[this.colidx];
4545
return this.vector.get.bind(this.vector);
4646
}
4747

@@ -55,7 +55,7 @@ export abstract class Predicate {
5555
ands(): Predicate[] { return [this]; }
5656
}
5757

58-
abstract class ComparisonPredicate<T=any> extends Predicate {
58+
abstract class ComparisonPredicate<T= any> extends Predicate {
5959
constructor(public readonly left: Value<T>, public readonly right: Value<T>) {
6060
super();
6161
}
@@ -94,7 +94,7 @@ class And extends CombinationPredicate {
9494
const right = this.right.bind(cols);
9595
return (idx: number, cols: Vector[]) => left(idx, cols) && right(idx, cols);
9696
}
97-
ands() : Predicate[] { return this.left.ands().concat(this.right.ands()); }
97+
ands(): Predicate[] { return this.left.ands().concat(this.right.ands()); }
9898
}
9999

100100
class Or extends CombinationPredicate {
@@ -121,7 +121,7 @@ class Equals extends ComparisonPredicate {
121121
const col_func = col.bind(cols);
122122
if (col.vector instanceof DictionaryVector) {
123123
// Assume that there is only one key with the value `lit.v`
124-
let key = -1
124+
let key = -1;
125125
for (; ++key < col.vector.data.length;) {
126126
if (col.vector.data.get(key) === lit.v) {
127127
break;
@@ -138,7 +138,7 @@ class Equals extends ComparisonPredicate {
138138
} else {
139139
return (idx: number) => {
140140
return (col.vector as DictionaryVector<any>).getKey(idx) === key;
141-
}
141+
};
142142
}
143143
} else {
144144
return (idx: number, cols: Vector[]) => col_func(idx, cols) == lit.v;

js/src/table.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ export class Table implements DataFrame {
8686
}
8787
get(idx: number): TableRow {
8888
let batch = 0;
89-
while (idx > this.lengths[batch] && batch < this.lengths.length)
89+
while (idx > this.lengths[batch] && batch < this.lengths.length) {
9090
idx -= this.lengths[batch++];
91+
}
9192

92-
if (batch === this.lengths.length) throw new Error("Overflow")
93+
if (batch === this.lengths.length) { throw new Error('Overflow'); }
9394

94-
else return new TableRow(this.batches[batch], idx);
95+
return new TableRow(this.batches[batch], idx);
9596
}
9697
filter(predicate: Predicate): DataFrame {
9798
return new FilteredDataFrame(this, predicate);
@@ -105,7 +106,7 @@ export class Table implements DataFrame {
105106

106107
// yield all indices
107108
for (let idx = -1; ++idx < length;) {
108-
next(idx, columns)
109+
next(idx, columns);
109110
}
110111
}
111112
}
@@ -149,7 +150,7 @@ class FilteredDataFrame implements DataFrame {
149150

150151
// yield all indices
151152
for (let idx = -1; ++idx < length;) {
152-
if (predicate(idx, columns)) next(idx, columns);
153+
if (predicate(idx, columns)) { next(idx, columns); }
153154
}
154155
}
155156
}
@@ -171,7 +172,7 @@ class FilteredDataFrame implements DataFrame {
171172

172173
// yield all indices
173174
for (let idx = -1; ++idx < length;) {
174-
if (predicate(idx, columns)) ++sum;
175+
if (predicate(idx, columns)) { ++sum; }
175176
}
176177
}
177178
return sum;

0 commit comments

Comments
 (0)