1.0.1 • Published 6 years ago

map-where v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

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]
1.0.1

6 years ago

0.0.1

6 years ago