(Because we definitely don't have enough declarative, general-purpose modules.)
(I published it just to familiarize myself with NPM and I don't know how to un-publish it.)
No More Hats is a general-purpose JavaScript library.
None of this has actually been implemented because I'm a lazy functional programmer.
const {safeGet} = require('no-more-hats')
const safeFirstLength = xs => safeGet(xs, 0, 'length')
console.log(safeFirstLength([1, 2, 3])) // Nothing
console.log(safeFirstLength([[1, 2, 3], 4, 5])) // Just(3)
- Efficiently perform common operations like cloning
- Easily handle errors without messiness like
try
/catch
If you have npm
, it's as simple as one command:
npm install no-more-hats -g
- Issue Tracker: https://github.com/1point7point4/no-more-hats/issues
- Source Code: https://github.com/1point7point4/no-more-hats
The project is licensed under the MIT license.