Transforms: allow boolean in field calculations (#30802)

This commit is contained in:
Ryan McKinley
2021-02-02 12:41:58 -08:00
committed by GitHub
parent 25ef563a53
commit c9c7bfbcaa
5 changed files with 62 additions and 3 deletions
@@ -0,0 +1,16 @@
import { Vector } from '../types';
import { FunctionalVector } from './FunctionalVector';
export class AsNumberVector extends FunctionalVector<number> {
constructor(private field: Vector) {
super();
}
get length() {
return this.field.length;
}
get(index: number) {
return +this.field.get(index);
}
}
@@ -6,5 +6,6 @@ export * from './BinaryOperationVector';
export * from './SortedVector';
export * from './FormattedVector';
export * from './IndexVector';
export * from './AsNumberVector';
export { vectorator } from './FunctionalVector';