@visisoft/staticland
Advanced tools
Comparing version 0.1.3 to 0.1.4
Changelog | ||
========= | ||
0.1.4 | ||
----- | ||
- Adds transformation `maybeOfPromiseToPromiseOfMaybe` | ||
0.1.2 | ||
@@ -4,0 +8,0 @@ ----- |
@@ -382,3 +382,6 @@ 'use strict'; | ||
// key = String | ||
maybeToObj = semmelRamda.curry((keyName, ma) => maybe(semmelRamda.always({}), semmelRamda.objOf(keyName), ma)); | ||
maybeToObj = semmelRamda.curry((keyName, ma) => maybe(semmelRamda.always({}), semmelRamda.objOf(keyName), ma)), | ||
// maybeOfPromiseToPromiseOfMaybe :: Maybe Promise e a -> Promise e Maybe a | ||
maybeOfPromiseToPromiseOfMaybe = maybe(semmelRamda.compose(of, nothing), map(of$1)); | ||
@@ -389,3 +392,4 @@ var transformations = /*#__PURE__*/Object.freeze({ | ||
maybeToPromise: maybeToPromise, | ||
maybeToObj: maybeToObj | ||
maybeToObj: maybeToObj, | ||
maybeOfPromiseToPromiseOfMaybe: maybeOfPromiseToPromiseOfMaybe | ||
}); | ||
@@ -392,0 +396,0 @@ |
@@ -57,3 +57,3 @@ { | ||
"type": "module", | ||
"version": "0.1.3" | ||
"version": "0.1.4" | ||
} |
export type Maybe<T> = T[]; | ||
export type Maybe<T> = [T]; | ||
export function just<T>(x: T): Maybe<T>; | ||
@@ -4,0 +4,0 @@ export function of<T>(x: T): Maybe<T>; |
@@ -9,5 +9,5 @@ /** | ||
import { either } from './either.js'; | ||
import { reject, of as of_p } from './promise.js'; | ||
import { maybe } from './maybe.js'; | ||
import { always, curry, objOf, thunkify } from 'semmel-ramda'; | ||
import { map as map_p, reject, of as of_p } from './promise.js'; | ||
import { maybe, nothing, of as of_mb } from './maybe.js'; | ||
import { always, compose, curry, objOf, thunkify } from 'semmel-ramda'; | ||
@@ -23,3 +23,6 @@ const | ||
// key = String | ||
maybeToObj = curry((keyName, ma) => maybe(always({}), objOf(keyName), ma)); | ||
maybeToObj = curry((keyName, ma) => maybe(always({}), objOf(keyName), ma)), | ||
// maybeOfPromiseToPromiseOfMaybe :: Maybe Promise e a -> Promise e Maybe a | ||
maybeOfPromiseToPromiseOfMaybe = maybe(compose(of_p, nothing), map_p(of_mb)); | ||
@@ -29,3 +32,4 @@ export { | ||
maybeToPromise, | ||
maybeToObj | ||
maybeToObj, | ||
maybeOfPromiseToPromiseOfMaybe | ||
}; |
39838
638