Tiny functional programming suite for JavaScript.
getEq
has been deprecated. Use matches
or where
for similar functionality.pair
has been deprecated.lens
has been deprecated.lensProp
has been deprecated.set
has been deprecated. Use assocIn
for similar functionality.over
has been deprecated. Use updateIn
for similar functionality.view
has been deprecated. Use getIn
for similar functionality.mean
no longer throws if the list is empty, returns 0
instead.rangeBy
no longer throws for bad ranges, returns an empty list instead.transform
no longer throws for invalid transforms, the original value is passed through.Ignore, for NPM only.
gt
, use >
inline instead.gte
, use >=
inline instead.lt
, use <
inline instead.lte
, use <=
inline instead.flip
, use arrow functions instead.fmap
.of
.difference
.interpose
.invert
.compose
now has a correct toString
representation.pipe
now has a correct toString
representation.get
no longer throws when the target is nil, now returns undefined.getIn
no longer throws when the target is nil, now returns undefined.rangeBy
now returns an empty array when start === end.compose
no longer performs runtime type checking.pipe
no longer performs runtime type checking.equals
.path
will be deprecated in future releases.prop
will be deprecated in future releases.propEq
will be deprecated in future releases.isEmpty
now returns true for falsy values.update
.updateIn
.path
to getIn
.prop
to get
.propEq
to getEq
.mapValues
has been deprecated because map
now supports objects. Replace
usage of mapValues
with map
.identical
now implements SameValueZero semantics. The only breaking change here is that NaN
is now treated as identical to NaN
.intersection
.match
.pad
.padLeft
.padRight
.unique
.map
now supports plain objects.identical
now implements SameValueZero semantics. This affects any function, such as equals
, that performs identity checks.arity
function no longer preserves this
context. This should not affect the public API, but always be sure that you are not implicitly relying on this
when working with redash.clamp
.groupBy
.takeUntil
.trace
.transform
.flatMap
alias for chain
.concat
now dispatches to the first argument's concat
method.concat
now supports strings.curry
now supplies all arguments to the wrapped function. This improves support for functions that do not properly report their arities.filter
now works for objects.reject
now works for objects.pipe
and compose
are now unary and require the functions to be wrapped in an array.pipe(fn1, fn2, fn3) // old
pipe([fn1, fn2, fn3]) // new
compose(fn3, fn2, fn1) // old
compose([fn3, fn2, fn1]) // new
Beside making the signature for these functions more sane and in line with the rest of the redash API, this change has an added benefit for fans of the trailing comma:
// Error!
pipe(
fn1,
fn2,
fn3,
)
// OK!
pipe([
fn1,
fn2,
fn3,
])
init
.path
.replace
.contains
now supports strings.pipe
and compose
are now both unary.