functype 0.8.36 → 0.8.37
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-BOSMSYRM.mjs +1 -0
- package/dist/chunk-KJV27YM3.js +1 -0
- package/dist/collections/index.d.mts +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/core/task/Task.d.mts +1 -1
- package/dist/core/task/Task.d.ts +1 -1
- package/dist/core/task/Task.js +1 -1
- package/dist/core/task/Task.mjs +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/functor/index.d.mts +4 -1
- package/dist/functor/index.d.ts +4 -1
- package/dist/{index-Bvqg1Srg.d.ts → index-1xz2kaxi.d.ts} +8 -6
- package/dist/{index-D6OHxaFT.d.mts → index-DvBKFQoa.d.mts} +8 -6
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/index.d.mts +1 -1
- package/dist/iterable/index.d.ts +1 -1
- package/dist/list/List.d.mts +2 -2
- package/dist/list/List.d.ts +2 -2
- 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/package.json +7 -7
- package/dist/chunk-5NZRFQ7O.mjs +0 -1
- package/dist/chunk-OTZ4XGNK.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U}from"./chunk-JF5YGNCO.mjs";import{a as v}from"./chunk-HD6YYUHO.mjs";import{a as R}from"./chunk-377WQNCB.mjs";import{a as g}from"./chunk-HA5XD5KC.mjs";import{a as B}from"./chunk-2I2NKDFN.mjs";import Q from"safe-stable-stringify";import S from"safe-stable-stringify";import j from"safe-stable-stringify";var m=e=>{let t=new g(e),r=l(t),o={...r,add:s=>m([...t,s]),remove:s=>{let f=new g(t);return f.delete(s),m(f)},contains:s=>t.has(s),has:s=>t.has(s),map:s=>m(r.map(s)),flatMap:s=>m(r.flatMap(s)),toList:()=>l(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},h=e=>m(e);var T=e=>{let t=Array.from(e||[]),r={_tag:"List",[Symbol.iterator]:()=>t[Symbol.iterator](),get size(){return t.length},get length(){return t.length},map:o=>T(t.map(o)),flatMap:o=>T(t.flatMap(s=>Array.from(o(s)))),flatMapAsync:async o=>{let s=await Promise.all(t.map(async f=>await o(f)));return T(s.flatMap(f=>Array.from(f)))},forEach:o=>t.forEach(o),count:o=>t.filter(o).length,exists:o=>t.some(o),filter:o=>T(t.filter(o)),filterNot:o=>T(t.filter(s=>!o(s))),find:o=>u(t.find(o)),get head(){return t[0]},get headOption(){return t.length>0?u(t[0]):y()},get isEmpty(){return t.length===0},toArray:()=>[...t],reduce:o=>t.reduce(o),reduceRight:o=>t.reduceRight(o),foldLeft:o=>s=>t.reduce(s,o),foldRight:o=>s=>t.reduceRight((f,x)=>s(x,f),o),remove:o=>T(t.filter(s=>s!==o)),removeAt:o=>T(t.slice(0,o).concat(t.slice(o+1))),add:o=>T([...t,o]),get:o=>u(t[o]),concat:o=>T([...t,...o.toArray()]),drop:o=>T(t.slice(o)),dropRight:o=>T(t.slice(0,-o)),dropWhile:o=>T(t.slice(t.findIndex(s=>!o(s)))),flatten:()=>T(t.flatMap(o=>Array.isArray(o)?o:[o])),toList:()=>r,toSet:()=>h(t),toString:()=>`List(${j(t)})`,toValue:()=>({_tag:"List",value:t})};return r},l=e=>T(e);var V=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>i(t(e)),mapAsync:t=>t(e).then(r=>i(r)).catch(r=>Promise.resolve(n(r))),merge:t=>t.isLeft()?n(t.value):i([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>n(r)),toOption:()=>d(e),toList:()=>l([e]),toString:()=>`Right(${S(e)})`,[Symbol.iterator]:function*(){yield e},yield:function*(){yield e},traverse:t=>{let r=t(e);return r.isLeft()?n(r.value):i([r.value])},lazyMap:function*(t){yield i(t(e))},tap:t=>(t(e),i(e)),tapLeft:t=>i(e),mapLeft:t=>i(e),bimap:(t,r)=>i(r(e)),fold:(t,r)=>r(e),swap:()=>n(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),w=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>n(e),mapAsync:t=>Promise.resolve(n(e)),merge:t=>n(e),flatMap:t=>n(e),flatMapAsync:t=>Promise.resolve(n(e)),toOption:()=>y(),toList:()=>l(),toString:()=>`Left(${S(e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>n(e),lazyMap:function*(t){yield n(e)},tap:t=>n(e),tapLeft:t=>(t(e),n(e)),mapLeft:t=>n(t(e)),bimap:(t,r)=>n(t(e)),fold:(t,r)=>t(e),swap:()=>i(e),then:(t,r)=>Promise.reject(e).then(null,r)}),i=e=>V(e),n=e=>w(e),Le=e=>e.isRight(),ye=e=>e.isLeft(),de=(e,t)=>{try{return i(e())}catch(r){return n(t(r))}},W=e=>V(e);console.assert(W);var D=e=>w(e);console.assert(D);var ce=async(e,t)=>{try{let r=await e();return i(r)}catch(r){return n(t(r))}},H={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return n(r.value);t.push(r.value)}return i(t)},traverse:(e,t)=>H.sequence(e.map(t)),fromNullable:(e,t)=>e==null?n(t):i(e),fromPredicate:(e,t,r)=>t(e)?i(e):n(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return i(r)}catch(r){return n(t(r))}}};var A=(e,t)=>{let r=v(e,t);return{...U("AppException"),...n(r)}},E=e=>({...U("AppResult"),...i(e)});function O(e,t=r=>r){try{return E(e())}catch(r){return A(t(r))}}O.success=e=>E(e);O.fail=e=>A(e);async function K(e,t=r=>r){try{let r=await e();return E(r)}catch(r){let o=await t(r);return A(o)}}K.success=e=>E(e);K.fail=e=>A(e);var L=e=>{let t={values:new R(e)},r=()=>Array.from(t.values.entries()).map(([a,p])=>B([a,p])),o=a=>L(new R(t.values).set(a.toArray()[0],a.toArray()[1]).entries()),s=a=>{let p=new R(t.values);return p.delete(a)?L(p.entries()):L(t.values.entries())},f=a=>t.values.get(a[0])===a[1],x=()=>t.values.size,P=a=>L(Array.from(t.values.entries()).map(([p,G])=>[p,a(G)])),_=a=>{let p=L(t.values.entries()).toList();return L(p.flatMap(a).toArray())},I=a=>l(r()).reduce(a),F=a=>l(r()).reduceRight(a),N=a=>p=>l(r()).foldLeft(a)(p),z=a=>p=>l(r()).foldRight(a)(p),C=a=>u(t.values.get(a)),$=(a,p)=>u(t.values.get(a)).getOrElse(p),q=()=>t.values.size===0;return{add:o,remove:s,contains:f,get size(){return x()},map:P,flatMap:_,reduce:I,reduceRight:F,foldLeft:N,foldRight:z,get:C,getOrElse:$,get isEmpty(){return q()},orElse:(a,p)=>u(t.values.get(a)).orElse(p),toList:()=>l(r()),toSet:()=>h(r()),toString:()=>`Map(${r().toString()})`}},Ve=e=>L(e);import M from"safe-stable-stringify";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:()=>i(e),map:t=>J(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${M(e)})`}),b=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:()=>n(e),map:t=>b(e),flatMap:t=>b(e),toString:()=>`Failure(${M(e)}))`}),J=e=>{try{return k(e())}catch(t){return b(t instanceof Error?t:new Error(String(t)))}};var d=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:()=>d(e),orNull:()=>e,map:t=>d(t(e)),filter(t){return t(e)?d(e):c},fold:(t,r)=>r(e),flatMap:t=>t(e),flatMapAsync:async t=>await 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:()=>l([e]),contains:t=>t===e,size:1,toEither:t=>i(e),toString:()=>`Some(${Q(e)})`,toValue:()=>({_tag:"Some",value:e})}),c={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,orNull:()=>null,map:e=>c,filter(e){return c},flatMap:e=>c,flatMapAsync:async e=>c,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,toEither:e=>n(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},y=()=>c,u=e=>e!=null?d(e):y();u.from=e=>u(e);u.none=()=>y();export{d as a,y as b,u as c,h as d,l as e,i as f,n as g,Le as h,ye as i,de as j,W as k,D as l,ce as m,H as n,A as o,E as p,O as q,K as r,Ve as s,J as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var m=e=>{let t=new (0, _chunk3VJERXBPjs.a)(e),r=l(t),o={...r,add:s=>m([...t,s]),remove:s=>{let f=new (0, _chunk3VJERXBPjs.a)(t);return f.delete(s),m(f)},contains:s=>t.has(s),has:s=>t.has(s),map:s=>m(r.map(s)),flatMap:s=>m(r.flatMap(s)),toList:()=>l(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},h= exports.d =e=>m(e);var T=e=>{let t=Array.from(e||[]),r={_tag:"List",[Symbol.iterator]:()=>t[Symbol.iterator](),get size(){return t.length},get length(){return t.length},map:o=>T(t.map(o)),flatMap:o=>T(t.flatMap(s=>Array.from(o(s)))),flatMapAsync:async o=>{let s=await Promise.all(t.map(async f=>await o(f)));return T(s.flatMap(f=>Array.from(f)))},forEach:o=>t.forEach(o),count:o=>t.filter(o).length,exists:o=>t.some(o),filter:o=>T(t.filter(o)),filterNot:o=>T(t.filter(s=>!o(s))),find:o=>u(t.find(o)),get head(){return t[0]},get headOption(){return t.length>0?u(t[0]):y()},get isEmpty(){return t.length===0},toArray:()=>[...t],reduce:o=>t.reduce(o),reduceRight:o=>t.reduceRight(o),foldLeft:o=>s=>t.reduce(s,o),foldRight:o=>s=>t.reduceRight((f,x)=>s(x,f),o),remove:o=>T(t.filter(s=>s!==o)),removeAt:o=>T(t.slice(0,o).concat(t.slice(o+1))),add:o=>T([...t,o]),get:o=>u(t[o]),concat:o=>T([...t,...o.toArray()]),drop:o=>T(t.slice(o)),dropRight:o=>T(t.slice(0,-o)),dropWhile:o=>T(t.slice(t.findIndex(s=>!o(s)))),flatten:()=>T(t.flatMap(o=>Array.isArray(o)?o:[o])),toList:()=>r,toSet:()=>h(t),toString:()=>`List(${_safestablestringify2.default.call(void 0, t)})`,toValue:()=>({_tag:"List",value:t})};return r},l= exports.e =e=>T(e);var V=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>i(t(e)),mapAsync:t=>t(e).then(r=>i(r)).catch(r=>Promise.resolve(n(r))),merge:t=>t.isLeft()?n(t.value):i([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>n(r)),toOption:()=>d(e),toList:()=>l([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()?n(r.value):i([r.value])},lazyMap:function*(t){yield i(t(e))},tap:t=>(t(e),i(e)),tapLeft:t=>i(e),mapLeft:t=>i(e),bimap:(t,r)=>i(r(e)),fold:(t,r)=>r(e),swap:()=>n(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),w=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>n(e),mapAsync:t=>Promise.resolve(n(e)),merge:t=>n(e),flatMap:t=>n(e),flatMapAsync:t=>Promise.resolve(n(e)),toOption:()=>y(),toList:()=>l(),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>n(e),lazyMap:function*(t){yield n(e)},tap:t=>n(e),tapLeft:t=>(t(e),n(e)),mapLeft:t=>n(t(e)),bimap:(t,r)=>n(t(e)),fold:(t,r)=>t(e),swap:()=>i(e),then:(t,r)=>Promise.reject(e).then(null,r)}),i= exports.f =e=>V(e),n= exports.g =e=>w(e),Le= exports.h =e=>e.isRight(),ye= exports.i =e=>e.isLeft(),de= exports.j =(e,t)=>{try{return i(e())}catch(r){return n(t(r))}},W= exports.k =e=>V(e);console.assert(W);var D=e=>w(e);console.assert(D);var ce=async(e,t)=>{try{let r=await e();return i(r)}catch(r){return n(t(r))}},H= exports.n ={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return n(r.value);t.push(r.value)}return i(t)},traverse:(e,t)=>H.sequence(e.map(t)),fromNullable:(e,t)=>e==null?n(t):i(e),fromPredicate:(e,t,r)=>t(e)?i(e):n(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return i(r)}catch(r){return n(t(r))}}};var A=(e,t)=>{let r=_chunk2U34DUZUjs.a.call(void 0, e,t);return{..._chunkSQWNJC6Ojs.a.call(void 0, "AppException"),...n(r)}},E= exports.p =e=>({..._chunkSQWNJC6Ojs.a.call(void 0, "AppResult"),...i(e)});function O(e,t=r=>r){try{return E(e())}catch(r){return A(t(r))}}O.success=e=>E(e);O.fail=e=>A(e);async function K(e,t=r=>r){try{let r=await e();return E(r)}catch(r){let o=await t(r);return A(o)}}K.success=e=>E(e);K.fail=e=>A(e);var L=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([a,p])=>_chunkOXLZ6UIZjs.a.call(void 0, [a,p])),o=a=>L(new (0, _chunk5VTXJIR3js.a)(t.values).set(a.toArray()[0],a.toArray()[1]).entries()),s=a=>{let p=new (0, _chunk5VTXJIR3js.a)(t.values);return p.delete(a)?L(p.entries()):L(t.values.entries())},f=a=>t.values.get(a[0])===a[1],x=()=>t.values.size,P=a=>L(Array.from(t.values.entries()).map(([p,G])=>[p,a(G)])),_=a=>{let p=L(t.values.entries()).toList();return L(p.flatMap(a).toArray())},I=a=>l(r()).reduce(a),F=a=>l(r()).reduceRight(a),N=a=>p=>l(r()).foldLeft(a)(p),z=a=>p=>l(r()).foldRight(a)(p),C=a=>u(t.values.get(a)),$=(a,p)=>u(t.values.get(a)).getOrElse(p),q=()=>t.values.size===0;return{add:o,remove:s,contains:f,get size(){return x()},map:P,flatMap:_,reduce:I,reduceRight:F,foldLeft:N,foldRight:z,get:C,getOrElse:$,get isEmpty(){return q()},orElse:(a,p)=>u(t.values.get(a)).orElse(p),toList:()=>l(r()),toSet:()=>h(r()),toString:()=>`Map(${r().toString()})`}},Ve= exports.s =e=>L(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:()=>i(e),map:t=>J(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),b=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:()=>n(e),map:t=>b(e),flatMap:t=>b(e),toString:()=>`Failure(${_safestablestringify2.default.call(void 0, e)}))`}),J= exports.t =e=>{try{return k(e())}catch(t){return b(t instanceof Error?t:new Error(String(t)))}};var d=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:()=>d(e),orNull:()=>e,map:t=>d(t(e)),filter(t){return t(e)?d(e):c},fold:(t,r)=>r(e),flatMap:t=>t(e),flatMapAsync:async t=>await 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:()=>l([e]),contains:t=>t===e,size:1,toEither:t=>i(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:"Some",value:e})}),c={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,orNull:()=>null,map:e=>c,filter(e){return c},flatMap:e=>c,flatMapAsync:async e=>c,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,toEither:e=>n(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},y= exports.b =()=>c,u= exports.c =e=>e!=null?d(e):y();u.from=e=>u(e);u.none=()=>y();exports.a = d; exports.b = y; exports.c = u; exports.d = h; exports.e = l; exports.f = i; exports.g = n; exports.h = Le; exports.i = ye; exports.j = de; exports.k = W; exports.l = D; exports.m = ce; exports.n = H; exports.o = A; exports.p = E; exports.q = O; exports.r = K; exports.s = Ve; exports.t = J;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AppException, h as AppResult, k as AsyncTask, j as Task } from '../../index-
|
|
1
|
+
export { A as AppException, h as AppResult, k as AsyncTask, j as Task } from '../../index-DvBKFQoa.mjs';
|
|
2
2
|
import '../error/Throwable.mjs';
|
|
3
3
|
import '../../functor/index.mjs';
|
|
4
4
|
import '../base/Base.mjs';
|
package/dist/core/task/Task.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AppException, h as AppResult, k as AsyncTask, j as Task } from '../../index-
|
|
1
|
+
export { A as AppException, h as AppResult, k as AsyncTask, j as Task } from '../../index-1xz2kaxi.js';
|
|
2
2
|
import '../error/Throwable.js';
|
|
3
3
|
import '../../functor/index.js';
|
|
4
4
|
import '../base/Base.js';
|
package/dist/core/task/Task.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('../../chunk-KJV27YM3.js');require('../../chunk-SQWNJC6O.js');require('../../chunk-2U34DUZU.js');require('../../chunk-5VTXJIR3.js');require('../../chunk-3VJERXBP.js');require('../../chunk-OXLZ6UIZ.js');require('../../chunk-5O6YELD3.js');require('../../chunk-XORABVON.js');require('../../chunk-K3EKBPQE.js');require('../../chunk-WTWWDZY6.js');exports.AppException = _chunkKJV27YM3js.o; exports.AppResult = _chunkKJV27YM3js.p; exports.AsyncTask = _chunkKJV27YM3js.r; exports.Task = _chunkKJV27YM3js.q;
|
package/dist/core/task/Task.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as a,p as b,q as c,r as d}from"../../chunk-
|
|
1
|
+
import{o as a,p as b,q as c,r as d}from"../../chunk-BOSMSYRM.mjs";import"../../chunk-JF5YGNCO.mjs";import"../../chunk-HD6YYUHO.mjs";import"../../chunk-377WQNCB.mjs";import"../../chunk-HA5XD5KC.mjs";import"../../chunk-2I2NKDFN.mjs";import"../../chunk-V7DKESTM.mjs";import"../../chunk-V2J3R5IU.mjs";import"../../chunk-2ML63TYF.mjs";import"../../chunk-4H62YQ42.mjs";export{a as AppException,b as AppResult,d as AsyncTask,c as Task};
|
package/dist/either/Either.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { E as Either, c as Left, R as Right, T as TestEither, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-
|
|
2
|
+
export { E as Either, c as Left, R as Right, T as TestEither, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-DvBKFQoa.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../core/base/Base.mjs';
|
|
5
5
|
import '../core/error/Throwable.mjs';
|
package/dist/either/Either.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.js';
|
|
2
|
-
export { E as Either, c as Left, R as Right, T as TestEither, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-
|
|
2
|
+
export { E as Either, c as Left, R as Right, T as TestEither, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-1xz2kaxi.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
4
|
import '../core/base/Base.js';
|
|
5
5
|
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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Either = _chunkKJV27YM3js.n; exports.Left = _chunkKJV27YM3js.g; exports.Right = _chunkKJV27YM3js.f; exports.TypeCheckLeft = _chunkKJV27YM3js.l; exports.TypeCheckRight = _chunkKJV27YM3js.k; exports.isLeft = _chunkKJV27YM3js.i; exports.isRight = _chunkKJV27YM3js.h; exports.tryCatch = _chunkKJV27YM3js.j; exports.tryCatchAsync = _chunkKJV27YM3js.m;
|
package/dist/either/Either.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"../chunk-
|
|
1
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.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};
|
package/dist/functor/index.d.mts
CHANGED
|
@@ -9,9 +9,12 @@ type Functor<A extends Type> = AbstractFunctor<A> & {
|
|
|
9
9
|
map<B extends Type>(f: (value: A) => B): Functor<B>;
|
|
10
10
|
flatMap<B extends Type>(f: (value: A) => Functor<B>): Functor<B>;
|
|
11
11
|
};
|
|
12
|
+
type AsyncFunctor<A extends Type> = {
|
|
13
|
+
flatMapAsync(f: (value: A) => PromiseLike<AsyncFunctor<A>>): PromiseLike<AsyncFunctor<A>>;
|
|
14
|
+
};
|
|
12
15
|
type ArrayFunctor<A extends ArrayType> = AbstractFunctor<A> & {
|
|
13
16
|
map<U extends ArrayType>(f: (value: A) => U): ArrayFunctor<U>;
|
|
14
17
|
flatMap<U extends ArrayType>(f: (value: A) => ArrayFunctor<U>): ArrayFunctor<U>;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
export type { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type };
|
|
20
|
+
export type { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type };
|
package/dist/functor/index.d.ts
CHANGED
|
@@ -9,9 +9,12 @@ type Functor<A extends Type> = AbstractFunctor<A> & {
|
|
|
9
9
|
map<B extends Type>(f: (value: A) => B): Functor<B>;
|
|
10
10
|
flatMap<B extends Type>(f: (value: A) => Functor<B>): Functor<B>;
|
|
11
11
|
};
|
|
12
|
+
type AsyncFunctor<A extends Type> = {
|
|
13
|
+
flatMapAsync(f: (value: A) => PromiseLike<AsyncFunctor<A>>): PromiseLike<AsyncFunctor<A>>;
|
|
14
|
+
};
|
|
12
15
|
type ArrayFunctor<A extends ArrayType> = AbstractFunctor<A> & {
|
|
13
16
|
map<U extends ArrayType>(f: (value: A) => U): ArrayFunctor<U>;
|
|
14
17
|
flatMap<U extends ArrayType>(f: (value: A) => ArrayFunctor<U>): ArrayFunctor<U>;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
export type { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type };
|
|
20
|
+
export type { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type, Functor } from './functor/index.js';
|
|
1
|
+
import { Type, Functor, AsyncFunctor } from './functor/index.js';
|
|
2
2
|
import './core/base/Base.js';
|
|
3
3
|
import { Throwable } from './core/error/Throwable.js';
|
|
4
4
|
import './identity/Identity.js';
|
|
@@ -20,6 +20,7 @@ type Option<T extends Type> = {
|
|
|
20
20
|
map<U extends Type>(f: (value: T) => U): Option<U>;
|
|
21
21
|
filter(predicate: (value: T) => boolean): Option<T>;
|
|
22
22
|
flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
|
|
23
|
+
flatMapAsync<U extends Type>(f: (value: T) => Promise<Option<U>>): Promise<Option<U>>;
|
|
23
24
|
reduce<U>(f: (acc: U, value: T) => U): U;
|
|
24
25
|
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
25
26
|
fold<U>(onNone: () => U, onSome: (value: T) => U): U;
|
|
@@ -34,7 +35,7 @@ type Option<T extends Type> = {
|
|
|
34
35
|
_tag: "Some" | "None";
|
|
35
36
|
value: T;
|
|
36
37
|
};
|
|
37
|
-
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T>);
|
|
38
|
+
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T> & AsyncFunctor<T>);
|
|
38
39
|
declare const Option: {
|
|
39
40
|
<T extends Type>(value: T | null | undefined): Option<T>;
|
|
40
41
|
from<T>(value: T): Option<T>;
|
|
@@ -67,7 +68,7 @@ type IterableType<A extends Type> = {
|
|
|
67
68
|
_tag: string;
|
|
68
69
|
value: A[];
|
|
69
70
|
};
|
|
70
|
-
} & Iterable<A> & Functor<A>;
|
|
71
|
+
} & Iterable<A> & Functor<A> & AsyncFunctor<A>;
|
|
71
72
|
|
|
72
73
|
type Converters<A> = {
|
|
73
74
|
toList(): List<A>;
|
|
@@ -94,6 +95,7 @@ type List<A> = {
|
|
|
94
95
|
readonly [Symbol.iterator]: () => Iterator<A>;
|
|
95
96
|
map: <B>(f: (a: A) => B) => List<B>;
|
|
96
97
|
flatMap: <B>(f: (a: A) => IterableType<B>) => List<B>;
|
|
98
|
+
flatMapAsync: <B>(f: (a: A) => PromiseLike<IterableType<B>>) => PromiseLike<List<B>>;
|
|
97
99
|
forEach: (f: (a: A) => void) => void;
|
|
98
100
|
count: (p: (x: A) => boolean) => number;
|
|
99
101
|
exists: (p: (a: A) => boolean) => boolean;
|
|
@@ -120,10 +122,10 @@ type List<A> = {
|
|
|
120
122
|
_tag: string;
|
|
121
123
|
value: A[];
|
|
122
124
|
};
|
|
123
|
-
} & IterableType<A> & Typeable<"List">;
|
|
125
|
+
} & IterableType<A> & Typeable<"List"> & AsyncFunctor<A>;
|
|
124
126
|
declare const List: <A>(values?: Iterable<A>) => List<A>;
|
|
125
127
|
|
|
126
|
-
type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
|
|
128
|
+
type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R> & AsyncFunctor<R>;
|
|
127
129
|
declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
|
|
128
130
|
declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
|
|
129
131
|
declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
|
|
@@ -161,7 +163,7 @@ type Either<L extends Type, R extends Type> = {
|
|
|
161
163
|
bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>;
|
|
162
164
|
fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T;
|
|
163
165
|
swap: () => Either<R, L>;
|
|
164
|
-
} & Typeable<"Left" | "Right"> & PromiseLike<R>;
|
|
166
|
+
} & Typeable<"Left" | "Right"> & PromiseLike<R> & AsyncFunctor<R>;
|
|
165
167
|
declare const Either: {
|
|
166
168
|
sequence: <L extends Type, R extends Type>(eithers: Either<L, R>[]) => Either<L, R[]>;
|
|
167
169
|
traverse: <L extends Type, R extends Type, U extends Type>(arr: R[], f: (value: R) => Either<L, U>) => Either<L, U[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type, Functor } from './functor/index.mjs';
|
|
1
|
+
import { Type, Functor, AsyncFunctor } from './functor/index.mjs';
|
|
2
2
|
import './core/base/Base.mjs';
|
|
3
3
|
import { Throwable } from './core/error/Throwable.mjs';
|
|
4
4
|
import './identity/Identity.mjs';
|
|
@@ -20,6 +20,7 @@ type Option<T extends Type> = {
|
|
|
20
20
|
map<U extends Type>(f: (value: T) => U): Option<U>;
|
|
21
21
|
filter(predicate: (value: T) => boolean): Option<T>;
|
|
22
22
|
flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
|
|
23
|
+
flatMapAsync<U extends Type>(f: (value: T) => Promise<Option<U>>): Promise<Option<U>>;
|
|
23
24
|
reduce<U>(f: (acc: U, value: T) => U): U;
|
|
24
25
|
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
25
26
|
fold<U>(onNone: () => U, onSome: (value: T) => U): U;
|
|
@@ -34,7 +35,7 @@ type Option<T extends Type> = {
|
|
|
34
35
|
_tag: "Some" | "None";
|
|
35
36
|
value: T;
|
|
36
37
|
};
|
|
37
|
-
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T>);
|
|
38
|
+
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T> & AsyncFunctor<T>);
|
|
38
39
|
declare const Option: {
|
|
39
40
|
<T extends Type>(value: T | null | undefined): Option<T>;
|
|
40
41
|
from<T>(value: T): Option<T>;
|
|
@@ -67,7 +68,7 @@ type IterableType<A extends Type> = {
|
|
|
67
68
|
_tag: string;
|
|
68
69
|
value: A[];
|
|
69
70
|
};
|
|
70
|
-
} & Iterable<A> & Functor<A>;
|
|
71
|
+
} & Iterable<A> & Functor<A> & AsyncFunctor<A>;
|
|
71
72
|
|
|
72
73
|
type Converters<A> = {
|
|
73
74
|
toList(): List<A>;
|
|
@@ -94,6 +95,7 @@ type List<A> = {
|
|
|
94
95
|
readonly [Symbol.iterator]: () => Iterator<A>;
|
|
95
96
|
map: <B>(f: (a: A) => B) => List<B>;
|
|
96
97
|
flatMap: <B>(f: (a: A) => IterableType<B>) => List<B>;
|
|
98
|
+
flatMapAsync: <B>(f: (a: A) => PromiseLike<IterableType<B>>) => PromiseLike<List<B>>;
|
|
97
99
|
forEach: (f: (a: A) => void) => void;
|
|
98
100
|
count: (p: (x: A) => boolean) => number;
|
|
99
101
|
exists: (p: (a: A) => boolean) => boolean;
|
|
@@ -120,10 +122,10 @@ type List<A> = {
|
|
|
120
122
|
_tag: string;
|
|
121
123
|
value: A[];
|
|
122
124
|
};
|
|
123
|
-
} & IterableType<A> & Typeable<"List">;
|
|
125
|
+
} & IterableType<A> & Typeable<"List"> & AsyncFunctor<A>;
|
|
124
126
|
declare const List: <A>(values?: Iterable<A>) => List<A>;
|
|
125
127
|
|
|
126
|
-
type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
|
|
128
|
+
type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R> & AsyncFunctor<R>;
|
|
127
129
|
declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
|
|
128
130
|
declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
|
|
129
131
|
declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
|
|
@@ -161,7 +163,7 @@ type Either<L extends Type, R extends Type> = {
|
|
|
161
163
|
bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>;
|
|
162
164
|
fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T;
|
|
163
165
|
swap: () => Either<R, L>;
|
|
164
|
-
} & Typeable<"Left" | "Right"> & PromiseLike<R>;
|
|
166
|
+
} & Typeable<"Left" | "Right"> & PromiseLike<R> & AsyncFunctor<R>;
|
|
165
167
|
declare const Either: {
|
|
166
168
|
sequence: <L extends Type, R extends Type>(eithers: Either<L, R>[]) => Either<L, R[]>;
|
|
167
169
|
traverse: <L extends Type, R extends Type, U extends Type>(arr: R[], f: (value: R) => Either<L, U>) => Either<L, U[]>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.mjs';
|
|
1
|
+
export { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type } from './functor/index.mjs';
|
|
2
2
|
export { Base } from './core/base/Base.mjs';
|
|
3
3
|
export { Throwable } from './core/error/Throwable.mjs';
|
|
4
|
-
export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-
|
|
4
|
+
export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-DvBKFQoa.mjs';
|
|
5
5
|
export { Identity } from './identity/Identity.mjs';
|
|
6
6
|
export { Tuple } from './tuple/Tuple.mjs';
|
|
7
7
|
export { Typeable, UnTag } from './typeable/Typeable.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.js';
|
|
1
|
+
export { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type } from './functor/index.js';
|
|
2
2
|
export { Base } from './core/base/Base.js';
|
|
3
3
|
export { Throwable } from './core/error/Throwable.js';
|
|
4
|
-
export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-
|
|
4
|
+
export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-1xz2kaxi.js';
|
|
5
5
|
export { Identity } from './identity/Identity.js';
|
|
6
6
|
export { Tuple } from './tuple/Tuple.js';
|
|
7
7
|
export { Typeable, UnTag } 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 _chunkKJV27YM3js = require('./chunk-KJV27YM3.js');var _chunkSQWNJC6Ojs = require('./chunk-SQWNJC6O.js');var _chunk2U34DUZUjs = require('./chunk-2U34DUZU.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-XORABVON.js');require('./chunk-K3EKBPQE.js');require('./chunk-WTWWDZY6.js');exports.AppException = _chunkKJV27YM3js.o; exports.AppResult = _chunkKJV27YM3js.p; exports.AsyncTask = _chunkKJV27YM3js.r; exports.Base = _chunkSQWNJC6Ojs.a; exports.Either = _chunkKJV27YM3js.n; exports.Left = _chunkKJV27YM3js.g; exports.List = _chunkKJV27YM3js.e; exports.Map = _chunkKJV27YM3js.s; exports.None = _chunkKJV27YM3js.b; exports.Option = _chunkKJV27YM3js.c; exports.Right = _chunkKJV27YM3js.f; exports.Set = _chunkKJV27YM3js.d; exports.Some = _chunkKJV27YM3js.a; exports.Task = _chunkKJV27YM3js.q; exports.Throwable = _chunk2U34DUZUjs.a; exports.Try = _chunkKJV27YM3js.t; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkKJV27YM3js.l; exports.TypeCheckRight = _chunkKJV27YM3js.k; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkKJV27YM3js.i; exports.isRight = _chunkKJV27YM3js.h; exports.tryCatch = _chunkKJV27YM3js.j; exports.tryCatchAsync = _chunkKJV27YM3js.m;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as w,t as x}from"./chunk-
|
|
1
|
+
import{a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as w,t as x}from"./chunk-BOSMSYRM.mjs";import{a as b}from"./chunk-JF5YGNCO.mjs";import{a as c}from"./chunk-HD6YYUHO.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import{a as v}from"./chunk-2I2NKDFN.mjs";import{a}from"./chunk-V7DKESTM.mjs";import"./chunk-V2J3R5IU.mjs";import"./chunk-2ML63TYF.mjs";import"./chunk-4H62YQ42.mjs";export{r as AppException,s as AppResult,u as AsyncTask,b as Base,q as Either,j as Left,h as List,w as Map,e as None,f as Option,i as Right,g as Set,d as Some,t as Task,c as Throwable,x as Try,v as Tuple,o as TypeCheckLeft,n as TypeCheckRight,a as Typeable,l as isLeft,k as isRight,m as tryCatch,p as tryCatchAsync};
|
package/dist/iterable/index.d.ts
CHANGED
package/dist/list/List.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { L as List } from '../index-D6OHxaFT.mjs';
|
|
2
|
-
import '../typeable/Typeable.mjs';
|
|
3
1
|
import '../functor/index.mjs';
|
|
2
|
+
export { L as List } from '../index-DvBKFQoa.mjs';
|
|
3
|
+
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../core/base/Base.mjs';
|
|
5
5
|
import '../core/error/Throwable.mjs';
|
|
6
6
|
import '../identity/Identity.mjs';
|
package/dist/list/List.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { L as List } from '../index-Bvqg1Srg.js';
|
|
2
|
-
import '../typeable/Typeable.js';
|
|
3
1
|
import '../functor/index.js';
|
|
2
|
+
export { L as List } from '../index-1xz2kaxi.js';
|
|
3
|
+
import '../typeable/Typeable.js';
|
|
4
4
|
import '../core/base/Base.js';
|
|
5
5
|
import '../core/error/Throwable.js';
|
|
6
6
|
import '../identity/Identity.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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.List = _chunkKJV27YM3js.e;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"../chunk-
|
|
1
|
+
import{e as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Map = _chunkKJV27YM3js.s;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a}from"../chunk-
|
|
1
|
+
import{s as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.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-DvBKFQoa.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../valuable/Valuable.mjs';
|
|
5
5
|
import '../core/base/Base.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-1xz2kaxi.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
4
|
import '../valuable/Valuable.js';
|
|
5
5
|
import '../core/base/Base.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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.None = _chunkKJV27YM3js.b; exports.Option = _chunkKJV27YM3js.c; exports.Some = _chunkKJV27YM3js.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Set = _chunkKJV27YM3js.d;
|
package/dist/set/Set.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a}from"../chunk-
|
|
1
|
+
import{d as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Try = _chunkKJV27YM3js.t;
|
package/dist/try/Try.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a}from"../chunk-
|
|
1
|
+
import{t as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.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 _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkKJV27YM3js.g.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkKJV27YM3js.f.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{f as e,g as t}from"../chunk-
|
|
1
|
+
import{a as s}from"../chunk-VK5GL6NM.mjs";import{f as e,g as t}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functype",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.37",
|
|
4
4
|
"description": "A smallish functional library for TypeScript",
|
|
5
5
|
"author": "jordan.burke@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@eslint/compat": "^1.2.3",
|
|
15
15
|
"@eslint/eslintrc": "^3.2.0",
|
|
16
|
-
"@eslint/js": "^9.
|
|
16
|
+
"@eslint/js": "^9.16.0",
|
|
17
17
|
"@types/jest": "29.5.14",
|
|
18
|
-
"@types/node": "^22.
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
20
|
-
"@typescript-eslint/parser": "^8.
|
|
18
|
+
"@types/node": "^22.10.1",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
|
20
|
+
"@typescript-eslint/parser": "^8.16.0",
|
|
21
21
|
"cross-env": "^7.0.3",
|
|
22
|
-
"eslint": "^9.
|
|
22
|
+
"eslint": "^9.16.0",
|
|
23
23
|
"eslint-config-prettier": "^9.1.0",
|
|
24
24
|
"eslint-plugin-import": "^2.31.0",
|
|
25
25
|
"eslint-plugin-prettier": "^5.2.1",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"ts-jest": "^29.2.5",
|
|
32
32
|
"ts-node": "^10.9.2",
|
|
33
33
|
"tsup": "^8.3.5",
|
|
34
|
-
"typescript": "
|
|
34
|
+
"typescript": "5.6.3"
|
|
35
35
|
},
|
|
36
36
|
"main": "./dist/index.js",
|
|
37
37
|
"module": "./dist/index.mjs",
|
package/dist/chunk-5NZRFQ7O.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-JF5YGNCO.mjs";import{a as v}from"./chunk-HD6YYUHO.mjs";import{a as R}from"./chunk-377WQNCB.mjs";import{a as U}from"./chunk-HA5XD5KC.mjs";import{a as B}from"./chunk-2I2NKDFN.mjs";import Q from"safe-stable-stringify";import S from"safe-stable-stringify";import j from"safe-stable-stringify";var c=e=>{let t=new U(e),r=l(t),o={...r,add:a=>c([...t,a]),remove:a=>{let L=new U(t);return L.delete(a),c(L)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>c(r.map(a)),flatMap:a=>c(r.flatMap(a)),toList:()=>l(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},h=e=>c(e);var T=e=>{let t=Array.from(e||[]),r={_tag:"List",[Symbol.iterator]:()=>t[Symbol.iterator](),get size(){return t.length},get length(){return t.length},map:o=>T(t.map(o)),flatMap:o=>T(t.flatMap(a=>Array.from(o(a)))),forEach:o=>t.forEach(o),count:o=>t.filter(o).length,exists:o=>t.some(o),filter:o=>T(t.filter(o)),filterNot:o=>T(t.filter(a=>!o(a))),find:o=>u(t.find(o)),get head(){return t[0]},get headOption(){return t.length>0?u(t[0]):d()},get isEmpty(){return t.length===0},toArray:()=>[...t],reduce:o=>t.reduce(o),reduceRight:o=>t.reduceRight(o),foldLeft:o=>a=>t.reduce(a,o),foldRight:o=>a=>t.reduceRight((L,x)=>a(x,L),o),remove:o=>T(t.filter(a=>a!==o)),removeAt:o=>T(t.slice(0,o).concat(t.slice(o+1))),add:o=>T([...t,o]),get:o=>u(t[o]),concat:o=>T([...t,...o.toArray()]),drop:o=>T(t.slice(o)),dropRight:o=>T(t.slice(0,-o)),dropWhile:o=>T(t.slice(t.findIndex(a=>!o(a)))),flatten:()=>T(t.flatMap(o=>Array.isArray(o)?o:[o])),toList:()=>r,toSet:()=>h(t),toString:()=>`List(${j(t)})`,toValue:()=>({_tag:"List",value:t})};return r},l=e=>T(e);var V=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>i(t(e)),mapAsync:t=>t(e).then(r=>i(r)).catch(r=>Promise.resolve(n(r))),merge:t=>t.isLeft()?n(t.value):i([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>n(r)),toOption:()=>y(e),toList:()=>l([e]),toString:()=>`Right(${S(e)})`,[Symbol.iterator]:function*(){yield e},yield:function*(){yield e},traverse:t=>{let r=t(e);return r.isLeft()?n(r.value):i([r.value])},lazyMap:function*(t){yield i(t(e))},tap:t=>(t(e),i(e)),tapLeft:t=>i(e),mapLeft:t=>i(e),bimap:(t,r)=>i(r(e)),fold:(t,r)=>r(e),swap:()=>n(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),w=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>n(e),mapAsync:t=>Promise.resolve(n(e)),merge:t=>n(e),flatMap:t=>n(e),flatMapAsync:t=>Promise.resolve(n(e)),toOption:()=>d(),toList:()=>l(),toString:()=>`Left(${S(e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>n(e),lazyMap:function*(t){yield n(e)},tap:t=>n(e),tapLeft:t=>(t(e),n(e)),mapLeft:t=>n(t(e)),bimap:(t,r)=>n(t(e)),fold:(t,r)=>t(e),swap:()=>i(e),then:(t,r)=>Promise.reject(e).then(null,r)}),i=e=>V(e),n=e=>w(e),Le=e=>e.isRight(),de=e=>e.isLeft(),ye=(e,t)=>{try{return i(e())}catch(r){return n(t(r))}},W=e=>V(e);console.assert(W);var D=e=>w(e);console.assert(D);var ce=async(e,t)=>{try{let r=await e();return i(r)}catch(r){return n(t(r))}},H={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return n(r.value);t.push(r.value)}return i(t)},traverse:(e,t)=>H.sequence(e.map(t)),fromNullable:(e,t)=>e==null?n(t):i(e),fromPredicate:(e,t,r)=>t(e)?i(e):n(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return i(r)}catch(r){return n(t(r))}}};var E=(e,t)=>{let r=v(e,t);return{...g("AppException"),...n(r)}},A=e=>({...g("AppResult"),...i(e)});function O(e,t=r=>r){try{return A(e())}catch(r){return E(t(r))}}O.success=e=>A(e);O.fail=e=>E(e);async function K(e,t=r=>r){try{let r=await e();return A(r)}catch(r){let o=await t(r);return E(o)}}K.success=e=>A(e);K.fail=e=>E(e);var f=e=>{let t={values:new R(e)},r=()=>Array.from(t.values.entries()).map(([s,p])=>B([s,p])),o=s=>f(new R(t.values).set(s.toArray()[0],s.toArray()[1]).entries()),a=s=>{let p=new R(t.values);return p.delete(s)?f(p.entries()):f(t.values.entries())},L=s=>t.values.get(s[0])===s[1],x=()=>t.values.size,_=s=>f(Array.from(t.values.entries()).map(([p,G])=>[p,s(G)])),P=s=>{let p=f(t.values.entries()).toList();return f(p.flatMap(s).toArray())},I=s=>l(r()).reduce(s),N=s=>l(r()).reduceRight(s),z=s=>p=>l(r()).foldLeft(s)(p),F=s=>p=>l(r()).foldRight(s)(p),C=s=>u(t.values.get(s)),$=(s,p)=>u(t.values.get(s)).getOrElse(p),q=()=>t.values.size===0;return{add:o,remove:a,contains:L,get size(){return x()},map:_,flatMap:P,reduce:I,reduceRight:N,foldLeft:z,foldRight:F,get:C,getOrElse:$,get isEmpty(){return q()},orElse:(s,p)=>u(t.values.get(s)).orElse(p),toList:()=>l(r()),toSet:()=>h(r()),toString:()=>`Map(${r().toString()})`}},Ve=e=>f(e);import M from"safe-stable-stringify";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:()=>i(e),map:t=>J(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${M(e)})`}),b=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:()=>n(e),map:t=>b(e),flatMap:t=>b(e),toString:()=>`Failure(${M(e)}))`}),J=e=>{try{return k(e())}catch(t){return b(t instanceof Error?t:new Error(String(t)))}};var y=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:()=>y(e),orNull:()=>e,map:t=>y(t(e)),filter(t){return t(e)?y(e):m},fold:(t,r)=>r(e),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:()=>l([e]),contains:t=>t===e,size:1,toEither:t=>i(e),toString:()=>`Some(${Q(e)})`,toValue:()=>({_tag:"Some",value:e})}),m={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,orNull:()=>null,map:e=>m,filter(e){return m},flatMap:e=>m,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,toEither:e=>n(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},d=()=>m,u=e=>e!=null?y(e):d();u.from=e=>u(e);u.none=()=>d();export{y as a,d as b,u as c,h as d,l as e,i as f,n as g,Le as h,de as i,ye as j,W as k,D as l,ce as m,H as n,E as o,A as p,O as q,K as r,Ve as s,J as t};
|
package/dist/chunk-OTZ4XGNK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var c=e=>{let t=new (0, _chunk3VJERXBPjs.a)(e),r=l(t),o={...r,add:a=>c([...t,a]),remove:a=>{let L=new (0, _chunk3VJERXBPjs.a)(t);return L.delete(a),c(L)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>c(r.map(a)),flatMap:a=>c(r.flatMap(a)),toList:()=>l(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},h= exports.d =e=>c(e);var T=e=>{let t=Array.from(e||[]),r={_tag:"List",[Symbol.iterator]:()=>t[Symbol.iterator](),get size(){return t.length},get length(){return t.length},map:o=>T(t.map(o)),flatMap:o=>T(t.flatMap(a=>Array.from(o(a)))),forEach:o=>t.forEach(o),count:o=>t.filter(o).length,exists:o=>t.some(o),filter:o=>T(t.filter(o)),filterNot:o=>T(t.filter(a=>!o(a))),find:o=>u(t.find(o)),get head(){return t[0]},get headOption(){return t.length>0?u(t[0]):d()},get isEmpty(){return t.length===0},toArray:()=>[...t],reduce:o=>t.reduce(o),reduceRight:o=>t.reduceRight(o),foldLeft:o=>a=>t.reduce(a,o),foldRight:o=>a=>t.reduceRight((L,x)=>a(x,L),o),remove:o=>T(t.filter(a=>a!==o)),removeAt:o=>T(t.slice(0,o).concat(t.slice(o+1))),add:o=>T([...t,o]),get:o=>u(t[o]),concat:o=>T([...t,...o.toArray()]),drop:o=>T(t.slice(o)),dropRight:o=>T(t.slice(0,-o)),dropWhile:o=>T(t.slice(t.findIndex(a=>!o(a)))),flatten:()=>T(t.flatMap(o=>Array.isArray(o)?o:[o])),toList:()=>r,toSet:()=>h(t),toString:()=>`List(${_safestablestringify2.default.call(void 0, t)})`,toValue:()=>({_tag:"List",value:t})};return r},l= exports.e =e=>T(e);var V=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>i(t(e)),mapAsync:t=>t(e).then(r=>i(r)).catch(r=>Promise.resolve(n(r))),merge:t=>t.isLeft()?n(t.value):i([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>n(r)),toOption:()=>y(e),toList:()=>l([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()?n(r.value):i([r.value])},lazyMap:function*(t){yield i(t(e))},tap:t=>(t(e),i(e)),tapLeft:t=>i(e),mapLeft:t=>i(e),bimap:(t,r)=>i(r(e)),fold:(t,r)=>r(e),swap:()=>n(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),w=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>n(e),mapAsync:t=>Promise.resolve(n(e)),merge:t=>n(e),flatMap:t=>n(e),flatMapAsync:t=>Promise.resolve(n(e)),toOption:()=>d(),toList:()=>l(),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>n(e),lazyMap:function*(t){yield n(e)},tap:t=>n(e),tapLeft:t=>(t(e),n(e)),mapLeft:t=>n(t(e)),bimap:(t,r)=>n(t(e)),fold:(t,r)=>t(e),swap:()=>i(e),then:(t,r)=>Promise.reject(e).then(null,r)}),i= exports.f =e=>V(e),n= exports.g =e=>w(e),Le= exports.h =e=>e.isRight(),de= exports.i =e=>e.isLeft(),ye= exports.j =(e,t)=>{try{return i(e())}catch(r){return n(t(r))}},W= exports.k =e=>V(e);console.assert(W);var D=e=>w(e);console.assert(D);var ce=async(e,t)=>{try{let r=await e();return i(r)}catch(r){return n(t(r))}},H= exports.n ={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return n(r.value);t.push(r.value)}return i(t)},traverse:(e,t)=>H.sequence(e.map(t)),fromNullable:(e,t)=>e==null?n(t):i(e),fromPredicate:(e,t,r)=>t(e)?i(e):n(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return i(r)}catch(r){return n(t(r))}}};var E=(e,t)=>{let r=_chunk2U34DUZUjs.a.call(void 0, e,t);return{..._chunkSQWNJC6Ojs.a.call(void 0, "AppException"),...n(r)}},A= exports.p =e=>({..._chunkSQWNJC6Ojs.a.call(void 0, "AppResult"),...i(e)});function O(e,t=r=>r){try{return A(e())}catch(r){return E(t(r))}}O.success=e=>A(e);O.fail=e=>E(e);async function K(e,t=r=>r){try{let r=await e();return A(r)}catch(r){let o=await t(r);return E(o)}}K.success=e=>A(e);K.fail=e=>E(e);var f=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([s,p])=>_chunkOXLZ6UIZjs.a.call(void 0, [s,p])),o=s=>f(new (0, _chunk5VTXJIR3js.a)(t.values).set(s.toArray()[0],s.toArray()[1]).entries()),a=s=>{let p=new (0, _chunk5VTXJIR3js.a)(t.values);return p.delete(s)?f(p.entries()):f(t.values.entries())},L=s=>t.values.get(s[0])===s[1],x=()=>t.values.size,_=s=>f(Array.from(t.values.entries()).map(([p,G])=>[p,s(G)])),P=s=>{let p=f(t.values.entries()).toList();return f(p.flatMap(s).toArray())},I=s=>l(r()).reduce(s),N=s=>l(r()).reduceRight(s),z=s=>p=>l(r()).foldLeft(s)(p),F=s=>p=>l(r()).foldRight(s)(p),C=s=>u(t.values.get(s)),$=(s,p)=>u(t.values.get(s)).getOrElse(p),q=()=>t.values.size===0;return{add:o,remove:a,contains:L,get size(){return x()},map:_,flatMap:P,reduce:I,reduceRight:N,foldLeft:z,foldRight:F,get:C,getOrElse:$,get isEmpty(){return q()},orElse:(s,p)=>u(t.values.get(s)).orElse(p),toList:()=>l(r()),toSet:()=>h(r()),toString:()=>`Map(${r().toString()})`}},Ve= exports.s =e=>f(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:()=>i(e),map:t=>J(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),b=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:()=>n(e),map:t=>b(e),flatMap:t=>b(e),toString:()=>`Failure(${_safestablestringify2.default.call(void 0, e)}))`}),J= exports.t =e=>{try{return k(e())}catch(t){return b(t instanceof Error?t:new Error(String(t)))}};var y=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:()=>y(e),orNull:()=>e,map:t=>y(t(e)),filter(t){return t(e)?y(e):m},fold:(t,r)=>r(e),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:()=>l([e]),contains:t=>t===e,size:1,toEither:t=>i(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:"Some",value:e})}),m={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,orNull:()=>null,map:e=>m,filter(e){return m},flatMap:e=>m,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,toEither:e=>n(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},d= exports.b =()=>m,u= exports.c =e=>e!=null?y(e):d();u.from=e=>u(e);u.none=()=>d();exports.a = y; exports.b = d; exports.c = u; exports.d = h; exports.e = l; exports.f = i; exports.g = n; exports.h = Le; exports.i = de; exports.j = ye; exports.k = W; exports.l = D; exports.m = ce; exports.n = H; exports.o = E; exports.p = A; exports.q = O; exports.r = K; exports.s = Ve; exports.t = J;
|