package
An iterable transform that apply replace to all items
npm install iterable-transform-replaceGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
An iterable transform that apply replace to all items
This example replace response with 42:
const replace = require('iterable-transform-replace');
const source = [1, 2, 'response', 3];
console.log(Array.from(replace('response', 42, source)));This will output
[1, 2, 42, 3]const iterableTransformReplace = (oldItem: any, newItem: any, source: Iterable): IterableGiven an iterable source object, return another iterable with all items equal
to oldItem replaced with newItem.
With npm installed, run
$ npm install iterable-transform-replaceMIT