1.0.1 • Published 6 years ago
map-where v1.0.1
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]