/* 1.*/ {
/* 2.*/ "version": 3,
/* 3.*/ "file": "out.js",
/* 4.*/ "sourceRoot": "",
/* 5.*/ "sources": ["foo.js", "bar.ts"],
/* 6.*/ "sourcesContent": [null, null],
/* 7.*/ "names": ["src", "maps", "are", "fun"],
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EventEmitter = require('events').EventEmitter; | |
const fromEventPattern = require('ix/asynciterable/fromeventpattern').fromEventPattern; | |
// Get Async Iterable | |
const e = new EventEmitter(); | |
const ai = fromEventPattern( | |
h => e.addListener('data', h), | |
h => e.removeListener('data', h) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class MapAsyncIterable<T, R> implements AsyncIterable<R> { | |
private _source: Iterable<T | PromiseLike<T>> | AsyncIterable<T>; | |
private _selector: (value: T) => R | PromiseLike<R>; | |
constructor(source: Iterable<T | PromiseLike<T>> | AsyncIterable<T>, selector: (value: T) => R | PromiseLike<R>) { | |
this._source = source; | |
this._selector = selector; | |
} |