aboutsummaryrefslogtreecommitdiff
path: root/src/content/operators/impls/RepeatOperator.ts
blob: efe2fafe2cff7760efcccec291228d10b21fcb9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import Operator from "../Operator";

export default class RepeatOperator implements Operator {
  constructor(
    private readonly operator: Operator,
    private readonly repeat: number
  ) {}

  async run(): Promise<void> {
    for (let i = 0; i < this.repeat; ++i) {
      this.operator.run();
    }
  }
}