UNPKG

axax

Version:

A library of async iterator extensions for JavaScript including ```map```, ```reduce```, ```filter```, ```flatMap```, ```pipe``` and [more](https://github.com/jamiemccrindle/axax/blob/master/docs/API.md#functions).

14 lines (13 loc) 533 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const first_1 = require("../first"); const of_1 = require("../of"); const toArray_1 = require("../toArray"); test("first", async () => { const result = await toArray_1.toArray(first_1.first()(of_1.of(1, 2, 3, 4, 5, 6))); expect(result).toEqual([1]); }); test("first with predicate", async () => { const result = await toArray_1.toArray(first_1.first((value) => value % 5 === 0)(of_1.of(1, 2, 3, 4, 5, 6))); expect(result).toEqual([5]); });