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).
12 lines (11 loc) • 402 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const flatMap_1 = require("../flatMap");
const of_1 = require("../of");
const toArray_1 = require("../toArray");
test("flatMap", async () => {
const result = await toArray_1.toArray(flatMap_1.flatMap(async function* (value) {
yield value * 2;
})(of_1.of(1, 2, 3)));
expect(result).toEqual([2, 4, 6]);
});