import { Limiter } from '../limiter'; import { applyOperators, Operator } from '../operator'; import { Scope } from '../scope'; export class WhereScope extends Scope { constructor(limiter: Limiter, operators: Operator[]) { super('where', limiter, operators); } action(items: T[]): T[] { return applyOperators(items, this.operators, this.limiter); } } export function where(limiter: Limiter, ...operators: Operator[]) { return new WhereScope(limiter, operators); }