Transforms: allow boolean in field calculations (#30802)
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user