Sha256: 14cfd8bbe35fcd3bdb3eef2eb0572c019a8f8900402c2209ef2ee9ec81e56eb3
Contents?: true
Size: 633 Bytes
Versions: 5
Compression:
Stored size: 633 Bytes
Contents
"use strict"; var merge = require("./merge") var map = require("./map") function expand(source, f) { /** Takes `source` sequence maps each item via `f` to a new sequence and then flattens them down into single form sequence. Note that returned sequence will have items ordered by time and not by index, if you wish opposite you need to force sequential order by wrapping `source` into `sequential` before passing it. ## Example var sequence = expand([ 1, 2, 3 ], function(x) { return [ x, x * x ] }) print(sequence) // => < 1 1 2 4 3 9 > **/ return merge(map(source, f)) } module.exports = expand
Version data entries
5 entries across 2 versions & 1 rubygems