v0.11.0 (0.11.1)
Note: Had to release as 0.11.1 because I was a dumb with the beta version
Breaking Changes
factors
output has changed to be inclusive, it also works with negative numbers now- Example:
factors(-36) // => [1, 2, 3, 4, 6, 9, 12, 18, 36]
- You can easily get negative factors with
negate
andmap
- e.g:
map(negate, factors(-36)) // => [-1, -2, -3, -4, -6, -9, -12, -18, -36]
- e.g:
- Example:
isEmpty
will now throw a type error for unsupported typesisEmpty
supports the same types ascount
as well asnull
andundefined
- e.g:
isEmpty(1) // => TypeError: Unsupported type: Number
juxt
functionality changes. It's now a 2 param curried function that takes arrays for data- e.g:
juxt([Math.min, Math.max], [3, 4, 9, -3]) // => [-3, 9]
- Also moved it to be in the array category
- e.g:
ap
re written to be a proper S combinator function- e.g:
ap(x => y => x + y, z => z * 2, 2) // => 6
- e.g:
- Removed
amend
function since it's really just a limitedObject.assign
no real use for it
New
reduce
now supports iterable types likeMap
andSet
- Added
inc
Function which increases a number by 1 - Added
dec
Function which decreases a number by 1 - Added
isZero
Function which checks if the number passed in is equal to the number zero - Added
size
Function which takes a map or set data type and returns its size- Note: It is currently categorized under
Function
which may change in the future as I add more Map|Set friendly functions
- Note: It is currently categorized under
- Added
count
Function which takes any collection based data and counts the values within - Added
reduced
Function which should be used withreduce
orreduceRight
as a short circuit for the function (see improved) has
is now generic forArray
,String
,Object
,Map
, andSet
data types- Added
within
Function which acts likebetween
but is exclusive of the numbers provided
Improved
isEmpty
now supportsMaps
andSets
- Slight increase in
partition
performance - Slight increase in
omit
performance - Added import example onto each function, so it's visible within the examples
factors
had some typos in its docs- Cleaned up
always
documentation - Cleaned up
identity
documentation examples - Cleaned up
type
to be more lightweight - Completely re wrote
reduce
andreduceRight
- No breaking changes
- Both functions now support
reduced
which will short circuit out of the iteration and return the value - This is a good strategy for performance boosts
reduce
,reduceRight
, andreduced
are all using the@@transducer
protocol- Moved
every
,some
,reject
,filter
, andfind
to use this new flow giving them decent performance improvements - Tweaked
height
function for a tiny performance boost