strom/samples/flatMap.js
2018-12-03 00:38:17 -05:00

7 lines
175 B
JavaScript

const Mhysa = require("mhysa");
Mhysa.fromArray(["a", "AA"])
.pipe(Mhysa.flatMap(s => new Array(s.length).fill(s)))
.pipe(Mhysa.join(","))
.pipe(process.stdout);