Passed
Pull Request — master (#159)
by Mathieu
01:47
created

ArrayUtils   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A range 0 10 3
1
export class ArrayUtils {
2
  public static range(start: number, end: number, step: number = 1) {
3
    function* generateRange() {
4
      let x = start - step;
5
      while(x <= end - step) {
6
        yield x += step;
7
      }
8
    }
9
10
    return {
11
      [Symbol.iterator]: generateRange
12
    };
13
  }
14
}
15