tiny-fns
A microscopic zero-dep library of immutable helper functions that probably didn't need to be written.
usage
npm install tiny-fns
docs
chunk
(try it)
Splits an array into multiple arrays of specified length.
// -> [['a', 'b'], ['c', 'd'], ['e']]
flatten
(try it)
Flattens an array one level deep.
// -> ['a', 'b', 'c', 'd', ['e']]
fromPairs
(try it)
Creates an object from an array of key/value pair arrays.
// -> { a: 1, b: 2, c: 3 }
mapKeys
(try it)
Creates a new object by mapping keys of an existing object.
// -> { aa: 1, bb: 2, cc: 3 }