@visisoft/staticland
Advanced tools
Comparing version 0.1.1 to 0.1.2
Changelog | ||
========= | ||
0.1.2 | ||
----- | ||
- Added transformations | ||
0.1.1 | ||
@@ -4,0 +8,0 @@ ----- |
@@ -56,3 +56,3 @@ { | ||
"type": "module", | ||
"version": "0.1.1" | ||
"version": "0.1.2" | ||
} |
@@ -27,2 +27,3 @@ /** | ||
// fromNilable :: (a|undefined|null) -> Maybe a | ||
fromNilable = ifElse(isNil, nothing, of), | ||
@@ -29,0 +30,0 @@ |
@@ -11,3 +11,3 @@ /** | ||
import { maybe } from './maybe.js'; | ||
import { curry, thunkify } from 'semmel-ramda'; | ||
import { always, curry, objOf, thunkify } from 'semmel-ramda'; | ||
@@ -19,7 +19,12 @@ const | ||
// maybeToPromise :: e -> Maybe a -> Promise e a | ||
maybeToPromise = curry((e, ma) => maybe(thunkify(reject)(e), of_p, ma)); | ||
maybeToPromise = curry((e, ma) => maybe(thunkify(reject)(e), of_p, ma)), | ||
// maybeToObj :: key -> Maybe a -> ({}|{key: a}) | ||
// key = String | ||
maybeToObj = curry((keyName, ma) => maybe(always({}), objOf(keyName), ma)); | ||
export { | ||
eitherToPromise, | ||
maybeToPromise | ||
maybeToPromise, | ||
maybeToObj | ||
}; |
37633
599