https://github.com/mikemitterer/ts-tools
https://github.com/mikemitterer/ts-tools
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mikemitterer/ts-tools
- Owner: MikeMitterer
- License: other
- Created: 2020-07-21T09:11:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-02T03:16:32.000Z (almost 2 years ago)
- Last Synced: 2025-07-16T06:44:43.857Z (about 1 year ago)
- Language: JavaScript
- Size: 2.16 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Various TS-Tools
> [Live-Example]() | [GitHub-Home](https://github.com/MikeMitterer/ts-tools)
Noting spectacular here...
### range
```typescript
test('Number of iterations', () => {
let iterations = 0;
range(0, 10).forEach(() => iterations++);
expect(iterations).toBe(11);
});
```
### loop
```typescript
test('loop with values', () => {
let iterations = 0;
let sum = 0;
loop(1, 3).through((value: number) => {
sum += value;
iterations++;
});
expect(iterations).toBe(3);
expect(sum).toBe(6);
iterations = 0;
sum = 0;
loop(3, 1).through((value: number) => {
sum += value;
iterations++;
});
expect(iterations).toBe(3);
expect(sum).toBe(6);
});
```