lefu
Shit happens.
Always.
In every single line of code.
Handling errors is an hassle in JavaScript, because you do not have multiple catch block for typed errors.
This is a function way to handle try/catch constructs functionally.
Install
# npm npm i lefu # yarn yarn add lefu
Usage
You can use this library as a full try/catch construct
; ; console.logresult // 'Darn! A type error'
you can also try/catch async functions
; ; console.logresult // Promise('Darn! A type error')
You can use this library for executing a function when an error is caught
; try catch error // output:// it is a TypeError
Or you can use it to check if an error is of a certain type
; try catch error try catch error // output:// it is a TypeError
Contributing
Read the contributing guidelines
Licence
Read the licence
💩💩💩