node-either-monad
Either monad, good pattern to use when you have a function that may returns totally two different types
install
npm install --save node-either-monad
usage
const either = let left = eitherleft1 // leftlet right = eitherright'data' //right left // trueright // true let dataFolded = left; // 2let dataFolded = right; // data-k let left /// returns right with the same datalet right /// returns left with the same data lefta // data of the left siderightb // data of the right side