functype 0.8.19 → 0.8.20
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-MGOOHJA4.mjs +1 -0
- package/dist/chunk-ZT6U462C.js +1 -0
- package/dist/collections/index.d.mts +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/either/Either.d.mts +1 -1
- package/dist/either/Either.d.ts +1 -1
- package/dist/either/Either.js +1 -1
- package/dist/either/Either.mjs +1 -1
- package/dist/either/EitherT.d.mts +1 -1
- package/dist/either/EitherT.d.ts +1 -1
- package/dist/either/EitherT.js +1 -1
- package/dist/either/EitherT.mjs +1 -1
- package/dist/{index-i5kzqn22.d.ts → index-DEY28JXj.d.ts} +40 -26
- package/dist/{index-CZsKzO-N.d.mts → index-DxbBrdj_.d.mts} +40 -26
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/Seq.d.mts +1 -1
- package/dist/iterable/Seq.d.ts +1 -1
- package/dist/iterable/Seq.js +1 -1
- package/dist/iterable/Seq.mjs +1 -1
- package/dist/iterable/index.d.mts +1 -1
- package/dist/iterable/index.d.ts +1 -1
- package/dist/iterable/index.js +1 -1
- package/dist/iterable/index.mjs +1 -1
- package/dist/list/List.d.mts +1 -1
- package/dist/list/List.d.ts +1 -1
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/map/Map.d.mts +1 -1
- package/dist/map/Map.d.ts +1 -1
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/option/Option.d.mts +1 -1
- package/dist/option/Option.d.ts +1 -1
- package/dist/option/Option.js +1 -1
- package/dist/option/Option.mjs +1 -1
- package/dist/set/Set.d.mts +1 -1
- package/dist/set/Set.d.ts +1 -1
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/try/Try.d.mts +1 -1
- package/dist/try/Try.d.ts +1 -1
- package/dist/try/Try.js +1 -1
- package/dist/try/Try.mjs +1 -1
- package/dist/util/index.d.mts +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.js +1 -1
- package/dist/util/index.mjs +1 -1
- package/lib/either/Either.d.ts +39 -26
- package/lib/option/Option.d.ts +2 -3
- package/package.json +1 -1
- package/dist/chunk-BTEQN6BB.mjs +0 -1
- package/dist/chunk-RGJRKBXI.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as V}from"./chunk-2I2NKDFN.mjs";import{a as h}from"./chunk-RRAIFS3D.mjs";import{a as B}from"./chunk-377WQNCB.mjs";import{a as b}from"./chunk-HA5XD5KC.mjs";var U=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>U(e),mapAsync:async t=>U(e),flatMap:t=>U(e),flatMapAsync:async t=>U(e),toOption:()=>g(),toList:()=>g().toList(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),v=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>v(t(e)),mapAsync:async t=>v(await t(e)),flatMap:t=>t(e),flatMapAsync:t=>t(e),toOption:()=>c(e),toList:()=>c(e).toList(),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),l=e=>U(e),u=e=>v(e),x=e=>e._tag==="Left",E=e=>e._tag==="Right",W=(e,t)=>{try{return u(e())}catch(r){return l(t(r))}},X=async(e,t)=>{try{let r=await e();return u(r)}catch(r){return l(t(r))}};function _(e){return{value:e,map(t){let r=e.then(o=>{if(E(o))try{let a=t(o.value);return u(a)}catch(a){return l(a)}else return l(o.value)});return _(r)},flatMap(t){let r=e.then(o=>{if(E(o))try{return t(o.value).value}catch(a){return Promise.resolve(l(a))}else return Promise.resolve(l(o.value))});return _(r)},mapLeft(t){let r=e.then(o=>{if(x(o))try{let a=t(o.value);return l(a)}catch(a){return l(a)}else return u(o.value)});return _(r)},fold(t,r){return e.then(o=>E(o)?r(o.value):t(o.value))}}}var d=e=>{let t=h(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>L(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?L(r[0]):g()},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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,p)=>a(p,n),o),valueOf:()=>({values:r})}},f=e=>d(e);var y=e=>{let t=h(e)?new b(e):new b(e?.toArray()??[]),r=f(t),o={...r,add:a=>y([...t,a]),remove:a=>{let n=new b(t);return n.delete(a),y(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>y(r.map(a)),flatMap:a=>y(r.flatMap(a)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},S=e=>y(e);var T=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=f(r),a={...o,_tag:"List",length:r.length,map:n=>T(r.map(n)),flatMap:n=>T(o.flatMap(n)),remove:n=>{let p=r.indexOf(n);return a.removeAt(p)},contains:n=>r.includes(n),add:n=>T([...r,n]),removeAt:n=>n<0||n>=r.length?a:T([...r.slice(0,n),...r.slice(n+1)]),get:n=>L(r[n]),concat:n=>T([...r,...n.toArray()]),toList:()=>a,toSet:()=>S(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,p){return typeof p=="symbol"||isNaN(Number(p))?n[p]:n.get(Number(p))}})},A=e=>T(e);var m=e=>{let t={values:new B(e)},r=()=>Array.from(t.values.entries()).map(([i,s])=>V([i,s])),o=i=>m(new B(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let s=new B(t.values);return s.delete(i)?m(s.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],p=()=>t.values.size,M=i=>m(Array.from(t.values.entries()).map(([s,C])=>[s,i(C)])),I=i=>{let s=m(t.values.entries()).toList();return m(s.flatMap(i).toArray())},w=i=>f(r()).reduce(i),P=i=>f(r()).reduceRight(i),N=i=>s=>f(r()).foldLeft(i)(s),z=i=>s=>f(r()).foldRight(i)(s),F=i=>L(t.values.get(i)),q=(i,s)=>L(t.values.get(i)).getOrElse(s),k=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return p()},map:M,flatMap:I,reduce:w,reduceRight:P,foldLeft:N,foldRight:z,get:F,getOrElse:q,get isEmpty(){return k()},orElse:(i,s)=>L(t.values.get(i)).orElse(s),toList:()=>A(r()),toSet:()=>S(r()),toString:()=>`Map(${r().toString()})`}},ve=e=>m(e);var K=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>K(e),orThrow:t=>e,toEither:()=>u(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),O=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:()=>l(e),map:t=>O(e),flatMap:t=>O(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$=e=>{try{return K(e())}catch(t){return O(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):R},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:()=>A([e]),contains:t=>t===e,size:1,toEither:t=>u(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_tag:"Some",value:e})}),R={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>R,filter(e){return R},flatMap:e=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>A([]),contains:()=>!1,size:0,toEither:e=>l(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},g=()=>R,L=e=>e!=null?c(e):g();export{c as a,g as b,L as c,l as d,u as e,x as f,E as g,W as h,X as i,_ as j,d as k,f as l,S as m,A as n,ve as o,$ as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var U=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>U(e),mapAsync:async t=>U(e),flatMap:t=>U(e),flatMapAsync:async t=>U(e),toOption:()=>g(),toList:()=>g().toList(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),v=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>v(t(e)),mapAsync:async t=>v(await t(e)),flatMap:t=>t(e),flatMapAsync:t=>t(e),toOption:()=>c(e),toList:()=>c(e).toList(),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),l= exports.d =e=>U(e),u= exports.e =e=>v(e),x= exports.f =e=>e._tag==="Left",E= exports.g =e=>e._tag==="Right",W= exports.h =(e,t)=>{try{return u(e())}catch(r){return l(t(r))}},X= exports.i =async(e,t)=>{try{let r=await e();return u(r)}catch(r){return l(t(r))}};function _(e){return{value:e,map(t){let r=e.then(o=>{if(E(o))try{let a=t(o.value);return u(a)}catch(a){return l(a)}else return l(o.value)});return _(r)},flatMap(t){let r=e.then(o=>{if(E(o))try{return t(o.value).value}catch(a){return Promise.resolve(l(a))}else return Promise.resolve(l(o.value))});return _(r)},mapLeft(t){let r=e.then(o=>{if(x(o))try{let a=t(o.value);return l(a)}catch(a){return l(a)}else return u(o.value)});return _(r)},fold(t,r){return e.then(o=>E(o)?r(o.value):t(o.value))}}}var d=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>L(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?L(r[0]):g()},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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,p)=>a(p,n),o),valueOf:()=>({values:r})}},f= exports.l =e=>d(e);var y=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),o={...r,add:a=>y([...t,a]),remove:a=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(a),y(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>y(r.map(a)),flatMap:a=>y(r.flatMap(a)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},S= exports.m =e=>y(e);var T=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=f(r),a={...o,_tag:"List",length:r.length,map:n=>T(r.map(n)),flatMap:n=>T(o.flatMap(n)),remove:n=>{let p=r.indexOf(n);return a.removeAt(p)},contains:n=>r.includes(n),add:n=>T([...r,n]),removeAt:n=>n<0||n>=r.length?a:T([...r.slice(0,n),...r.slice(n+1)]),get:n=>L(r[n]),concat:n=>T([...r,...n.toArray()]),toList:()=>a,toSet:()=>S(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,p){return typeof p=="symbol"||isNaN(Number(p))?n[p]:n.get(Number(p))}})},A= exports.n =e=>T(e);var m=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,s])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,s])),o=i=>m(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let s=new (0, _chunk5VTXJIR3js.a)(t.values);return s.delete(i)?m(s.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],p=()=>t.values.size,M=i=>m(Array.from(t.values.entries()).map(([s,C])=>[s,i(C)])),I=i=>{let s=m(t.values.entries()).toList();return m(s.flatMap(i).toArray())},w=i=>f(r()).reduce(i),P=i=>f(r()).reduceRight(i),N=i=>s=>f(r()).foldLeft(i)(s),z=i=>s=>f(r()).foldRight(i)(s),F=i=>L(t.values.get(i)),q=(i,s)=>L(t.values.get(i)).getOrElse(s),k=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return p()},map:M,flatMap:I,reduce:w,reduceRight:P,foldLeft:N,foldRight:z,get:F,getOrElse:q,get isEmpty(){return k()},orElse:(i,s)=>L(t.values.get(i)).orElse(s),toList:()=>A(r()),toSet:()=>S(r()),toString:()=>`Map(${r().toString()})`}},ve= exports.o =e=>m(e);var K=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>K(e),orThrow:t=>e,toEither:()=>u(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),O=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:()=>l(e),map:t=>O(e),flatMap:t=>O(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$= exports.p =e=>{try{return K(e())}catch(t){return O(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):R},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:()=>A([e]),contains:t=>t===e,size:1,toEither:t=>u(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_tag:"Some",value:e})}),R={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>R,filter(e){return R},flatMap:e=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>A([]),contains:()=>!1,size:0,toEither:e=>l(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},g= exports.b =()=>R,L= exports.c =e=>e!=null?c(e):g();exports.a = c; exports.b = g; exports.c = L; exports.d = l; exports.e = u; exports.f = x; exports.g = E; exports.h = W; exports.i = X; exports.j = _; exports.k = d; exports.l = f; exports.m = S; exports.n = A; exports.o = ve; exports.p = $;
|
package/dist/either/Either.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { E as Either, e as Left, R as Right,
|
|
2
|
+
export { E as Either, e as Left, R as Right, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from '../index-DxbBrdj_.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../identity/Identity.mjs';
|
|
5
5
|
import '../tuple/Tuple.mjs';
|
package/dist/either/Either.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.js';
|
|
2
|
-
export { E as Either, e as Left, R as Right,
|
|
2
|
+
export { E as Either, e as Left, R as Right, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from '../index-DEY28JXj.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
4
|
import '../identity/Identity.js';
|
|
5
5
|
import '../tuple/Tuple.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 _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Left = _chunkZT6U462Cjs.d; exports.Right = _chunkZT6U462Cjs.e; exports.isLeft = _chunkZT6U462Cjs.f; exports.isRight = _chunkZT6U462Cjs.g; exports.tryCatch = _chunkZT6U462Cjs.h; exports.tryCatchAsync = _chunkZT6U462Cjs.i;
|
package/dist/either/Either.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Left,b as Right,c as isLeft,d as isRight,e as tryCatch,f as tryCatchAsync};
|
package/dist/either/EitherT.d.ts
CHANGED
package/dist/either/EitherT.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.EitherT = _chunkZT6U462Cjs.j;
|
package/dist/either/EitherT.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{j as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as EitherT};
|
|
@@ -19,7 +19,7 @@ type Option<T extends Type> = {
|
|
|
19
19
|
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
20
20
|
foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
|
|
21
21
|
foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
|
|
22
|
-
toList():
|
|
22
|
+
toList(): List<T>;
|
|
23
23
|
contains(value: T): boolean;
|
|
24
24
|
size: number;
|
|
25
25
|
valueOf(): {
|
|
@@ -117,37 +117,51 @@ type List<A> = ({
|
|
|
117
117
|
} & ArrayLike<A>) & (_Iterable_<A> & Collection<A> & Typeable<"List">);
|
|
118
118
|
declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
|
|
119
119
|
|
|
120
|
-
type Either<L
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
type Either<L, R> = Left<L, R> | Right<L, R>;
|
|
121
|
+
type Left<L, R> = {
|
|
122
|
+
readonly _tag: "Left";
|
|
123
|
+
readonly value: L;
|
|
124
|
+
isLeft: () => true;
|
|
125
|
+
isRight: () => false;
|
|
125
126
|
getOrElse: (defaultValue: R) => R;
|
|
126
127
|
getOrThrow: () => R;
|
|
127
|
-
map: <U
|
|
128
|
-
mapAsync: <U
|
|
129
|
-
flatMap: <U
|
|
130
|
-
flatMapAsync: <U
|
|
128
|
+
map: <U>(f: (value: R) => U) => Left<L, U>;
|
|
129
|
+
mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Left<L, U>>;
|
|
130
|
+
flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Left<L | L1, U>;
|
|
131
|
+
flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Left<L | L1, U>>;
|
|
131
132
|
toOption: () => Option<R>;
|
|
132
133
|
toList: () => List<R>;
|
|
133
134
|
valueOf: () => {
|
|
134
|
-
_tag: "Left"
|
|
135
|
-
value: L
|
|
135
|
+
_tag: "Left";
|
|
136
|
+
value: L;
|
|
136
137
|
};
|
|
137
138
|
toString: () => string;
|
|
138
|
-
} &
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
value: L
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
} & Typeable<"Left">;
|
|
140
|
+
declare const Left: <L, R>(value: L) => Left<L, R>;
|
|
141
|
+
type Right<L, R> = {
|
|
142
|
+
readonly _tag: "Right";
|
|
143
|
+
readonly value: R;
|
|
144
|
+
isLeft: () => false;
|
|
145
|
+
isRight: () => true;
|
|
146
|
+
getOrElse: (defaultValue: R) => R;
|
|
147
|
+
getOrThrow: () => R;
|
|
148
|
+
map: <U>(f: (value: R) => U) => Right<L, U>;
|
|
149
|
+
mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Right<L, U>>;
|
|
150
|
+
flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Either<L | L1, U>;
|
|
151
|
+
flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Either<L | L1, U>>;
|
|
152
|
+
toOption: () => Option<R>;
|
|
153
|
+
toList: () => List<R>;
|
|
154
|
+
valueOf: () => {
|
|
155
|
+
_tag: "Right";
|
|
156
|
+
value: R;
|
|
157
|
+
};
|
|
158
|
+
toString: () => string;
|
|
159
|
+
} & Functor<R> & Typeable<"Right">;
|
|
160
|
+
declare const Right: <L, R>(value: R) => Right<L, R>;
|
|
161
|
+
declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L, R>;
|
|
162
|
+
declare const isRight: <L, R>(either: Either<L, R>) => either is Right<L, R>;
|
|
163
|
+
declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
164
|
+
declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
151
165
|
|
|
152
166
|
type EitherT<L, R> = {
|
|
153
167
|
value: Promise<Either<L, R>>;
|
|
@@ -202,4 +216,4 @@ type Traversable<A extends Type> = Functor<A> & {
|
|
|
202
216
|
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
203
217
|
};
|
|
204
218
|
|
|
205
|
-
export { type Converters as C, type Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, Try as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, Left as e,
|
|
219
|
+
export { type Converters as C, type Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, Try as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, Left as e, isRight as f, tryCatchAsync as g, EitherT as h, isLeft as i, type Traversable as j, tryCatch as t };
|
|
@@ -19,7 +19,7 @@ type Option<T extends Type> = {
|
|
|
19
19
|
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
20
20
|
foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
|
|
21
21
|
foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
|
|
22
|
-
toList():
|
|
22
|
+
toList(): List<T>;
|
|
23
23
|
contains(value: T): boolean;
|
|
24
24
|
size: number;
|
|
25
25
|
valueOf(): {
|
|
@@ -117,37 +117,51 @@ type List<A> = ({
|
|
|
117
117
|
} & ArrayLike<A>) & (_Iterable_<A> & Collection<A> & Typeable<"List">);
|
|
118
118
|
declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
|
|
119
119
|
|
|
120
|
-
type Either<L
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
type Either<L, R> = Left<L, R> | Right<L, R>;
|
|
121
|
+
type Left<L, R> = {
|
|
122
|
+
readonly _tag: "Left";
|
|
123
|
+
readonly value: L;
|
|
124
|
+
isLeft: () => true;
|
|
125
|
+
isRight: () => false;
|
|
125
126
|
getOrElse: (defaultValue: R) => R;
|
|
126
127
|
getOrThrow: () => R;
|
|
127
|
-
map: <U
|
|
128
|
-
mapAsync: <U
|
|
129
|
-
flatMap: <U
|
|
130
|
-
flatMapAsync: <U
|
|
128
|
+
map: <U>(f: (value: R) => U) => Left<L, U>;
|
|
129
|
+
mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Left<L, U>>;
|
|
130
|
+
flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Left<L | L1, U>;
|
|
131
|
+
flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Left<L | L1, U>>;
|
|
131
132
|
toOption: () => Option<R>;
|
|
132
133
|
toList: () => List<R>;
|
|
133
134
|
valueOf: () => {
|
|
134
|
-
_tag: "Left"
|
|
135
|
-
value: L
|
|
135
|
+
_tag: "Left";
|
|
136
|
+
value: L;
|
|
136
137
|
};
|
|
137
138
|
toString: () => string;
|
|
138
|
-
} &
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
value: L
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
} & Typeable<"Left">;
|
|
140
|
+
declare const Left: <L, R>(value: L) => Left<L, R>;
|
|
141
|
+
type Right<L, R> = {
|
|
142
|
+
readonly _tag: "Right";
|
|
143
|
+
readonly value: R;
|
|
144
|
+
isLeft: () => false;
|
|
145
|
+
isRight: () => true;
|
|
146
|
+
getOrElse: (defaultValue: R) => R;
|
|
147
|
+
getOrThrow: () => R;
|
|
148
|
+
map: <U>(f: (value: R) => U) => Right<L, U>;
|
|
149
|
+
mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Right<L, U>>;
|
|
150
|
+
flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Either<L | L1, U>;
|
|
151
|
+
flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Either<L | L1, U>>;
|
|
152
|
+
toOption: () => Option<R>;
|
|
153
|
+
toList: () => List<R>;
|
|
154
|
+
valueOf: () => {
|
|
155
|
+
_tag: "Right";
|
|
156
|
+
value: R;
|
|
157
|
+
};
|
|
158
|
+
toString: () => string;
|
|
159
|
+
} & Functor<R> & Typeable<"Right">;
|
|
160
|
+
declare const Right: <L, R>(value: R) => Right<L, R>;
|
|
161
|
+
declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L, R>;
|
|
162
|
+
declare const isRight: <L, R>(either: Either<L, R>) => either is Right<L, R>;
|
|
163
|
+
declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
164
|
+
declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
151
165
|
|
|
152
166
|
type EitherT<L, R> = {
|
|
153
167
|
value: Promise<Either<L, R>>;
|
|
@@ -202,4 +216,4 @@ type Traversable<A extends Type> = Functor<A> & {
|
|
|
202
216
|
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
203
217
|
};
|
|
204
218
|
|
|
205
|
-
export { type Converters as C, type Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, Try as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, Left as e,
|
|
219
|
+
export { type Converters as C, type Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, Try as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, Left as e, isRight as f, tryCatchAsync as g, EitherT as h, isLeft as i, type Traversable as j, tryCatch as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.mjs';
|
|
2
|
-
export { E as Either, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_,
|
|
2
|
+
export { E as Either, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from './index-DxbBrdj_.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';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.js';
|
|
2
|
-
export { E as Either, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_,
|
|
2
|
+
export { E as Either, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from './index-DEY28JXj.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';
|
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 _chunkZT6U462Cjs = require('./chunk-ZT6U462C.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');require('./chunk-BNNK42JC.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-K3EKBPQE.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');require('./chunk-XORABVON.js');exports.EitherT = _chunkZT6U462Cjs.j; exports.Left = _chunkZT6U462Cjs.d; exports.List = _chunkZT6U462Cjs.n; exports.Map = _chunkZT6U462Cjs.o; exports.None = _chunkZT6U462Cjs.b; exports.Option = _chunkZT6U462Cjs.c; exports.Right = _chunkZT6U462Cjs.e; exports.Seq = _chunkZT6U462Cjs.l; exports.Set = _chunkZT6U462Cjs.m; exports.Some = _chunkZT6U462Cjs.a; exports.Try = _chunkZT6U462Cjs.p; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkZT6U462Cjs.f; exports.isRight = _chunkZT6U462Cjs.g; exports.tryCatch = _chunkZT6U462Cjs.h; exports.tryCatchAsync = _chunkZT6U462Cjs.i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,l as k,m as l,n as m,o,p}from"./chunk-MGOOHJA4.mjs";import{a as n}from"./chunk-2I2NKDFN.mjs";import"./chunk-RRAIFS3D.mjs";import{a as q}from"./chunk-V7DKESTM.mjs";import"./chunk-2ML63TYF.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import"./chunk-V2J3R5IU.mjs";export{j as EitherT,d as Left,m as List,o as Map,b as None,c as Option,e as Right,k as Seq,l as Set,a as Some,p as Try,n as Tuple,q as Typeable,f as isLeft,g as isRight,h as tryCatch,i as tryCatchAsync};
|
package/dist/iterable/Seq.d.mts
CHANGED
package/dist/iterable/Seq.d.ts
CHANGED
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 _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Seq = _chunkZT6U462Cjs.l; exports.createSeq = _chunkZT6U462Cjs.k;
|
package/dist/iterable/Seq.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{k as a,l as b}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{b as Seq,a as createSeq};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { a as Seq, _ as _Iterable_ } from '../index-
|
|
2
|
+
export { a as Seq, _ as _Iterable_ } from '../index-DxbBrdj_.mjs';
|
|
3
3
|
import '../identity/Identity.mjs';
|
|
4
4
|
import '../tuple/Tuple.mjs';
|
|
5
5
|
import '../typeable/Typeable.mjs';
|
package/dist/iterable/index.d.ts
CHANGED
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 _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Seq = _chunkZT6U462Cjs.l;
|
package/dist/iterable/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{l as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Seq};
|
package/dist/list/List.d.mts
CHANGED
package/dist/list/List.d.ts
CHANGED
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 _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.List = _chunkZT6U462Cjs.n;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as List};
|
package/dist/map/Map.d.mts
CHANGED
package/dist/map/Map.d.ts
CHANGED
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 _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Map = _chunkZT6U462Cjs.o;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as a}from"../chunk-
|
|
1
|
+
import{o as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Map};
|
package/dist/option/Option.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-DxbBrdj_.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../identity/Identity.mjs';
|
|
5
5
|
import '../tuple/Tuple.mjs';
|
package/dist/option/Option.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-DEY28JXj.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
4
|
import '../identity/Identity.js';
|
|
5
5
|
import '../tuple/Tuple.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 _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.None = _chunkZT6U462Cjs.b; exports.Option = _chunkZT6U462Cjs.c; exports.Some = _chunkZT6U462Cjs.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{b as None,c as Option,a as Some};
|
package/dist/set/Set.d.mts
CHANGED
package/dist/set/Set.d.ts
CHANGED
package/dist/set/Set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Set = _chunkZT6U462Cjs.m;
|
package/dist/set/Set.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{m as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Set};
|
package/dist/try/Try.d.mts
CHANGED
package/dist/try/Try.d.ts
CHANGED
package/dist/try/Try.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Try = _chunkZT6U462Cjs.p;
|
package/dist/try/Try.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a}from"../chunk-
|
|
1
|
+
import{p as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Try};
|
package/dist/util/index.d.mts
CHANGED
package/dist/util/index.d.ts
CHANGED
package/dist/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkZT6U462Cjs.d.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkZT6U462Cjs.e.call(void 0, r)};exports.parseNumber = a;
|
package/dist/util/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"../chunk-VK5GL6NM.mjs";import{
|
|
1
|
+
import{a as s}from"../chunk-VK5GL6NM.mjs";import{d as e,e as t}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?e(s(`${r}`)):t(r)};export{a as parseNumber};
|
package/lib/either/Either.d.ts
CHANGED
|
@@ -1,36 +1,49 @@
|
|
|
1
|
-
import { Functor
|
|
1
|
+
import { Functor } from "../functor";
|
|
2
2
|
import { List } from "../list/List";
|
|
3
3
|
import { Option } from "../option/Option";
|
|
4
4
|
import { Typeable } from "../typeable/Typeable";
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
isLeft: () => boolean;
|
|
11
|
-
isRight: () => boolean;
|
|
5
|
+
export type Left<L, R> = {
|
|
6
|
+
readonly _tag: "Left";
|
|
7
|
+
readonly value: L;
|
|
8
|
+
isLeft: () => true;
|
|
9
|
+
isRight: () => false;
|
|
12
10
|
getOrElse: (defaultValue: R) => R;
|
|
13
11
|
getOrThrow: () => R;
|
|
14
|
-
map: <U
|
|
15
|
-
mapAsync: <U
|
|
16
|
-
flatMap: <U
|
|
17
|
-
flatMapAsync: <U
|
|
12
|
+
map: <U>(f: (value: R) => U) => Left<L, U>;
|
|
13
|
+
mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Left<L, U>>;
|
|
14
|
+
flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Left<L | L1, U>;
|
|
15
|
+
flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Left<L | L1, U>>;
|
|
18
16
|
toOption: () => Option<R>;
|
|
19
17
|
toList: () => List<R>;
|
|
20
18
|
valueOf: () => {
|
|
21
|
-
_tag: "Left"
|
|
22
|
-
value: L
|
|
19
|
+
_tag: "Left";
|
|
20
|
+
value: L;
|
|
23
21
|
};
|
|
24
22
|
toString: () => string;
|
|
25
|
-
} &
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
} & Typeable<"Left">;
|
|
24
|
+
export type Right<L, R> = {
|
|
25
|
+
readonly _tag: "Right";
|
|
26
|
+
readonly value: R;
|
|
27
|
+
isLeft: () => false;
|
|
28
|
+
isRight: () => true;
|
|
29
|
+
getOrElse: (defaultValue: R) => R;
|
|
30
|
+
getOrThrow: () => R;
|
|
31
|
+
map: <U>(f: (value: R) => U) => Right<L, U>;
|
|
32
|
+
mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Right<L, U>>;
|
|
33
|
+
flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Either<L | L1, U>;
|
|
34
|
+
flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Either<L | L1, U>>;
|
|
35
|
+
toOption: () => Option<R>;
|
|
36
|
+
toList: () => List<R>;
|
|
37
|
+
valueOf: () => {
|
|
38
|
+
_tag: "Right";
|
|
39
|
+
value: R;
|
|
40
|
+
};
|
|
41
|
+
toString: () => string;
|
|
42
|
+
} & Functor<R> & Typeable<"Right">;
|
|
43
|
+
export type Either<L, R> = Left<L, R> | Right<L, R>;
|
|
44
|
+
export declare const Left: <L, R>(value: L) => Left<L, R>;
|
|
45
|
+
export declare const Right: <L, R>(value: R) => Right<L, R>;
|
|
46
|
+
export declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L, R>;
|
|
47
|
+
export declare const isRight: <L, R>(either: Either<L, R>) => either is Right<L, R>;
|
|
48
|
+
export declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
49
|
+
export declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
package/lib/option/Option.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Functor, Type } from "../functor";
|
|
2
|
-
import { Either, Traversable } from "../index";
|
|
3
|
-
import { _Iterable_ } from "../iterable";
|
|
2
|
+
import { Either, List, Traversable } from "../index";
|
|
4
3
|
import { Typeable } from "../typeable/Typeable";
|
|
5
4
|
export type Option<T extends Type> = {
|
|
6
5
|
readonly _tag: "Some" | "None";
|
|
@@ -16,7 +15,7 @@ export type Option<T extends Type> = {
|
|
|
16
15
|
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
17
16
|
foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
|
|
18
17
|
foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
|
|
19
|
-
toList():
|
|
18
|
+
toList(): List<T>;
|
|
20
19
|
contains(value: T): boolean;
|
|
21
20
|
size: number;
|
|
22
21
|
valueOf(): {
|
package/package.json
CHANGED
package/dist/chunk-BTEQN6BB.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-HA5XD5KC.mjs";import{a as U}from"./chunk-RRAIFS3D.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import{a as x}from"./chunk-2I2NKDFN.mjs";var y=e=>{let t=U(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>y(r.filter(o)),filterNot:o=>y(r.filter(a=>!o(a))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(r[0]):L()},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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,u)=>a(u,n),o),valueOf:()=>({values:r})}},p=e=>y(e);var g=e=>{let t=U(e)?new b(e):new b(e?.toArray()??[]),r=p(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new b(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>c(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},R=e=>g(e);var m=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=p(r),a={...o,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(o.flatMap(n)),remove:n=>{let u=r.indexOf(n);return a.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?a:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},c=e=>m(e);var k=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>f(t(e)),mapAsync:t=>t(e).then(r=>f(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>d(e),toList:()=>c([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),C=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>L(),toList:()=>c(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),f=e=>k(e),s=e=>C(e),B=e=>e.isRight(),_=e=>e.isLeft(),Te=(e,t)=>{try{return f(e())}catch(r){return s(t(r))}},me=async(e,t)=>{try{let r=await e();return f(r)}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(o=>{if(B(o))try{let a=t(o.value);return f(a)}catch(a){return s(a)}else return s(o.value)});return S(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return S(r)},mapLeft(t){let r=e.then(o=>{if(_(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return f(o.value)});return S(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var T=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>x([i,l])),o=i=>T(new E(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new E(t.values);return l.delete(i)?T(l.entries()):T(t.values.entries())},n=i=>t.values.get(i[0])===i[1],u=()=>t.values.size,V=i=>T(Array.from(t.values.entries()).map(([l,q])=>[l,i(q)])),K=i=>{let l=T(t.values.entries()).toList();return T(l.flatMap(i).toArray())},I=i=>p(r()).reduce(i),M=i=>p(r()).reduceRight(i),w=i=>l=>p(r()).foldLeft(i)(l),P=i=>l=>p(r()).foldRight(i)(l),N=i=>A(t.values.get(i)),z=(i,l)=>A(t.values.get(i)).getOrElse(l),F=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return u()},map:V,flatMap:K,reduce:I,reduceRight:M,foldLeft:w,foldRight:P,get:N,getOrElse:z,get isEmpty(){return F()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>c(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},xe=e=>T(e);var O=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>O(e),orThrow:t=>e,toEither:()=>f(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(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:()=>s(e),map:t=>v(e),flatMap:t=>v(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$=e=>{try{return O(e())}catch(t){return v(t instanceof Error?t:new Error(String(t)))}};var d=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>d(e),map:t=>d(t(e)),filter(t){return t(e)?d(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:()=>p([e]),contains:t=>t===e,size:1,toEither:t=>f(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_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:()=>p([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},L=()=>h,A=e=>e!=null?d(e):L();export{d as a,L as b,A as c,y as d,p as e,R as f,c as g,f as h,s as i,B as j,_ as k,Te as l,me as m,S as n,xe as o,$ as p};
|
package/dist/chunk-RGJRKBXI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var y=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>y(r.filter(o)),filterNot:o=>y(r.filter(a=>!o(a))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(r[0]):L()},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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,u)=>a(u,n),o),valueOf:()=>({values:r})}},p= exports.e =e=>y(e);var g=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=p(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>c(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},R= exports.f =e=>g(e);var m=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=p(r),a={...o,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(o.flatMap(n)),remove:n=>{let u=r.indexOf(n);return a.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?a:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},c= exports.g =e=>m(e);var k=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>f(t(e)),mapAsync:t=>t(e).then(r=>f(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>d(e),toList:()=>c([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),C=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>L(),toList:()=>c(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),f= exports.h =e=>k(e),s= exports.i =e=>C(e),B= exports.j =e=>e.isRight(),_= exports.k =e=>e.isLeft(),Te= exports.l =(e,t)=>{try{return f(e())}catch(r){return s(t(r))}},me= exports.m =async(e,t)=>{try{let r=await e();return f(r)}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(o=>{if(B(o))try{let a=t(o.value);return f(a)}catch(a){return s(a)}else return s(o.value)});return S(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return S(r)},mapLeft(t){let r=e.then(o=>{if(_(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return f(o.value)});return S(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var T=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,l])),o=i=>T(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(i)?T(l.entries()):T(t.values.entries())},n=i=>t.values.get(i[0])===i[1],u=()=>t.values.size,V=i=>T(Array.from(t.values.entries()).map(([l,q])=>[l,i(q)])),K=i=>{let l=T(t.values.entries()).toList();return T(l.flatMap(i).toArray())},I=i=>p(r()).reduce(i),M=i=>p(r()).reduceRight(i),w=i=>l=>p(r()).foldLeft(i)(l),P=i=>l=>p(r()).foldRight(i)(l),N=i=>A(t.values.get(i)),z=(i,l)=>A(t.values.get(i)).getOrElse(l),F=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return u()},map:V,flatMap:K,reduce:I,reduceRight:M,foldLeft:w,foldRight:P,get:N,getOrElse:z,get isEmpty(){return F()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>c(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},xe= exports.o =e=>T(e);var O=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>O(e),orThrow:t=>e,toEither:()=>f(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(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:()=>s(e),map:t=>v(e),flatMap:t=>v(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$= exports.p =e=>{try{return O(e())}catch(t){return v(t instanceof Error?t:new Error(String(t)))}};var d=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>d(e),map:t=>d(t(e)),filter(t){return t(e)?d(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:()=>p([e]),contains:t=>t===e,size:1,toEither:t=>f(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_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:()=>p([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},L= exports.b =()=>h,A= exports.c =e=>e!=null?d(e):L();exports.a = d; exports.b = L; exports.c = A; exports.d = y; exports.e = p; exports.f = R; exports.g = c; exports.h = f; exports.i = s; exports.j = B; exports.k = _; exports.l = Te; exports.m = me; exports.n = S; exports.o = xe; exports.p = $;
|