@bitty/either
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -25,2 +25,3 @@ /** | ||
_kind: 'Left', | ||
alt: function (fn) { return fn(); }, | ||
map: function () { return Left(value); }, | ||
@@ -63,2 +64,3 @@ then: function () { return Left(value); }, | ||
_kind: 'Right', | ||
alt: function () { return Right(value); }, | ||
map: function (fn) { return Right(fn(value)); }, | ||
@@ -65,0 +67,0 @@ then: function (fn) { |
@@ -29,2 +29,3 @@ 'use strict'; | ||
_kind: 'Left', | ||
alt: function (fn) { return fn(); }, | ||
map: function () { return Left(value); }, | ||
@@ -67,2 +68,3 @@ then: function () { return Left(value); }, | ||
_kind: 'Right', | ||
alt: function () { return Right(value); }, | ||
map: function (fn) { return Right(fn(value)); }, | ||
@@ -69,0 +71,0 @@ then: function (fn) { |
@@ -31,2 +31,3 @@ (function (global, factory) { | ||
_kind: 'Left', | ||
alt: function (fn) { return fn(); }, | ||
map: function () { return Left(value); }, | ||
@@ -69,2 +70,3 @@ then: function () { return Left(value); }, | ||
_kind: 'Right', | ||
alt: function () { return Right(value); }, | ||
map: function (fn) { return Right(fn(value)); }, | ||
@@ -71,0 +73,0 @@ then: function (fn) { |
@@ -1,2 +0,2 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).Either={})}(this,(function(n){"use strict";function t(n){return{_kind:"Left",map:function(){return t(n)},then:function(){return t(n)},chain:function(){return t(n)},mapLeft:function(r){return t(r(n))},isLeft:function(){return!0},isRight:function(){return!1},match:function(t){return(0,t.left)(n)},fold:function(t){return t(n)},getOrElse:function(t){return t(n)},orElse:function(t){return t(n)},unwrap:function(){return n}}}function r(n){return{_kind:"Right",map:function(t){return r(t(n))},then:function(t){var u=t(n);return function(n){var t,r;return"Left"===(null===(t=n)||void 0===t?void 0:t._kind)||"Right"===(null===(r=n)||void 0===r?void 0:r._kind)}(u)?u:r(u)},chain:function(t){return t(n)},mapLeft:function(){return r(n)},isLeft:function(){return!1},isRight:function(){return!0},match:function(t){return(0,t.right)(n)},fold:function(t,r){return r(n)},getOrElse:function(){return n},orElse:function(){return r(n)},unwrap:function(){return n}}}n.Left=t,n.Right=r,n.fromFalsy=function(n){return function(u){return function(n){return!n}(u)?t(n):r(u)}},n.fromNullish=function(n){return function(u){return function(n){return null==n}(u)?t(n):r(u)}},n.fromPredicate=function(n,u){return function(e){return n(e)?r(e):t(u(e))}},n.tryCatch=function(n,u){try{return r(n())}catch(n){return t(u(n))}},Object.defineProperty(n,"__esModule",{value:!0})})); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).Either={})}(this,(function(n){"use strict";function t(n){return{_kind:"Left",alt:function(n){return n()},map:function(){return t(n)},then:function(){return t(n)},chain:function(){return t(n)},mapLeft:function(r){return t(r(n))},isLeft:function(){return!0},isRight:function(){return!1},match:function(t){return(0,t.left)(n)},fold:function(t){return t(n)},getOrElse:function(t){return t(n)},orElse:function(t){return t(n)},unwrap:function(){return n}}}function r(n){return{_kind:"Right",alt:function(){return r(n)},map:function(t){return r(t(n))},then:function(t){var u=t(n);return function(n){var t,r;return"Left"===(null===(t=n)||void 0===t?void 0:t._kind)||"Right"===(null===(r=n)||void 0===r?void 0:r._kind)}(u)?u:r(u)},chain:function(t){return t(n)},mapLeft:function(){return r(n)},isLeft:function(){return!1},isRight:function(){return!0},match:function(t){return(0,t.right)(n)},fold:function(t,r){return r(n)},getOrElse:function(){return n},orElse:function(){return r(n)},unwrap:function(){return n}}}n.Left=t,n.Right=r,n.fromFalsy=function(n){return function(u){return function(n){return!n}(u)?t(n):r(u)}},n.fromNullish=function(n){return function(u){return function(n){return null==n}(u)?t(n):r(u)}},n.fromPredicate=function(n,u){return function(e){return n(e)?r(e):t(u(e))}},n.tryCatch=function(n,u){try{return r(n())}catch(n){return t(u(n))}},Object.defineProperty(n,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=Either.umd.min.js.map |
{ | ||
"name": "@bitty/either", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Either monad implementation.", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -9,2 +9,3 @@ import type Left from './Left.js'; | ||
export interface EitherMethods<L, R> { | ||
alt(fn: () => Either<L, R>): Either<L, R>; | ||
map<R2>(fn: (value: R) => R2): Either<L, R2>; | ||
@@ -11,0 +12,0 @@ then<R2>(fn: (value: R) => R2 | Either<L, R2>): Either<L, R2>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
69567
574