Comparing version 0.0.5 to 0.0.6
@@ -6,2 +6,3 @@ import type { Maybe } from "../@types/easy-maybe/maybe.d"; | ||
combine2: <A_2, B_1>(m: [Maybe<A_2>, Maybe<B_1>]) => Maybe<[A_2, B_1]>; | ||
combine3: <A_3, B_2, C>(m: [Maybe<A_3>, Maybe<B_2>, Maybe<C>]) => Maybe<[A_3, B_2, C]>; | ||
fork: <T>(m: Maybe<T>) => T | undefined; | ||
@@ -8,0 +9,0 @@ forkJust: <T_1>(m: Maybe<T_1>) => T_1; |
@@ -66,2 +66,12 @@ "use strict"; | ||
}; | ||
const combine3 = (m) => { | ||
const list = [undefined, undefined, undefined]; | ||
const [a, b, c] = m; | ||
if (isNothing(a) || isNothing(b) || isNothing(c)) | ||
return (0, common_1.NothingImpl)(); | ||
list[0] = maybe_1.default.consume(common_1.plunge, a); | ||
list[1] = maybe_1.default.consume(common_1.plunge, b); | ||
list[2] = maybe_1.default.consume(common_1.plunge, c); | ||
return (0, common_1.JustImpl)(list); | ||
}; | ||
exports.Extra = { | ||
@@ -71,2 +81,3 @@ as, | ||
combine2, | ||
combine3, | ||
fork, | ||
@@ -73,0 +84,0 @@ forkJust, |
{ | ||
"name": "easy-maybe", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.ts", |
@@ -70,2 +70,15 @@ import type { Maybe } from "../@types/easy-maybe/maybe.d"; | ||
const combine3 = <A, B, C>(m: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<[A, B, C]> => { | ||
const list: [any, any, any] = [undefined, undefined, undefined]; | ||
const [a, b, c] = m; | ||
if (isNothing(a) || isNothing(b) || isNothing(c)) return NothingImpl(); | ||
list[0] = MaybeImpl.consume(plunge, a); | ||
list[1] = MaybeImpl.consume(plunge, b); | ||
list[2] = MaybeImpl.consume(plunge, c); | ||
return JustImpl<[A, B, C]>(list); | ||
}; | ||
export const Extra = { | ||
@@ -75,2 +88,3 @@ as, | ||
combine2, | ||
combine3, | ||
fork, | ||
@@ -77,0 +91,0 @@ forkJust, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29339
508