functype 0.8.30 → 0.8.32
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/README.md +21 -21
- package/dist/chunk-2U34DUZU.js +1 -0
- package/dist/chunk-ETU42J57.js +1 -0
- package/dist/chunk-HD6YYUHO.mjs +1 -0
- package/dist/chunk-JF5YGNCO.mjs +1 -0
- package/dist/chunk-JJLIOHWZ.mjs +1 -0
- package/dist/chunk-SQWNJC6O.js +1 -0
- package/dist/collections/index.d.mts +3 -1
- package/dist/collections/index.d.ts +3 -1
- package/dist/core/base/Base.d.mts +11 -0
- package/dist/core/base/Base.d.ts +11 -0
- package/dist/core/base/Base.js +1 -0
- package/dist/core/base/Base.mjs +1 -0
- package/dist/core/error/Throwable.d.mts +12 -0
- package/dist/core/error/Throwable.d.ts +12 -0
- package/dist/core/error/Throwable.js +1 -0
- package/dist/core/error/Throwable.mjs +1 -0
- package/dist/core/task/Task.d.mts +7 -0
- package/dist/core/task/Task.d.ts +7 -0
- package/dist/core/task/Task.js +1 -0
- package/dist/core/task/Task.mjs +1 -0
- package/dist/either/Either.d.mts +3 -1
- package/dist/either/Either.d.ts +3 -1
- package/dist/either/Either.js +1 -1
- package/dist/either/Either.mjs +1 -1
- package/dist/{index-B7vTndKq.d.ts → index-BT9-eytr.d.ts} +27 -3
- package/dist/{index-DzaLFl1L.d.mts → index-D2YBcdXR.d.mts} +27 -3
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/Seq.d.mts +3 -1
- package/dist/iterable/Seq.d.ts +3 -1
- package/dist/iterable/Seq.js +1 -1
- package/dist/iterable/Seq.mjs +1 -1
- package/dist/iterable/index.d.mts +3 -1
- package/dist/iterable/index.d.ts +3 -1
- package/dist/iterable/index.js +1 -1
- package/dist/iterable/index.mjs +1 -1
- package/dist/list/List.d.mts +3 -1
- package/dist/list/List.d.ts +3 -1
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/map/Map.d.mts +3 -1
- package/dist/map/Map.d.ts +3 -1
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/option/Option.d.mts +3 -1
- package/dist/option/Option.d.ts +3 -1
- package/dist/option/Option.js +1 -1
- package/dist/option/Option.mjs +1 -1
- package/dist/set/Set.d.mts +3 -1
- package/dist/set/Set.d.ts +3 -1
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/try/Try.d.mts +3 -1
- package/dist/try/Try.d.ts +3 -1
- package/dist/try/Try.js +1 -1
- package/dist/try/Try.mjs +1 -1
- package/dist/util/index.d.mts +3 -1
- package/dist/util/index.d.ts +3 -1
- package/dist/util/index.js +1 -1
- package/dist/util/index.mjs +1 -1
- package/dist/valuable/Valuable.d.mts +6 -0
- package/dist/valuable/Valuable.d.ts +6 -0
- package/dist/valuable/Valuable.js +1 -0
- package/dist/valuable/Valuable.mjs +1 -0
- package/package.json +13 -9
- package/dist/chunk-V72GRMBG.js +0 -1
- package/dist/chunk-W5Z2N2E4.mjs +0 -1
- package/lib/TaskPromise.d.ts +0 -3
- package/lib/collections/index.d.ts +0 -8
- package/lib/either/Either.d.ts +0 -52
- package/lib/either/EitherT.d.ts +0 -9
- package/lib/error/ParseError.d.ts +0 -6
- package/lib/functor/index.d.ts +0 -15
- package/lib/identity/Identity.d.ts +0 -4
- package/lib/index.d.ts +0 -21
- package/lib/iterable/Seq.d.ts +0 -31
- package/lib/iterable/index.d.ts +0 -22
- package/lib/list/List.d.ts +0 -26
- package/lib/map/Map.d.ts +0 -17
- package/lib/map/shim.d.ts +0 -2
- package/lib/option/Option.d.ts +0 -30
- package/lib/serializable/Serializable.d.ts +0 -15
- package/lib/set/Set.d.ts +0 -15
- package/lib/set/shim.d.ts +0 -2
- package/lib/try/Try.d.ts +0 -18
- package/lib/tuple/Tuple.d.ts +0 -9
- package/lib/typeable/Typeable.d.ts +0 -4
- package/lib/util/index.d.ts +0 -3
- package/lib/util/isIterable.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# functype
|
|
2
|
-
|
|
3
|
-
A small functional library for TypeScript inspired by Scala Standard Library.
|
|
4
|
-
|
|
5
|
-
[](https://github.com/jordanburke/functype/actions/workflows/pnpm-build.yml)
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
You can install `functype` using any package manager:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install functype
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pnpm install functype
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
yarn install functype
|
|
21
|
-
```
|
|
1
|
+
# functype
|
|
2
|
+
|
|
3
|
+
A small functional library for TypeScript inspired by Scala Standard Library.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/jordanburke/functype/actions/workflows/pnpm-build.yml)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
You can install `functype` using any package manager:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install functype
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm install functype
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
yarn install functype
|
|
21
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var o="Throwable",r= exports.a =(e,a)=>{let t=e instanceof Error?e.message:typeof e=="string"?e:"An unknown error occurred",s=e instanceof Error?e.stack:void 0,n=new Error(t);return n.name=o,{_tag:o,name:n.name,message:n.message,stack:_nullishCoalesce(s, () => (n.stack)),data:a}};r.NAME=o;exports.a = r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunkSQWNJC6Ojs = require('./chunk-SQWNJC6O.js');var _chunk2U34DUZUjs = require('./chunk-2U34DUZU.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var m=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),l="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:l,map:o=>m(r.map(o)),flatMap:o=>m(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>m(r.filter(o)),filterNot:o=>m(r.filter(n=>!o(n))),find:o=>L(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?L(r[0]):A()},get isEmpty(){return r.length===0},get size(){return r.length},toArray:()=>[...r],reduce:o=>r.reduce(o),reduceRight:o=>r.reduceRight(o),foldLeft:o=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((u,S)=>n(S,u),o),toString:()=>`Seq(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:l,value:r})}},f= exports.e =e=>m(e);var R=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?new (0, _chunk3VJERXBPjs.a)(e):new (0, _chunk3VJERXBPjs.a)(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _2 => _2.toArray, 'call', _3 => _3()]), () => ([]))),r=f(t),l={...r,add:o=>R([...t,o]),remove:o=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(o),R(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>R(r.map(o)),flatMap:o=>R(r.flatMap(o)),toList:()=>T(t),toSet:()=>l,toString:()=>`Set(${Array.from(t).toString()})`};return l},E= exports.f =e=>R(e);var d=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],l=f(r),o={...l,_tag:"List",length:r.length,map:n=>d(r.map(n)),flatMap:n=>d(l.flatMap(n)),remove:n=>{let u=r.indexOf(n);return o.removeAt(u)},contains:n=>r.includes(n),add:n=>d([...r,n]),removeAt:n=>n<0||n>=r.length?o:d([...r.slice(0,n),...r.slice(n+1)]),get:n=>L(r[n]),concat:n=>d([...r,...n.toArray()]),toList:()=>o,toSet:()=>E(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${_safestablestringify2.default.call(void 0, T(r))})`};return new Proxy(o,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},T= exports.g =e=>d(e),W= exports.h =e=>d(e);console.assert(W);var K=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>s(t(e)),mapAsync:t=>t(e).then(r=>s(r)).catch(r=>Promise.resolve(a(r))),merge:t=>t.isLeft()?a(t.value):s([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>a(r)),toOption:()=>c(e),toList:()=>T([e]),toString:()=>`Right(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){yield e},yield:function*(){yield e},traverse:t=>{let r=t(e);return r.isLeft()?a(r.value):s([r.value])},lazyMap:function*(t){yield s(t(e))},tap:t=>(t(e),s(e)),tapLeft:t=>s(e),mapLeft:t=>s(e),bimap:(t,r)=>s(r(e)),fold:(t,r)=>r(e),swap:()=>a(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),I=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>a(e),mapAsync:t=>Promise.resolve(a(e)),merge:t=>a(e),flatMap:t=>a(e),flatMapAsync:t=>Promise.resolve(a(e)),toOption:()=>A(),toList:()=>T(),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>a(e),lazyMap:function*(t){yield a(e)},tap:t=>a(e),tapLeft:t=>(t(e),a(e)),mapLeft:t=>a(t(e)),bimap:(t,r)=>a(t(e)),fold:(t,r)=>t(e),swap:()=>s(e),then:(t,r)=>Promise.reject(e).then(null,r)}),s= exports.i =e=>K(e),a= exports.j =e=>I(e),ve= exports.k =e=>e.isRight(),Ve= exports.l =e=>e.isLeft(),Oe= exports.m =(e,t)=>{try{return s(e())}catch(r){return a(t(r))}},X= exports.n =e=>K(e);console.assert(X);var Y=e=>I(e);console.assert(Y);var we=async(e,t)=>{try{let r=await e();return s(r)}catch(r){return a(t(r))}},Z= exports.q ={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return a(r.value);t.push(r.value)}return s(t)},traverse:(e,t)=>Z.sequence(e.map(t)),fromNullable:(e,t)=>e==null?a(t):s(e),fromPredicate:(e,t,r)=>t(e)?s(e):a(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return s(r)}catch(r){return a(t(r))}}};var U=(e,t)=>{let r=_chunk2U34DUZUjs.a.call(void 0, e,t);return{..._chunkSQWNJC6Ojs.a.call(void 0, "AppException"),...a(r)}},B= exports.s =e=>({..._chunkSQWNJC6Ojs.a.call(void 0, "AppResult"),...s(e)});function M(e,t=r=>r){try{return B(e())}catch(r){return U(t(r))}}M.success=e=>B(e);M.fail=e=>U(e);async function k(e,t=r=>r){try{let r=await e();return B(r)}catch(r){let l=await t(r);return U(l)}}k.success=e=>B(e);k.fail=e=>U(e);var y=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,p])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,p])),l=i=>y(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),o=i=>{let p=new (0, _chunk5VTXJIR3js.a)(t.values);return p.delete(i)?y(p.entries()):y(t.values.entries())},n=i=>t.values.get(i[0])===i[1],u=()=>t.values.size,S=i=>y(Array.from(t.values.entries()).map(([p,H])=>[p,i(H)])),z=i=>{let p=y(t.values.entries()).toList();return y(p.flatMap(i).toArray())},N=i=>f(r()).reduce(i),F=i=>f(r()).reduceRight(i),C=i=>p=>f(r()).foldLeft(i)(p),$=i=>p=>f(r()).foldRight(i)(p),j=i=>L(t.values.get(i)),G=(i,p)=>L(t.values.get(i)).getOrElse(p),D=()=>t.values.size===0;return{add:l,remove:o,contains:n,get size(){return u()},map:S,flatMap:z,reduce:N,reduceRight:F,foldLeft:C,foldRight:$,get:j,getOrElse:G,get isEmpty(){return D()},orElse:(i,p)=>L(t.values.get(i)).orElse(p),toList:()=>T(r()),toSet:()=>E(r()),toString:()=>`Map(${r().toString()})`}},He= exports.v =e=>y(e);var q=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>q(e),orThrow:t=>e,toEither:()=>s(e),map:t=>ee(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),v=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>a(e),map:t=>v(e),flatMap:t=>v(e),toString:()=>`Failure(${_safestablestringify2.default.call(void 0, e)}))`}),ee= exports.w =e=>{try{return q(e())}catch(t){return v(t instanceof Error?t:new Error(String(t)))}};var c=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>c(e),map:t=>c(t(e)),filter(t){return t(e)?c(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>T([e]),contains:t=>t===e,size:1,toEither:t=>s(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>T([]),contains:()=>!1,size:0,toEither:e=>a(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},A= exports.b =()=>h,L= exports.c =e=>e!=null?c(e):A();exports.a = c; exports.b = A; exports.c = L; exports.d = m; exports.e = f; exports.f = E; exports.g = T; exports.h = W; exports.i = s; exports.j = a; exports.k = ve; exports.l = Ve; exports.m = Oe; exports.n = X; exports.o = Y; exports.p = we; exports.q = Z; exports.r = U; exports.s = B; exports.t = M; exports.u = k; exports.v = He; exports.w = ee;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o="Throwable",r=(e,a)=>{let t=e instanceof Error?e.message:typeof e=="string"?e:"An unknown error occurred",s=e instanceof Error?e.stack:void 0,n=new Error(t);return n.name=o,{_tag:o,name:n.name,message:n.message,stack:s??n.stack,data:a}};r.NAME=o;export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-V7DKESTM.mjs";function e(r){return{...t(r),toString(){return`${r}()`}}}export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O}from"./chunk-2I2NKDFN.mjs";import{a as b}from"./chunk-RRAIFS3D.mjs";import{a as _}from"./chunk-JF5YGNCO.mjs";import{a as V}from"./chunk-HD6YYUHO.mjs";import{a as x}from"./chunk-377WQNCB.mjs";import{a as g}from"./chunk-HA5XD5KC.mjs";import te from"safe-stable-stringify";import w from"safe-stable-stringify";import Q from"safe-stable-stringify";import J from"safe-stable-stringify";var m=e=>{let t=b(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),l="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:l,map:o=>m(r.map(o)),flatMap:o=>m(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>m(r.filter(o)),filterNot:o=>m(r.filter(n=>!o(n))),find:o=>L(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?L(r[0]):A()},get isEmpty(){return r.length===0},get size(){return r.length},toArray:()=>[...r],reduce:o=>r.reduce(o),reduceRight:o=>r.reduceRight(o),foldLeft:o=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((u,S)=>n(S,u),o),toString:()=>`Seq(${J(e)})`,toValue:()=>({_tag:l,value:r})}},f=e=>m(e);var R=e=>{let t=b(e)?new g(e):new g(e?.toArray()??[]),r=f(t),l={...r,add:o=>R([...t,o]),remove:o=>{let n=new g(t);return n.delete(o),R(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>R(r.map(o)),flatMap:o=>R(r.flatMap(o)),toList:()=>T(t),toSet:()=>l,toString:()=>`Set(${Array.from(t).toString()})`};return l},E=e=>R(e);var d=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],l=f(r),o={...l,_tag:"List",length:r.length,map:n=>d(r.map(n)),flatMap:n=>d(l.flatMap(n)),remove:n=>{let u=r.indexOf(n);return o.removeAt(u)},contains:n=>r.includes(n),add:n=>d([...r,n]),removeAt:n=>n<0||n>=r.length?o:d([...r.slice(0,n),...r.slice(n+1)]),get:n=>L(r[n]),concat:n=>d([...r,...n.toArray()]),toList:()=>o,toSet:()=>E(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${Q(T(r))})`};return new Proxy(o,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},T=e=>d(e),W=e=>d(e);console.assert(W);var K=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>s(t(e)),mapAsync:t=>t(e).then(r=>s(r)).catch(r=>Promise.resolve(a(r))),merge:t=>t.isLeft()?a(t.value):s([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>a(r)),toOption:()=>c(e),toList:()=>T([e]),toString:()=>`Right(${w(e)})`,[Symbol.iterator]:function*(){yield e},yield:function*(){yield e},traverse:t=>{let r=t(e);return r.isLeft()?a(r.value):s([r.value])},lazyMap:function*(t){yield s(t(e))},tap:t=>(t(e),s(e)),tapLeft:t=>s(e),mapLeft:t=>s(e),bimap:(t,r)=>s(r(e)),fold:(t,r)=>r(e),swap:()=>a(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),I=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>a(e),mapAsync:t=>Promise.resolve(a(e)),merge:t=>a(e),flatMap:t=>a(e),flatMapAsync:t=>Promise.resolve(a(e)),toOption:()=>A(),toList:()=>T(),toString:()=>`Left(${w(e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>a(e),lazyMap:function*(t){yield a(e)},tap:t=>a(e),tapLeft:t=>(t(e),a(e)),mapLeft:t=>a(t(e)),bimap:(t,r)=>a(t(e)),fold:(t,r)=>t(e),swap:()=>s(e),then:(t,r)=>Promise.reject(e).then(null,r)}),s=e=>K(e),a=e=>I(e),ve=e=>e.isRight(),Ve=e=>e.isLeft(),Oe=(e,t)=>{try{return s(e())}catch(r){return a(t(r))}},X=e=>K(e);console.assert(X);var Y=e=>I(e);console.assert(Y);var we=async(e,t)=>{try{let r=await e();return s(r)}catch(r){return a(t(r))}},Z={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return a(r.value);t.push(r.value)}return s(t)},traverse:(e,t)=>Z.sequence(e.map(t)),fromNullable:(e,t)=>e==null?a(t):s(e),fromPredicate:(e,t,r)=>t(e)?s(e):a(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return s(r)}catch(r){return a(t(r))}}};var U=(e,t)=>{let r=V(e,t);return{..._("AppException"),...a(r)}},B=e=>({..._("AppResult"),...s(e)});function M(e,t=r=>r){try{return B(e())}catch(r){return U(t(r))}}M.success=e=>B(e);M.fail=e=>U(e);async function k(e,t=r=>r){try{let r=await e();return B(r)}catch(r){let l=await t(r);return U(l)}}k.success=e=>B(e);k.fail=e=>U(e);var y=e=>{let t={values:new x(e)},r=()=>Array.from(t.values.entries()).map(([i,p])=>O([i,p])),l=i=>y(new x(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),o=i=>{let p=new x(t.values);return p.delete(i)?y(p.entries()):y(t.values.entries())},n=i=>t.values.get(i[0])===i[1],u=()=>t.values.size,S=i=>y(Array.from(t.values.entries()).map(([p,H])=>[p,i(H)])),z=i=>{let p=y(t.values.entries()).toList();return y(p.flatMap(i).toArray())},N=i=>f(r()).reduce(i),F=i=>f(r()).reduceRight(i),C=i=>p=>f(r()).foldLeft(i)(p),$=i=>p=>f(r()).foldRight(i)(p),j=i=>L(t.values.get(i)),G=(i,p)=>L(t.values.get(i)).getOrElse(p),D=()=>t.values.size===0;return{add:l,remove:o,contains:n,get size(){return u()},map:S,flatMap:z,reduce:N,reduceRight:F,foldLeft:C,foldRight:$,get:j,getOrElse:G,get isEmpty(){return D()},orElse:(i,p)=>L(t.values.get(i)).orElse(p),toList:()=>T(r()),toSet:()=>E(r()),toString:()=>`Map(${r().toString()})`}},He=e=>y(e);import P from"safe-stable-stringify";var q=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>q(e),orThrow:t=>e,toEither:()=>s(e),map:t=>ee(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${P(e)})`}),v=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>a(e),map:t=>v(e),flatMap:t=>v(e),toString:()=>`Failure(${P(e)}))`}),ee=e=>{try{return q(e())}catch(t){return v(t instanceof Error?t:new Error(String(t)))}};var c=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>c(e),map:t=>c(t(e)),filter(t){return t(e)?c(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>T([e]),contains:t=>t===e,size:1,toEither:t=>s(e),toString:()=>`Some(${te(e)})`,toValue:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>T([]),contains:()=>!1,size:0,toEither:e=>a(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},A=()=>h,L=e=>e!=null?c(e):A();export{c as a,A as b,L as c,m as d,f as e,E as f,T as g,W as h,s as i,a as j,ve as k,Ve as l,Oe as m,X as n,Y as o,we as p,Z as q,U as r,B as s,M as t,k as u,He as v,ee as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');function e(r){return{..._chunk5O6YELD3js.a.call(void 0, r),toString(){return`${r}()`}}}exports.a = e;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { d as Collection, C as Converters } from '../index-
|
|
1
|
+
export { d as Collection, C as Converters } from '../index-D2YBcdXR.mjs';
|
|
2
2
|
import '../functor/index.mjs';
|
|
3
3
|
import '../identity/Identity.mjs';
|
|
4
4
|
import '../tuple/Tuple.mjs';
|
|
5
5
|
import '../typeable/Typeable.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { d as Collection, C as Converters } from '../index-
|
|
1
|
+
export { d as Collection, C as Converters } from '../index-BT9-eytr.js';
|
|
2
2
|
import '../functor/index.js';
|
|
3
3
|
import '../identity/Identity.js';
|
|
4
4
|
import '../tuple/Tuple.js';
|
|
5
5
|
import '../typeable/Typeable.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSQWNJC6Ojs = require('../../chunk-SQWNJC6O.js');require('../../chunk-5O6YELD3.js');exports.Base = _chunkSQWNJC6Ojs.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-JF5YGNCO.mjs";import"../../chunk-V7DKESTM.mjs";export{a as Base};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Typeable } from '../../typeable/Typeable.mjs';
|
|
2
|
+
|
|
3
|
+
declare const NAME: "Throwable";
|
|
4
|
+
type Throwable = Error & Typeable<typeof NAME> & {
|
|
5
|
+
readonly data?: unknown;
|
|
6
|
+
};
|
|
7
|
+
declare const Throwable: {
|
|
8
|
+
(srcError: unknown, data?: unknown): Throwable;
|
|
9
|
+
NAME: "Throwable";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { Throwable };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Typeable } from '../../typeable/Typeable.js';
|
|
2
|
+
|
|
3
|
+
declare const NAME: "Throwable";
|
|
4
|
+
type Throwable = Error & Typeable<typeof NAME> & {
|
|
5
|
+
readonly data?: unknown;
|
|
6
|
+
};
|
|
7
|
+
declare const Throwable: {
|
|
8
|
+
(srcError: unknown, data?: unknown): Throwable;
|
|
9
|
+
NAME: "Throwable";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { Throwable };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2U34DUZUjs = require('../../chunk-2U34DUZU.js');exports.Throwable = _chunk2U34DUZUjs.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-HD6YYUHO.mjs";export{a as Throwable};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { A as AppException, l as AppResult, n as AsyncTask, m as Task } from '../../index-D2YBcdXR.mjs';
|
|
2
|
+
import '../error/Throwable.mjs';
|
|
3
|
+
import '../../functor/index.mjs';
|
|
4
|
+
import '../../identity/Identity.mjs';
|
|
5
|
+
import '../../tuple/Tuple.mjs';
|
|
6
|
+
import '../../typeable/Typeable.mjs';
|
|
7
|
+
import '../../valuable/Valuable.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { A as AppException, l as AppResult, n as AsyncTask, m as Task } from '../../index-BT9-eytr.js';
|
|
2
|
+
import '../error/Throwable.js';
|
|
3
|
+
import '../../functor/index.js';
|
|
4
|
+
import '../../identity/Identity.js';
|
|
5
|
+
import '../../tuple/Tuple.js';
|
|
6
|
+
import '../../typeable/Typeable.js';
|
|
7
|
+
import '../../valuable/Valuable.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETU42J57js = require('../../chunk-ETU42J57.js');require('../../chunk-OXLZ6UIZ.js');require('../../chunk-BNNK42JC.js');require('../../chunk-SQWNJC6O.js');require('../../chunk-5O6YELD3.js');require('../../chunk-2U34DUZU.js');require('../../chunk-5VTXJIR3.js');require('../../chunk-3VJERXBP.js');require('../../chunk-XORABVON.js');require('../../chunk-K3EKBPQE.js');exports.AppException = _chunkETU42J57js.r; exports.AppResult = _chunkETU42J57js.s; exports.AsyncTask = _chunkETU42J57js.u; exports.Task = _chunkETU42J57js.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,s as b,t as c,u as d}from"../../chunk-JJLIOHWZ.mjs";import"../../chunk-2I2NKDFN.mjs";import"../../chunk-RRAIFS3D.mjs";import"../../chunk-JF5YGNCO.mjs";import"../../chunk-V7DKESTM.mjs";import"../../chunk-HD6YYUHO.mjs";import"../../chunk-377WQNCB.mjs";import"../../chunk-HA5XD5KC.mjs";import"../../chunk-V2J3R5IU.mjs";import"../../chunk-2ML63TYF.mjs";export{a as AppException,b as AppResult,d as AsyncTask,c as Task};
|
package/dist/either/Either.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync
|
|
2
|
+
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-D2YBcdXR.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../identity/Identity.mjs';
|
|
5
5
|
import '../tuple/Tuple.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/either/Either.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import '../functor/index.js';
|
|
2
|
-
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync
|
|
2
|
+
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-BT9-eytr.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
4
|
import '../identity/Identity.js';
|
|
5
5
|
import '../tuple/Tuple.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
package/dist/either/Either.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETU42J57js = require('../chunk-ETU42J57.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Either = _chunkETU42J57js.q; exports.Left = _chunkETU42J57js.j; exports.Right = _chunkETU42J57js.i; exports.TypeCheckLeft = _chunkETU42J57js.o; exports.TypeCheckRight = _chunkETU42J57js.n; exports.isLeft = _chunkETU42J57js.l; exports.isRight = _chunkETU42J57js.k; exports.tryCatch = _chunkETU42J57js.m; exports.tryCatchAsync = _chunkETU42J57js.p;
|
package/dist/either/Either.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i
|
|
1
|
+
import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i}from"../chunk-JJLIOHWZ.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{i as Either,b as Left,a as Right,g as TypeCheckLeft,f as TypeCheckRight,d as isLeft,c as isRight,e as tryCatch,h as tryCatchAsync};
|
|
@@ -2,6 +2,8 @@ import { Type, Functor } from './functor/index.js';
|
|
|
2
2
|
import './identity/Identity.js';
|
|
3
3
|
import { Tuple } from './tuple/Tuple.js';
|
|
4
4
|
import { Typeable } from './typeable/Typeable.js';
|
|
5
|
+
import { Valuable } from './valuable/Valuable.js';
|
|
6
|
+
import { Throwable } from './core/error/Throwable.js';
|
|
5
7
|
|
|
6
8
|
declare const Some: <T extends Type>(value: T) => Option<T>;
|
|
7
9
|
declare const None: <T extends Type>() => Option<T>;
|
|
@@ -28,7 +30,7 @@ type Option<T extends Type> = {
|
|
|
28
30
|
_tag: "Some" | "None";
|
|
29
31
|
value: T;
|
|
30
32
|
};
|
|
31
|
-
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None">);
|
|
33
|
+
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T>);
|
|
32
34
|
declare const Option: <T extends Type>(value: T | null | undefined) => Option<T>;
|
|
33
35
|
|
|
34
36
|
declare const createSeq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
|
|
@@ -134,7 +136,6 @@ declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (e
|
|
|
134
136
|
declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
|
|
135
137
|
declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
|
|
136
138
|
declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
137
|
-
declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
138
139
|
type Either<L extends Type, R extends Type> = {
|
|
139
140
|
readonly _tag: "Left" | "Right";
|
|
140
141
|
value: L | R;
|
|
@@ -170,6 +171,29 @@ declare const Either: {
|
|
|
170
171
|
fromPromise: <L, R>(promise: Promise<R>, onRejected: (reason: unknown) => L) => Promise<Either<L, R>>;
|
|
171
172
|
};
|
|
172
173
|
|
|
174
|
+
type AppException<T> = Either<Throwable, T>;
|
|
175
|
+
/**
|
|
176
|
+
* AppException factory function
|
|
177
|
+
* @param error
|
|
178
|
+
* @param data
|
|
179
|
+
* @constructor
|
|
180
|
+
*/
|
|
181
|
+
declare const AppException: <T>(error: unknown, data?: unknown) => AppException<T>;
|
|
182
|
+
type AppResult<T> = Either<Throwable, T>;
|
|
183
|
+
declare const AppResult: <T>(data: T) => AppResult<T>;
|
|
184
|
+
type Task<T> = Either<Throwable, T>;
|
|
185
|
+
declare function Task<T>(f: () => T, e?: (error: unknown) => unknown): Task<T>;
|
|
186
|
+
declare namespace Task {
|
|
187
|
+
var success: <T>(data: T) => AppResult<T>;
|
|
188
|
+
var fail: <T>(error: unknown) => AppException<T>;
|
|
189
|
+
}
|
|
190
|
+
type AsyncTask<T> = Promise<Task<T>>;
|
|
191
|
+
declare function AsyncTask<T>(f: () => T, e?: (error: unknown) => unknown): AsyncTask<T>;
|
|
192
|
+
declare namespace AsyncTask {
|
|
193
|
+
var success: <T>(data: T) => AppResult<T>;
|
|
194
|
+
var fail: <T>(error: unknown) => AppException<T>;
|
|
195
|
+
}
|
|
196
|
+
|
|
173
197
|
type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
|
|
174
198
|
type Map<K, V> = {
|
|
175
199
|
add(item: Tuple<[K, V]>): Map<K, V>;
|
|
@@ -209,4 +233,4 @@ type Traversable<A extends Type> = Functor<A> & {
|
|
|
209
233
|
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
210
234
|
};
|
|
211
235
|
|
|
212
|
-
export { type Converters as C, Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k,
|
|
236
|
+
export { AppException as A, type Converters as C, Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k, AppResult as l, Task as m, AsyncTask as n, Try as o, type Traversable as p, tryCatch as t };
|
|
@@ -2,6 +2,8 @@ import { Type, Functor } from './functor/index.mjs';
|
|
|
2
2
|
import './identity/Identity.mjs';
|
|
3
3
|
import { Tuple } from './tuple/Tuple.mjs';
|
|
4
4
|
import { Typeable } from './typeable/Typeable.mjs';
|
|
5
|
+
import { Valuable } from './valuable/Valuable.mjs';
|
|
6
|
+
import { Throwable } from './core/error/Throwable.mjs';
|
|
5
7
|
|
|
6
8
|
declare const Some: <T extends Type>(value: T) => Option<T>;
|
|
7
9
|
declare const None: <T extends Type>() => Option<T>;
|
|
@@ -28,7 +30,7 @@ type Option<T extends Type> = {
|
|
|
28
30
|
_tag: "Some" | "None";
|
|
29
31
|
value: T;
|
|
30
32
|
};
|
|
31
|
-
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None">);
|
|
33
|
+
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T>);
|
|
32
34
|
declare const Option: <T extends Type>(value: T | null | undefined) => Option<T>;
|
|
33
35
|
|
|
34
36
|
declare const createSeq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
|
|
@@ -134,7 +136,6 @@ declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (e
|
|
|
134
136
|
declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
|
|
135
137
|
declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
|
|
136
138
|
declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
137
|
-
declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
138
139
|
type Either<L extends Type, R extends Type> = {
|
|
139
140
|
readonly _tag: "Left" | "Right";
|
|
140
141
|
value: L | R;
|
|
@@ -170,6 +171,29 @@ declare const Either: {
|
|
|
170
171
|
fromPromise: <L, R>(promise: Promise<R>, onRejected: (reason: unknown) => L) => Promise<Either<L, R>>;
|
|
171
172
|
};
|
|
172
173
|
|
|
174
|
+
type AppException<T> = Either<Throwable, T>;
|
|
175
|
+
/**
|
|
176
|
+
* AppException factory function
|
|
177
|
+
* @param error
|
|
178
|
+
* @param data
|
|
179
|
+
* @constructor
|
|
180
|
+
*/
|
|
181
|
+
declare const AppException: <T>(error: unknown, data?: unknown) => AppException<T>;
|
|
182
|
+
type AppResult<T> = Either<Throwable, T>;
|
|
183
|
+
declare const AppResult: <T>(data: T) => AppResult<T>;
|
|
184
|
+
type Task<T> = Either<Throwable, T>;
|
|
185
|
+
declare function Task<T>(f: () => T, e?: (error: unknown) => unknown): Task<T>;
|
|
186
|
+
declare namespace Task {
|
|
187
|
+
var success: <T>(data: T) => AppResult<T>;
|
|
188
|
+
var fail: <T>(error: unknown) => AppException<T>;
|
|
189
|
+
}
|
|
190
|
+
type AsyncTask<T> = Promise<Task<T>>;
|
|
191
|
+
declare function AsyncTask<T>(f: () => T, e?: (error: unknown) => unknown): AsyncTask<T>;
|
|
192
|
+
declare namespace AsyncTask {
|
|
193
|
+
var success: <T>(data: T) => AppResult<T>;
|
|
194
|
+
var fail: <T>(error: unknown) => AppException<T>;
|
|
195
|
+
}
|
|
196
|
+
|
|
173
197
|
type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
|
|
174
198
|
type Map<K, V> = {
|
|
175
199
|
add(item: Tuple<[K, V]>): Map<K, V>;
|
|
@@ -209,4 +233,4 @@ type Traversable<A extends Type> = Functor<A> & {
|
|
|
209
233
|
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
210
234
|
};
|
|
211
235
|
|
|
212
|
-
export { type Converters as C, Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k,
|
|
236
|
+
export { AppException as A, type Converters as C, Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k, AppResult as l, Task as m, AsyncTask as n, Try as o, type Traversable as p, tryCatch as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.mjs';
|
|
2
|
-
export { E as Either, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList,
|
|
2
|
+
export { A as AppException, l as AppResult, n as AsyncTask, E as Either, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, m as Task, e as TestEither, T as TestList, p as Traversable, o as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-D2YBcdXR.mjs';
|
|
3
3
|
export { Identity } from './identity/Identity.mjs';
|
|
4
4
|
export { Tuple } from './tuple/Tuple.mjs';
|
|
5
5
|
export { Typeable } from './typeable/Typeable.mjs';
|
|
6
|
+
import './valuable/Valuable.mjs';
|
|
7
|
+
import './core/error/Throwable.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.js';
|
|
2
|
-
export { E as Either, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList,
|
|
2
|
+
export { A as AppException, l as AppResult, n as AsyncTask, E as Either, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, m as Task, e as TestEither, T as TestList, p as Traversable, o as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-BT9-eytr.js';
|
|
3
3
|
export { Identity } from './identity/Identity.js';
|
|
4
4
|
export { Tuple } from './tuple/Tuple.js';
|
|
5
5
|
export { Typeable } from './typeable/Typeable.js';
|
|
6
|
+
import './valuable/Valuable.js';
|
|
7
|
+
import './core/error/Throwable.js';
|
package/dist/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 _chunkETU42J57js = require('./chunk-ETU42J57.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');require('./chunk-BNNK42JC.js');require('./chunk-SQWNJC6O.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-2U34DUZU.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');require('./chunk-XORABVON.js');require('./chunk-K3EKBPQE.js');exports.AppException = _chunkETU42J57js.r; exports.AppResult = _chunkETU42J57js.s; exports.AsyncTask = _chunkETU42J57js.u; exports.Either = _chunkETU42J57js.q; exports.Left = _chunkETU42J57js.j; exports.List = _chunkETU42J57js.g; exports.Map = _chunkETU42J57js.v; exports.None = _chunkETU42J57js.b; exports.Option = _chunkETU42J57js.c; exports.Right = _chunkETU42J57js.i; exports.Seq = _chunkETU42J57js.e; exports.Set = _chunkETU42J57js.f; exports.Some = _chunkETU42J57js.a; exports.Task = _chunkETU42J57js.t; exports.TestList = _chunkETU42J57js.h; exports.Try = _chunkETU42J57js.w; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkETU42J57js.o; exports.TypeCheckRight = _chunkETU42J57js.n; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkETU42J57js.l; exports.isRight = _chunkETU42J57js.k; exports.tryCatch = _chunkETU42J57js.m; exports.tryCatchAsync = _chunkETU42J57js.p;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as
|
|
1
|
+
import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r,s,t,u,v as w,w as x}from"./chunk-JJLIOHWZ.mjs";import{a as v}from"./chunk-2I2NKDFN.mjs";import"./chunk-RRAIFS3D.mjs";import"./chunk-JF5YGNCO.mjs";import{a as q}from"./chunk-V7DKESTM.mjs";import"./chunk-HD6YYUHO.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import"./chunk-V2J3R5IU.mjs";import"./chunk-2ML63TYF.mjs";export{r as AppException,s as AppResult,u as AsyncTask,p as Either,i as Left,f as List,w as Map,b as None,c as Option,h as Right,d as Seq,e as Set,a as Some,t as Task,g as TestList,x as Try,v as Tuple,n as TypeCheckLeft,m as TypeCheckRight,q as Typeable,k as isLeft,j as isRight,l as tryCatch,o as tryCatchAsync};
|
package/dist/iterable/Seq.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { a as Seq, c as createSeq } from '../index-
|
|
1
|
+
export { a as Seq, c as createSeq } from '../index-D2YBcdXR.mjs';
|
|
2
2
|
import '../typeable/Typeable.mjs';
|
|
3
3
|
import '../functor/index.mjs';
|
|
4
4
|
import '../identity/Identity.mjs';
|
|
5
5
|
import '../tuple/Tuple.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/iterable/Seq.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { a as Seq, c as createSeq } from '../index-
|
|
1
|
+
export { a as Seq, c as createSeq } from '../index-BT9-eytr.js';
|
|
2
2
|
import '../typeable/Typeable.js';
|
|
3
3
|
import '../functor/index.js';
|
|
4
4
|
import '../identity/Identity.js';
|
|
5
5
|
import '../tuple/Tuple.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
package/dist/iterable/Seq.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETU42J57js = require('../chunk-ETU42J57.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkETU42J57js.e; exports.createSeq = _chunkETU42J57js.d;
|
package/dist/iterable/Seq.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,e as b}from"../chunk-
|
|
1
|
+
import{d as a,e as b}from"../chunk-JJLIOHWZ.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Seq,a as createSeq};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { a as Seq, _ as _Iterable_ } from '../index-
|
|
2
|
+
export { a as Seq, _ as _Iterable_ } from '../index-D2YBcdXR.mjs';
|
|
3
3
|
import '../identity/Identity.mjs';
|
|
4
4
|
import '../tuple/Tuple.mjs';
|
|
5
5
|
import '../typeable/Typeable.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/iterable/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import '../functor/index.js';
|
|
2
|
-
export { a as Seq, _ as _Iterable_ } from '../index-
|
|
2
|
+
export { a as Seq, _ as _Iterable_ } from '../index-BT9-eytr.js';
|
|
3
3
|
import '../identity/Identity.js';
|
|
4
4
|
import '../tuple/Tuple.js';
|
|
5
5
|
import '../typeable/Typeable.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
package/dist/iterable/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 _chunkETU42J57js = require('../chunk-ETU42J57.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkETU42J57js.e;
|
package/dist/iterable/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"../chunk-
|
|
1
|
+
import{e as a}from"../chunk-JJLIOHWZ.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Seq};
|
package/dist/list/List.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { L as List, T as TestList } from '../index-
|
|
1
|
+
export { L as List, T as TestList } from '../index-D2YBcdXR.mjs';
|
|
2
2
|
import '../typeable/Typeable.mjs';
|
|
3
3
|
import '../functor/index.mjs';
|
|
4
4
|
import '../identity/Identity.mjs';
|
|
5
5
|
import '../tuple/Tuple.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/list/List.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { L as List, T as TestList } from '../index-
|
|
1
|
+
export { L as List, T as TestList } from '../index-BT9-eytr.js';
|
|
2
2
|
import '../typeable/Typeable.js';
|
|
3
3
|
import '../functor/index.js';
|
|
4
4
|
import '../identity/Identity.js';
|
|
5
5
|
import '../tuple/Tuple.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
package/dist/list/List.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETU42J57js = require('../chunk-ETU42J57.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.List = _chunkETU42J57js.g; exports.TestList = _chunkETU42J57js.h;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as a,h as b}from"../chunk-
|
|
1
|
+
import{g as a,h as b}from"../chunk-JJLIOHWZ.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as List,b as TestList};
|
package/dist/map/Map.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { M as Map } from '../index-
|
|
1
|
+
export { M as Map } from '../index-D2YBcdXR.mjs';
|
|
2
2
|
import '../tuple/Tuple.mjs';
|
|
3
3
|
import '../functor/index.mjs';
|
|
4
4
|
import '../identity/Identity.mjs';
|
|
5
5
|
import '../typeable/Typeable.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/map/Map.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { M as Map } from '../index-
|
|
1
|
+
export { M as Map } from '../index-BT9-eytr.js';
|
|
2
2
|
import '../tuple/Tuple.js';
|
|
3
3
|
import '../functor/index.js';
|
|
4
4
|
import '../identity/Identity.js';
|
|
5
5
|
import '../typeable/Typeable.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
package/dist/map/Map.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETU42J57js = require('../chunk-ETU42J57.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Map = _chunkETU42J57js.v;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{v as a}from"../chunk-JJLIOHWZ.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Map};
|
package/dist/option/Option.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { N as None, O as Option, S as Some } from '../index-
|
|
2
|
+
export { N as None, O as Option, S as Some } from '../index-D2YBcdXR.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
|
+
import '../valuable/Valuable.mjs';
|
|
4
5
|
import '../identity/Identity.mjs';
|
|
5
6
|
import '../tuple/Tuple.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/option/Option.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import '../functor/index.js';
|
|
2
|
-
export { N as None, O as Option, S as Some } from '../index-
|
|
2
|
+
export { N as None, O as Option, S as Some } from '../index-BT9-eytr.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
|
+
import '../valuable/Valuable.js';
|
|
4
5
|
import '../identity/Identity.js';
|
|
5
6
|
import '../tuple/Tuple.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|
package/dist/option/Option.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETU42J57js = require('../chunk-ETU42J57.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.None = _chunkETU42J57js.b; exports.Option = _chunkETU42J57js.c; exports.Some = _chunkETU42J57js.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-JJLIOHWZ.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as None,c as Option,a as Some};
|
package/dist/set/Set.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { b as Set } from '../index-
|
|
1
|
+
export { b as Set } from '../index-D2YBcdXR.mjs';
|
|
2
2
|
import '../functor/index.mjs';
|
|
3
3
|
import '../identity/Identity.mjs';
|
|
4
4
|
import '../tuple/Tuple.mjs';
|
|
5
5
|
import '../typeable/Typeable.mjs';
|
|
6
|
+
import '../valuable/Valuable.mjs';
|
|
7
|
+
import '../core/error/Throwable.mjs';
|
package/dist/set/Set.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { b as Set } from '../index-
|
|
1
|
+
export { b as Set } from '../index-BT9-eytr.js';
|
|
2
2
|
import '../functor/index.js';
|
|
3
3
|
import '../identity/Identity.js';
|
|
4
4
|
import '../tuple/Tuple.js';
|
|
5
5
|
import '../typeable/Typeable.js';
|
|
6
|
+
import '../valuable/Valuable.js';
|
|
7
|
+
import '../core/error/Throwable.js';
|