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
44export type ValueFunc < T > = ( idx : number , cols : Vector [ ] ) => T | null ;
55export type PredicateFunc = ( idx : number , cols : Vector [ ] ) => boolean ;
66
77export 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
100100class 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 ;
0 commit comments