JSPM

iterable-transform-replace

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3036
  • Score
    100M100P100Q121910F
  • License MIT

An iterable transform that apply replace to all items

Package Exports

  • iterable-transform-replace

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iterable-transform-replace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

iterable-transform-replace

Greenkeeper badge

An iterable transform that apply replace to all items

Usage

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]

Travis Build Status NPM downloads

API

const iterableTransformReplace = (oldItem: any, newItem: any, source: Iterable): Iterable

Given an iterable source object, return another iterable with all items equal to oldItem replaced with newItem.

Install

With npm installed, run

$ npm install iterable-transform-replace

See Also

License

MIT