@mmit/tools
TypeScript icon, indicating that this package has built-in type declarations

0.1.11 • Public • Published

Various TS-Tools

Live-Example | GitHub-Home

Noting spectacular here...

range

    test('Number of iterations', () => {
        let iterations = 0;
        range(0, 10).forEach(() => iterations++);

        expect(iterations).toBe(11);
    });

loop

    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);
    });

Readme

Keywords

Package Sidebar

Install

npm i @mmit/tools

Weekly Downloads

1

Version

0.1.11

License

MIT

Unpacked Size

1.3 MB

Total Files

42

Last publish

Collaborators

  • mmit