(items: T[])
| 843 | } |
| 844 | |
| 845 | static removeDuplicates<T>(items: T[]): T[] { |
| 846 | const ret: T[] = []; |
| 847 | const contains = (arr: unknown[], val: unknown) => !!arr.find(v => equals(val, v)); |
| 848 | |
| 849 | for (const item of items) { |
| 850 | if (!contains(ret, item)) { |
| 851 | ret.push(item); |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | return ret; |
| 856 | } |
| 857 | |
| 858 | static randomInt(min: number, max: number): number { |
| 859 | return Math.round(Math.random() * (max - min)) + min; |
no test coverage detected