map-where

1.0.1 • Public • Published

This package adds a new function mapWhere which applies a function to all values in an array that pass a predicate function, leaving items that don't pass unmodified. The function is curried.

Type Signature

mapWhere : (a -> a) -> (a -> Boolean) -> [a]

Example

mapWhere(e => e * 2, e => e % 2 === 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

//[1, 4, 3, 8, 5, 12, 7, 16, 9, 20]

Readme

Keywords

none

Package Sidebar

Install

npm i map-where

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

1.1 kB

Total Files

3

Last publish

Collaborators

  • milesman34