functype 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3RJPXVXE.js +1 -0
- package/dist/chunk-5DQWEDA3.js +1 -0
- package/dist/chunk-6RUUD24R.mjs +1 -0
- package/dist/chunk-BFK2RZ2Z.js +1 -0
- package/dist/chunk-BNNK42JC.js +1 -0
- package/dist/chunk-BYPZZZTG.js +1 -0
- package/dist/chunk-DFWZ7ANA.mjs +1 -0
- package/dist/chunk-DP5G2LT6.mjs +1 -0
- package/dist/{chunk-SSP26X5Y.js → chunk-FQY6BMNG.js} +1 -1
- package/dist/chunk-LGUIG2RX.mjs +1 -0
- package/dist/chunk-Q4H3PCBH.mjs +0 -0
- package/dist/{chunk-VM6KG6UB.mjs → chunk-RMQF6I4T.mjs} +1 -1
- package/dist/chunk-RRAIFS3D.mjs +1 -0
- package/dist/chunk-SDHW57XQ.js +1 -0
- package/dist/chunk-TAJ6OYCN.mjs +1 -0
- package/dist/chunk-V2J3R5IU.mjs +0 -0
- package/dist/chunk-X52Z6M5P.mjs +1 -0
- package/dist/chunk-XORABVON.js +1 -0
- package/dist/chunk-XVHCBGUW.js +1 -0
- package/dist/chunk-ZTTAUZK3.js +1 -0
- package/dist/collections/index.d.mts +3 -0
- package/dist/collections/index.d.ts +3 -0
- package/dist/collections/index.js +1 -0
- package/dist/collections/index.mjs +0 -0
- package/dist/either/Either.d.mts +3 -0
- package/dist/either/Either.d.ts +3 -0
- package/dist/either/Either.js +1 -0
- package/dist/either/Either.mjs +1 -0
- package/dist/either/index.d.mts +3 -2
- package/dist/either/index.d.ts +3 -2
- package/dist/either/index.js +1 -1
- package/dist/either/index.mjs +1 -1
- package/dist/functor/index.d.mts +17 -0
- package/dist/functor/index.d.ts +17 -0
- package/dist/functor/index.js +1 -0
- package/dist/functor/index.mjs +1 -0
- package/dist/index-3866f956.d.ts +227 -0
- package/dist/index-5f972212.d.ts +227 -0
- package/dist/index.d.mts +3 -212
- package/dist/index.d.ts +3 -212
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/Seq.d.mts +3 -0
- package/dist/iterable/Seq.d.ts +3 -0
- package/dist/iterable/Seq.js +1 -0
- package/dist/iterable/Seq.mjs +1 -0
- package/dist/iterable/index.d.mts +3 -0
- package/dist/iterable/index.d.ts +3 -0
- package/dist/iterable/index.js +1 -0
- package/dist/iterable/index.mjs +1 -0
- package/dist/list/List.d.mts +3 -2
- package/dist/list/List.d.ts +3 -2
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/list/index.d.mts +3 -2
- package/dist/list/index.d.ts +3 -2
- package/dist/list/index.js +1 -1
- package/dist/list/index.mjs +1 -1
- package/dist/map/Map.d.mts +3 -2
- package/dist/map/Map.d.ts +3 -2
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/map/index.d.mts +3 -2
- package/dist/map/index.d.ts +3 -2
- package/dist/map/index.js +1 -1
- package/dist/map/index.mjs +1 -1
- package/dist/option/Option.d.mts +3 -0
- package/dist/option/Option.d.ts +3 -0
- package/dist/option/Option.js +1 -0
- package/dist/option/Option.mjs +1 -0
- package/dist/option/index.d.mts +3 -2
- package/dist/option/index.d.ts +3 -2
- package/dist/option/index.js +1 -1
- package/dist/option/index.mjs +1 -1
- package/dist/set/Set.d.mts +3 -2
- package/dist/set/Set.d.ts +3 -2
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/set/index.d.mts +3 -2
- package/dist/set/index.d.ts +3 -2
- package/dist/set/index.js +1 -1
- package/dist/set/index.mjs +1 -1
- package/dist/try/Try.d.mts +3 -0
- package/dist/try/Try.d.ts +3 -0
- package/dist/try/Try.js +1 -0
- package/dist/try/Try.mjs +1 -0
- package/dist/try/index.d.mts +3 -0
- package/dist/try/index.d.ts +3 -0
- package/dist/try/index.js +1 -0
- package/dist/try/index.mjs +1 -0
- package/dist/tuple/Tuple.d.mts +19 -2
- package/dist/tuple/Tuple.d.ts +19 -2
- package/dist/tuple/Tuple.js +1 -1
- package/dist/tuple/Tuple.mjs +1 -1
- package/dist/tuple/index.d.mts +2 -2
- package/dist/tuple/index.d.ts +2 -2
- package/dist/tuple/index.js +1 -1
- package/dist/tuple/index.mjs +1 -1
- package/dist/util/index.d.mts +8 -0
- package/dist/util/index.d.ts +8 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.mjs +1 -0
- package/dist/util/isIterable.d.mts +3 -0
- package/dist/util/isIterable.d.ts +3 -0
- package/dist/util/isIterable.js +1 -0
- package/dist/util/isIterable.mjs +1 -0
- package/package.json +1 -1
- package/dist/chunk-7VFL33KH.js +0 -1
- package/dist/chunk-7XCWDOMW.js +0 -1
- package/dist/chunk-CZKHN2SM.mjs +0 -1
- package/dist/chunk-PKWOSOD7.mjs +0 -1
- package/dist/chunk-U237FVPP.mjs +0 -1
- package/dist/chunk-VWFTFPZB.mjs +0 -1
- package/dist/chunk-WY62QD3C.js +0 -1
- package/dist/chunk-XNAZ5QU3.js +0 -1
- package/dist/either/Left.d.mts +0 -2
- package/dist/either/Left.d.ts +0 -2
- package/dist/either/Left.js +0 -1
- package/dist/either/Left.mjs +0 -1
- package/dist/either/Right.d.mts +0 -2
- package/dist/either/Right.d.ts +0 -2
- package/dist/either/Right.js +0 -1
- package/dist/either/Right.mjs +0 -1
- package/dist/option/None.d.mts +0 -2
- package/dist/option/None.d.ts +0 -2
- package/dist/option/None.js +0 -1
- package/dist/option/None.mjs +0 -1
- package/dist/option/Some.d.mts +0 -2
- package/dist/option/Some.d.ts +0 -2
- package/dist/option/Some.js +0 -1
- package/dist/option/Some.mjs +0 -1
- /package/dist/{chunk-DOG6HMTN.js → chunk-6BEXQNLZ.js} +0 -0
- /package/dist/{chunk-72IAI5F4.mjs → chunk-74TKYQJS.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBFK2RZ2Zjs = require('./chunk-BFK2RZ2Z.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var o=class s{constructor(r,e){_chunkVTKL7OQIjs.a.call(void 0, this,"value");_chunkVTKL7OQIjs.a.call(void 0, this,"error");this.value=r,this.error=e}static of(r){try{return new s(r(),null)}catch(e){return new s(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new (0, _chunkBFK2RZ2Zjs.a)(this.value):new (0, _chunkBFK2RZ2Zjs.b)(this.error)}};exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFQY6BMNGjs = require('./chunk-FQY6BMNG.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunkSDHW57XQjs = require('./chunk-SDHW57XQ.js');var _chunkZTTAUZK3js = require('./chunk-ZTTAUZK3.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var i=class n{constructor(e){_chunkVTKL7OQIjs.a.call(void 0, this,"values");this.values=new (0, _chunk5VTXJIR3js.a)(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new (0, _chunkFQY6BMNGjs.a)([e,t]))}add(e){return new n(this.values.set(e[0],e[1]).entries())}remove(e){let t=new n([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){let t=[];for(let[r,l]of this.values.entries())t.push([r,e(l)]);return new n(t)}flatMap(e){let t=[];for(let[r,l]of this.values.entries()){let u=e(l);if(u instanceof n)for(let[I,v]of u.values.entries())t.push([I,v])}return new n(t)}reduce(e){return new (0, _chunkZTTAUZK3js.f)(this.entries).reduce(e)}reduceRight(e){return new (0, _chunkZTTAUZK3js.f)(this.entries).reduceRight(e)}foldLeft(e){let t=new (0, _chunkZTTAUZK3js.f)(this.entries);return r=>t.foldLeft(e)(r)}foldRight(e){let t=new (0, _chunkZTTAUZK3js.f)(this.entries);return r=>t.foldRight(e)(r)}get(e){return _chunkZTTAUZK3js.c.call(void 0, this.values.get(e))}getOrElse(e,t){return _chunkZTTAUZK3js.c.call(void 0, this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let r=_chunkZTTAUZK3js.c.call(void 0, this.values.get(e));return t}toList(){return new (0, _chunkSDHW57XQjs.b)(this.entries)}toSet(){return new (0, _chunkSDHW57XQjs.a)(this.entries)}},b=new i([["a",1],["b",2],["c",3]]);exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-HA5XD5KC.mjs";import{c as A,f as s}from"./chunk-X52Z6M5P.mjs";var o=class e extends s{constructor(t){super(t)}map(t){return new e(super.map(t).toArray())}flatMap(t){return new e(super.flatMap(t).toArray())}remove(t){let i=new e().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new e(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let r=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new e(r)}get(t){return A(this.toArray()[t])}concat(t){return new e([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new n(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var L=e=>new o(e);var n=class e extends s{constructor(t){super(new a(t))}add(t){return new e([...this.values,t])}remove(t){let r=new a;return r.delete(t)?new e(r):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new e(super.map(t).toArray())}flatMap(t){return new e(super.flatMap(t).toArray())}toList(){return new o(this.toArray())}toSet(){return this}};export{n as a,o as b,L as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSDHW57XQjs = require('./chunk-SDHW57XQ.js');var _chunkZTTAUZK3js = require('./chunk-ZTTAUZK3.js');var L=class e{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}toOption(){return _chunkZTTAUZK3js.d.call(void 0, this.value)}toList(){return new (0, _chunkSDHW57XQjs.b)([this.value])}},u= exports.b =class e{constructor(t){this.value=t}isLeft(){return!0}isRight(){return!1}map(t){return new e(this.value)}flatMap(t){return new e(this.value)}toOption(){return _chunkZTTAUZK3js.e.call(void 0, )}toList(){return new _chunkSDHW57XQjs.b}};exports.a = L; exports.b = u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";exports.a = e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBFK2RZ2Zjs = require('./chunk-BFK2RZ2Z.js');var L=t=>new (0, _chunkBFK2RZ2Zjs.b)(t),R= exports.b =t=>new (0, _chunkBFK2RZ2Zjs.a)(t);exports.a = L; exports.b = R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as r}from"./chunk-LGUIG2RX.mjs";var L=t=>new r(t),R=t=>new e(t);export{L as a,R as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-RMQF6I4T.mjs";import{a as V}from"./chunk-377WQNCB.mjs";import{a as p,b as K}from"./chunk-6RUUD24R.mjs";import{c as a,f as s}from"./chunk-X52Z6M5P.mjs";import{a as o}from"./chunk-U5EUM74A.mjs";var i=class n{constructor(e){o(this,"values");this.values=new V(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new f([e,t]))}add(e){return new n(this.values.set(e[0],e[1]).entries())}remove(e){let t=new n([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){let t=[];for(let[r,l]of this.values.entries())t.push([r,e(l)]);return new n(t)}flatMap(e){let t=[];for(let[r,l]of this.values.entries()){let u=e(l);if(u instanceof n)for(let[I,v]of u.values.entries())t.push([I,v])}return new n(t)}reduce(e){return new s(this.entries).reduce(e)}reduceRight(e){return new s(this.entries).reduceRight(e)}foldLeft(e){let t=new s(this.entries);return r=>t.foldLeft(e)(r)}foldRight(e){let t=new s(this.entries);return r=>t.foldRight(e)(r)}get(e){return a(this.values.get(e))}getOrElse(e,t){return a(this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let r=a(this.values.get(e));return t}toList(){return new K(this.entries)}toSet(){return new p(this.entries)}},b=new i([["a",1],["b",2],["c",3]]);export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=class
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=class n{constructor(e){this.values=e}map(e){let r=e(this.values);return new n(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let a=this.values[e];if(r){if(r(this.values))return a;throw new Error("Cannot cast tuple value")}else return a}toArray(){return this.values}};exports.a = t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as i}from"./chunk-6RUUD24R.mjs";import{d as r,e as s}from"./chunk-X52Z6M5P.mjs";var L=class e{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}toOption(){return r(this.value)}toList(){return new i([this.value])}},u=class e{constructor(t){this.value=t}isLeft(){return!0}isRight(){return!1}map(t){return new e(this.value)}flatMap(t){return new e(this.value)}toOption(){return s()}toList(){return new i}};export{L as a,u as b};
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=class
|
|
1
|
+
var t=class n{constructor(e){this.values=e}map(e){let r=e(this.values);return new n(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let a=this.values[e];if(r){if(r(this.values))return a;throw new Error("Cannot cast tuple value")}else return a}toArray(){return this.values}};export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _chunkZTTAUZK3js = require('./chunk-ZTTAUZK3.js');var o=class e extends _chunkZTTAUZK3js.f{constructor(t){super(t)}map(t){return new e(super.map(t).toArray())}flatMap(t){return new e(super.flatMap(t).toArray())}remove(t){let i=new e().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new e(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let r=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new e(r)}get(t){return _chunkZTTAUZK3js.c.call(void 0, this.toArray()[t])}concat(t){return new e([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new n(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var L=e=>new o(e);var n=class e extends _chunkZTTAUZK3js.f{constructor(t){super(new (0, _chunk3VJERXBPjs.a)(t))}add(t){return new e([...this.values,t])}remove(t){let r=new _chunk3VJERXBPjs.a;return r.delete(t)?new e(r):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new e(super.map(t).toArray())}flatMap(t){return new e(super.flatMap(t).toArray())}toList(){return new o(this.toArray())}toSet(){return this}};exports.a = n; exports.b = o; exports.c = L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,b as i}from"./chunk-LGUIG2RX.mjs";import{a as t}from"./chunk-U5EUM74A.mjs";var o=class s{constructor(r,e){t(this,"value");t(this,"error");this.value=r,this.error=e}static of(r){try{return new s(r(),null)}catch(e){return new s(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new l(this.value):new i(this.error)}};export{o as a};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-RRAIFS3D.mjs";import{a as A}from"./chunk-U5EUM74A.mjs";var s=t=>t?f(t):l(),f=t=>new o(t),l=()=>new i;var n=class t{constructor(e){A(this,"values");p(e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let a=e(u);a instanceof t&&r.push(...a.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):l()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,a)=>r(a,u),e)}};var o=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}},i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};export{o as a,i as b,s as c,f as d,l as e,n as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var s=t=>t?f(t):l(),f= exports.d =t=>new o(t),l= exports.e =()=>new i;var n=class t{constructor(e){_chunkVTKL7OQIjs.a.call(void 0, this,"values");_chunkBNNK42JCjs.a.call(void 0, e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let a=e(u);a instanceof t&&r.push(...a.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):l()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,a)=>r(a,u),e)}};var o=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}},i= exports.b =class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};exports.a = o; exports.b = i; exports.c = s; exports.d = f; exports.e = l; exports.f = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBFK2RZ2Zjs = require('../chunk-BFK2RZ2Z.js');require('../chunk-SDHW57XQ.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-ZTTAUZK3.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkBFK2RZ2Zjs.b; exports.Right = _chunkBFK2RZ2Zjs.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../chunk-LGUIG2RX.mjs";import"../chunk-6RUUD24R.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-X52Z6M5P.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{b as Left,a as Right};
|
package/dist/either/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { E as Either, h as Left, R as Right, i as left, r as right } from '../index-5f972212.js';
|
|
2
|
+
import '../functor/index.mjs';
|
|
3
|
+
import '../tuple/Tuple.mjs';
|
package/dist/either/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { E as Either, h as Left, R as Right, i as left, r as right } from '../index-3866f956.js';
|
|
2
|
+
import '../functor/index.js';
|
|
3
|
+
import '../tuple/Tuple.js';
|
package/dist/either/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBYPZZZTGjs = require('../chunk-BYPZZZTG.js');var _chunkBFK2RZ2Zjs = require('../chunk-BFK2RZ2Z.js');require('../chunk-SDHW57XQ.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-ZTTAUZK3.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkBFK2RZ2Zjs.b; exports.Right = _chunkBFK2RZ2Zjs.a; exports.left = _chunkBYPZZZTGjs.a; exports.right = _chunkBYPZZZTGjs.b;
|
package/dist/either/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b
|
|
1
|
+
import{a as c,b as d}from"../chunk-DFWZ7ANA.mjs";import{a,b}from"../chunk-LGUIG2RX.mjs";import"../chunk-6RUUD24R.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-X52Z6M5P.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{b as Left,a as Right,c as left,d as right};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type SingleType = any;
|
|
2
|
+
type ArrayType = SingleType[];
|
|
3
|
+
type Type = SingleType | ArrayType;
|
|
4
|
+
interface IAbstractFunctor<A extends Type> {
|
|
5
|
+
map(f: (value: A) => Type): IAbstractFunctor<Type>;
|
|
6
|
+
flatMap(f: (value: A) => IAbstractFunctor<Type>): IAbstractFunctor<Type>;
|
|
7
|
+
}
|
|
8
|
+
interface IFunctor<A extends Type> extends IAbstractFunctor<A> {
|
|
9
|
+
map<B extends Type>(f: (value: A) => B): IFunctor<B>;
|
|
10
|
+
flatMap<B extends Type>(f: (value: A) => IFunctor<B>): IFunctor<B>;
|
|
11
|
+
}
|
|
12
|
+
interface IArrayFunctor<A extends ArrayType> extends IAbstractFunctor<A> {
|
|
13
|
+
map<U extends ArrayType>(f: (value: A) => U): IArrayFunctor<U>;
|
|
14
|
+
flatMap<U extends ArrayType>(f: (value: A) => IArrayFunctor<U>): IArrayFunctor<U>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { ArrayType, IAbstractFunctor, IArrayFunctor, IFunctor, SingleType, Type };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type SingleType = any;
|
|
2
|
+
type ArrayType = SingleType[];
|
|
3
|
+
type Type = SingleType | ArrayType;
|
|
4
|
+
interface IAbstractFunctor<A extends Type> {
|
|
5
|
+
map(f: (value: A) => Type): IAbstractFunctor<Type>;
|
|
6
|
+
flatMap(f: (value: A) => IAbstractFunctor<Type>): IAbstractFunctor<Type>;
|
|
7
|
+
}
|
|
8
|
+
interface IFunctor<A extends Type> extends IAbstractFunctor<A> {
|
|
9
|
+
map<B extends Type>(f: (value: A) => B): IFunctor<B>;
|
|
10
|
+
flatMap<B extends Type>(f: (value: A) => IFunctor<B>): IFunctor<B>;
|
|
11
|
+
}
|
|
12
|
+
interface IArrayFunctor<A extends ArrayType> extends IAbstractFunctor<A> {
|
|
13
|
+
map<U extends ArrayType>(f: (value: A) => U): IArrayFunctor<U>;
|
|
14
|
+
flatMap<U extends ArrayType>(f: (value: A) => IArrayFunctor<U>): IArrayFunctor<U>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { ArrayType, IAbstractFunctor, IArrayFunctor, IFunctor, SingleType, Type };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('../chunk-XORABVON.js');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunk-V2J3R5IU.mjs";
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { Type, IFunctor } from './functor/index.js';
|
|
2
|
+
import { ITuple, Tuple } from './tuple/Tuple.js';
|
|
3
|
+
|
|
4
|
+
interface Option<T extends Type> extends IFunctor<T>, ITraversable<T> {
|
|
5
|
+
get(): T;
|
|
6
|
+
getOrElse(defaultValue: T): T;
|
|
7
|
+
orElse(alternative: Option<T>): Option<T>;
|
|
8
|
+
map<U extends Type>(f: (value: T) => U): Option<U>;
|
|
9
|
+
flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
|
|
10
|
+
toList(): IIterable<T>;
|
|
11
|
+
}
|
|
12
|
+
declare class Some<A extends Type> implements Option<A> {
|
|
13
|
+
private value;
|
|
14
|
+
constructor(value: A);
|
|
15
|
+
get isEmpty(): boolean;
|
|
16
|
+
get(): A;
|
|
17
|
+
getOrElse(defaultValue: A): A;
|
|
18
|
+
orElse(alternative: Option<A>): Option<A>;
|
|
19
|
+
map<U extends Type>(f: (value: A) => U): Option<U>;
|
|
20
|
+
flatMap<U extends Type>(f: (value: A) => Option<U>): Option<U>;
|
|
21
|
+
reduce<U>(f: (acc: U, value: A) => U): U;
|
|
22
|
+
reduceRight<U>(f: (acc: U, value: A) => U): U;
|
|
23
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
24
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
25
|
+
toList(): IIterable<A>;
|
|
26
|
+
contains(value: A): boolean;
|
|
27
|
+
get size(): number;
|
|
28
|
+
}
|
|
29
|
+
declare class None<A extends Type> implements Option<A> {
|
|
30
|
+
get isEmpty(): boolean;
|
|
31
|
+
get(): A;
|
|
32
|
+
getOrElse(defaultValue: A): A;
|
|
33
|
+
orElse(alternative: Option<A>): Option<A>;
|
|
34
|
+
map<U extends Type>(f: (value: A) => U): Option<U>;
|
|
35
|
+
flatMap<U extends Type>(f: (value: A) => Option<U>): Option<U>;
|
|
36
|
+
reduce(f: (acc: A, value: A) => A): A;
|
|
37
|
+
reduceRight(f: (b: A, a: A) => A): A;
|
|
38
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
39
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
40
|
+
toList(): IIterable<A>;
|
|
41
|
+
contains(value: A): boolean;
|
|
42
|
+
get size(): number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const option: <T extends unknown>(value?: T | undefined) => Option<T>;
|
|
46
|
+
declare const some: <T extends unknown>(value: T) => Option<T>;
|
|
47
|
+
declare const none: <T extends unknown>() => Option<T>;
|
|
48
|
+
|
|
49
|
+
declare class Seq<A> implements IIterable<A> {
|
|
50
|
+
protected readonly values: Iterable<A>;
|
|
51
|
+
constructor(values?: Iterable<A> | IIterable<A>);
|
|
52
|
+
readonly [n: number]: A;
|
|
53
|
+
get length(): number;
|
|
54
|
+
map<B>(f: (a: A) => B): IIterable<B>;
|
|
55
|
+
flatMap<B>(f: (a: A) => IIterable<B>): IIterable<B>;
|
|
56
|
+
forEach(f: (a: A) => void): void;
|
|
57
|
+
count(p: (x: A) => boolean): number;
|
|
58
|
+
exists(p: (a: A) => boolean): Boolean;
|
|
59
|
+
filter(p: (a: A) => boolean): IIterable<A>;
|
|
60
|
+
filterNot(p: (a: A) => boolean): IIterable<A>;
|
|
61
|
+
find(p: (a: A) => boolean): Option<A>;
|
|
62
|
+
get head(): A;
|
|
63
|
+
get headOption(): Option<A>;
|
|
64
|
+
get isEmpty(): boolean;
|
|
65
|
+
get size(): number;
|
|
66
|
+
toArray(): A[];
|
|
67
|
+
reduce(f: (prev: A, curr: A) => A): A;
|
|
68
|
+
reduceRight(f: (prev: A, curr: A) => A): A;
|
|
69
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
70
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface IIterable<A extends Type> extends IFunctor<A> {
|
|
74
|
+
count(p: (x: A) => boolean): number;
|
|
75
|
+
find(p: (a: A) => boolean): Option<A>;
|
|
76
|
+
forEach(f: (a: A) => void): void;
|
|
77
|
+
exists(p: (a: A) => boolean): Boolean;
|
|
78
|
+
filter(p: (a: A) => boolean): IIterable<A>;
|
|
79
|
+
filterNot(p: (a: A) => boolean): IIterable<A>;
|
|
80
|
+
reduce(f: (b: A, a: A) => A): A;
|
|
81
|
+
reduceRight(f: (b: A, a: A) => A): A;
|
|
82
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
83
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
84
|
+
get head(): A;
|
|
85
|
+
get headOption(): Option<A>;
|
|
86
|
+
get isEmpty(): boolean;
|
|
87
|
+
map<B extends Type>(f: (a: A) => B): IIterable<B>;
|
|
88
|
+
flatMap<B extends Type>(f: (a: A) => IIterable<B>): IIterable<B>;
|
|
89
|
+
get size(): number;
|
|
90
|
+
toArray(): readonly A[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface ISet<T> extends IIterable<T>, ICollection<T> {
|
|
94
|
+
has(value: T): boolean;
|
|
95
|
+
}
|
|
96
|
+
declare class Set<A> extends Seq<A> implements ISet<A> {
|
|
97
|
+
constructor(iterable?: Iterable<A>);
|
|
98
|
+
add(value: A): Set<A>;
|
|
99
|
+
remove(value: A): Set<A>;
|
|
100
|
+
contains(value: A): boolean;
|
|
101
|
+
has(value: A): boolean;
|
|
102
|
+
map<B>(f: (a: A) => B): Set<B>;
|
|
103
|
+
flatMap<B>(f: (a: A) => IIterable<B>): Set<B>;
|
|
104
|
+
toList(): IList<A>;
|
|
105
|
+
toSet(): ISet<A>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface IConverters<A> {
|
|
109
|
+
toList(): IList<A>;
|
|
110
|
+
toSet(): ISet<A>;
|
|
111
|
+
}
|
|
112
|
+
interface ICollection<A> extends IConverters<A> {
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface IList<T> extends IIterable<T>, ArrayLike<T> {
|
|
116
|
+
add(item: T): IList<T>;
|
|
117
|
+
}
|
|
118
|
+
declare class List<A> extends Seq<A> implements IList<A>, ICollection<A> {
|
|
119
|
+
constructor(values?: Iterable<A> | IIterable<A>);
|
|
120
|
+
readonly [n: number]: A;
|
|
121
|
+
map<B>(f: (a: A) => B): List<B>;
|
|
122
|
+
flatMap<B>(f: (a: A) => IIterable<B>): List<B>;
|
|
123
|
+
remove(value: A): List<A>;
|
|
124
|
+
contains(value: A): boolean;
|
|
125
|
+
add(item: A): List<A>;
|
|
126
|
+
removeAt(index: number): List<A>;
|
|
127
|
+
get(index: number): Option<A>;
|
|
128
|
+
concat(other: List<A>): List<A>;
|
|
129
|
+
toList(): IList<A>;
|
|
130
|
+
toSet(): Set<A>;
|
|
131
|
+
toString(): string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare const list: <T extends unknown>(items: T[] | undefined) => List<T>;
|
|
135
|
+
|
|
136
|
+
interface IMap<K, V> extends ITraversable<ITuple<[K, V]>>, ICollection<ITuple<[K, V]>> {
|
|
137
|
+
map<U>(f: (value: any) => U): IMap<K, U>;
|
|
138
|
+
flatMap<U>(f: (value: any) => IMap<K, U>): IMap<K, U>;
|
|
139
|
+
get(key: K): Option<V>;
|
|
140
|
+
getOrElse(key: K, defaultValue: V): V;
|
|
141
|
+
orElse(key: K, alternative: Option<V>): Option<V>;
|
|
142
|
+
}
|
|
143
|
+
declare class Map<K, V> implements IMap<K, V> {
|
|
144
|
+
private values;
|
|
145
|
+
private get entries();
|
|
146
|
+
constructor(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null);
|
|
147
|
+
add(item: ITuple<[K, V]>): Map<K, V>;
|
|
148
|
+
remove(value: ITuple<[K, V]>): Map<K, V>;
|
|
149
|
+
contains(value: ITuple<[K, V]>): boolean;
|
|
150
|
+
get size(): number;
|
|
151
|
+
map<U>(f: (value: V) => U): IMap<K, U>;
|
|
152
|
+
flatMap<U>(f: (value: V) => IMap<K, U>): IMap<K, U>;
|
|
153
|
+
reduce(f: (acc: Tuple<[K, V]>, value: Tuple<[K, V]>) => Tuple<[K, V]>): Tuple<[K, V]>;
|
|
154
|
+
reduceRight(f: (acc: Tuple<[K, V]>, value: Tuple<[K, V]>) => Tuple<[K, V]>): Tuple<[K, V]>;
|
|
155
|
+
foldLeft<B>(z: B): (op: (b: B, a: ITuple<[K, V]>) => B) => B;
|
|
156
|
+
foldRight<B>(z: B): (op: (a: ITuple<[K, V]>, b: B) => B) => B;
|
|
157
|
+
get(key: K): Option<V>;
|
|
158
|
+
getOrElse(key: K, defaultValue: V): V;
|
|
159
|
+
get isEmpty(): boolean;
|
|
160
|
+
orElse(key: K, alternative: Option<V>): Option<V>;
|
|
161
|
+
toList(): IList<Tuple<[K, V]>>;
|
|
162
|
+
toSet(): ISet<Tuple<[K, V]>>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface Either<L, R> extends IFunctor<R> {
|
|
166
|
+
value: L | R;
|
|
167
|
+
isLeft(): this is Left<L, R>;
|
|
168
|
+
isRight(): this is Right<L, R>;
|
|
169
|
+
map<U>(f: (value: R) => U): Either<L, U>;
|
|
170
|
+
flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
|
|
171
|
+
toOption(): Option<R>;
|
|
172
|
+
toList(): List<R>;
|
|
173
|
+
}
|
|
174
|
+
declare class Right<L, R> implements Either<L, R> {
|
|
175
|
+
value: R;
|
|
176
|
+
constructor(value: R);
|
|
177
|
+
isLeft(): this is Left<L, R>;
|
|
178
|
+
isRight(): this is Right<L, R>;
|
|
179
|
+
map<U>(f: (value: R) => U): Either<L, U>;
|
|
180
|
+
flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
|
|
181
|
+
toOption(): Option<R>;
|
|
182
|
+
toList(): List<R>;
|
|
183
|
+
}
|
|
184
|
+
declare class Left<L, R> implements Either<L, R> {
|
|
185
|
+
value: L;
|
|
186
|
+
constructor(value: L);
|
|
187
|
+
isLeft(): this is Left<L, R>;
|
|
188
|
+
isRight(): this is Right<L, R>;
|
|
189
|
+
map<U>(_f: (value: R) => U): Either<L, U>;
|
|
190
|
+
flatMap<U>(_f: (value: R) => Either<L, U>): Either<L, U>;
|
|
191
|
+
toOption(): Option<R>;
|
|
192
|
+
toList(): List<R>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare const left: <L, R>(value: L) => Either<L, R>;
|
|
196
|
+
declare const right: <L, R>(value: R) => Either<L, R>;
|
|
197
|
+
|
|
198
|
+
interface ITry<T> {
|
|
199
|
+
isSuccess(): boolean;
|
|
200
|
+
isFailure(): boolean;
|
|
201
|
+
getOrElse(defaultValue: T): T;
|
|
202
|
+
orElse(alternative: ITry<T>): ITry<T>;
|
|
203
|
+
toEither(): Either<Error, T>;
|
|
204
|
+
}
|
|
205
|
+
declare class Try<T> implements ITry<T> {
|
|
206
|
+
private readonly value;
|
|
207
|
+
private readonly error;
|
|
208
|
+
private constructor();
|
|
209
|
+
static of<T>(f: () => T): Try<T>;
|
|
210
|
+
isSuccess(): boolean;
|
|
211
|
+
isFailure(): boolean;
|
|
212
|
+
getOrElse(defaultValue: T): T;
|
|
213
|
+
orElse(alternative: ITry<T>): ITry<T>;
|
|
214
|
+
toEither(): Either<Error, T>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
interface ITraversable<A extends Type> extends IFunctor<A> {
|
|
218
|
+
get size(): number;
|
|
219
|
+
get isEmpty(): boolean;
|
|
220
|
+
contains(value: A): boolean;
|
|
221
|
+
reduce(f: (b: A, a: A) => A): A;
|
|
222
|
+
reduceRight(f: (b: A, a: A) => A): A;
|
|
223
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
224
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export { Either as E, IIterable as I, List as L, Map as M, None as N, Option as O, Right as R, Some as S, Try as T, Seq as a, ISet as b, Set as c, IConverters as d, ICollection as e, IList as f, IMap as g, Left as h, left as i, ITry as j, ITraversable as k, list as l, none as n, option as o, right as r, some as s };
|