functype 0.8.6 → 0.8.8
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-4JXKOGY4.mjs +1 -0
- package/dist/chunk-YWNQJQON.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/{index-BnKWcor4.d.mts → index-BClvlOd9.d.mts} +7 -2
- package/dist/{index-DjeTCtkC.d.ts → index-CCr9-bb6.d.ts} +7 -2
- 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 +4 -0
- package/lib/try/Try.d.ts +2 -1
- package/package.json +1 -1
- package/dist/chunk-CPKZHNLP.js +0 -1
- package/dist/chunk-MDNYGGCI.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O}from"./chunk-2I2NKDFN.mjs";import{a as h}from"./chunk-RRAIFS3D.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import{a as B}from"./chunk-HA5XD5KC.mjs";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(i=>o(i).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(i=>!o(i))),find:o=>f(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?f(r[0]):y()},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=>i=>r.reduce(i,o),foldRight:o=>i=>r.reduceRight((a,p)=>i(p,a),o),valueOf:()=>({values:r})}},l=e=>d(e);var g=e=>{let t=h(e)?new B(e):new B(e?.toArray()??[]),r=l(t),o={...r,add:i=>g([...t,i]),remove:i=>{let a=new B(t);return a.delete(i),g(a)},contains:i=>t.has(i),has:i=>t.has(i),map:i=>g(r.map(i)),flatMap:i=>g(r.flatMap(i)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},S=e=>g(e);var c=e=>{function t(a){return a!=null&&typeof a[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=l(r),i={...o,length:r.length,map:a=>c(r.map(a)),flatMap:a=>c(o.flatMap(a)),remove:a=>{let p=r.indexOf(a);return i.removeAt(p)},contains:a=>r.includes(a),add:a=>c([...r,a]),removeAt:a=>a<0||a>=r.length?i:c([...r.slice(0,a),...r.slice(a+1)]),get:a=>f(r[a]),concat:a=>c([...r,...a.toArray()]),toList:()=>i,toSet:()=>S(r),toString:()=>`List(${r.toString()})`};return new Proxy(i,{get(a,p){return typeof p=="symbol"||isNaN(Number(p))?a[p]:a.get(Number(p))}})},A=e=>c(e);var U=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,map:t=>U(t(e)),mapAsync:async t=>{let r=await t(e);return U(r)},flatMap:t=>t(e),flatMapAsync:async t=>await t(e),toOption:()=>L(e),toList:()=>A([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),b=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,map:t=>b(e),mapAsync:async t=>b(e),flatMap:t=>b(e),flatMapAsync:async t=>b(e),toOption:()=>y(),toList:()=>A(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),m=e=>U(e),T=e=>b(e),Ae=e=>e.isRight(),ue=e=>e.isLeft(),ce=(e,t)=>{try{return m(e())}catch(r){return T(t(r))}},me=async(e,t)=>{try{let r=await e();return m(r)}catch(r){return T(t(r))}};var u=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([n,s])=>O([n,s])),o=n=>u(new E(t.values).set(n.toArray()[0],n.toArray()[1]).entries()),i=n=>{let s=new E(t.values);return s.delete(n)?u(s.entries()):u(t.values.entries())},a=n=>t.values.get(n[0])===n[1],p=()=>t.values.size,v=n=>u(Array.from(t.values.entries()).map(([s,q])=>[s,n(q)])),V=n=>{let s=u(t.values.entries()).toList();return u(s.flatMap(n).toArray())},K=n=>l(r()).reduce(n),I=n=>l(r()).reduceRight(n),M=n=>s=>l(r()).foldLeft(n)(s),w=n=>s=>l(r()).foldRight(n)(s),N=n=>f(t.values.get(n)),z=(n,s)=>f(t.values.get(n)).getOrElse(s),F=()=>t.values.size===0;return{add:o,remove:i,contains:a,get size(){return p()},map:v,flatMap:V,reduce:K,reduceRight:I,foldLeft:M,foldRight:w,get:N,getOrElse:z,get isEmpty(){return F()},orElse:(n,s)=>f(t.values.get(n)).orElse(s),toList:()=>A(r()),toSet:()=>S(r()),toString:()=>`Map(${r().toString()})`}},Se=e=>u(e);var x=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>x(e),orThrow:t=>e,toEither:()=>m(e),map:t=>P(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),_=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:()=>T(e),map:t=>_(e),flatMap:t=>_(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),P=e=>{try{return x(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var L=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>L(e),map:t=>L(t(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=>m(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,flatMap:e=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,toEither:e=>T(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},y=()=>R,f=e=>e!=null?L(e):y();export{L as a,y as b,f as c,d,l as e,S as f,A as g,m as h,T as i,Ae as j,ue as k,ce as l,me as m,Se as n,P as o};
|
|
@@ -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 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(i=>o(i).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(i=>!o(i))),find:o=>f(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?f(r[0]):y()},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=>i=>r.reduce(i,o),foldRight:o=>i=>r.reduceRight((a,p)=>i(p,a),o),valueOf:()=>({values:r})}},l= exports.e =e=>d(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=l(t),o={...r,add:i=>g([...t,i]),remove:i=>{let a=new (0, _chunk3VJERXBPjs.a)(t);return a.delete(i),g(a)},contains:i=>t.has(i),has:i=>t.has(i),map:i=>g(r.map(i)),flatMap:i=>g(r.flatMap(i)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},S= exports.f =e=>g(e);var c=e=>{function t(a){return a!=null&&typeof a[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=l(r),i={...o,length:r.length,map:a=>c(r.map(a)),flatMap:a=>c(o.flatMap(a)),remove:a=>{let p=r.indexOf(a);return i.removeAt(p)},contains:a=>r.includes(a),add:a=>c([...r,a]),removeAt:a=>a<0||a>=r.length?i:c([...r.slice(0,a),...r.slice(a+1)]),get:a=>f(r[a]),concat:a=>c([...r,...a.toArray()]),toList:()=>i,toSet:()=>S(r),toString:()=>`List(${r.toString()})`};return new Proxy(i,{get(a,p){return typeof p=="symbol"||isNaN(Number(p))?a[p]:a.get(Number(p))}})},A= exports.g =e=>c(e);var U=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,map:t=>U(t(e)),mapAsync:async t=>{let r=await t(e);return U(r)},flatMap:t=>t(e),flatMapAsync:async t=>await t(e),toOption:()=>L(e),toList:()=>A([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),b=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,map:t=>b(e),mapAsync:async t=>b(e),flatMap:t=>b(e),flatMapAsync:async t=>b(e),toOption:()=>y(),toList:()=>A(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),m= exports.h =e=>U(e),T= exports.i =e=>b(e),Ae= exports.j =e=>e.isRight(),ue= exports.k =e=>e.isLeft(),ce= exports.l =(e,t)=>{try{return m(e())}catch(r){return T(t(r))}},me= exports.m =async(e,t)=>{try{let r=await e();return m(r)}catch(r){return T(t(r))}};var u=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([n,s])=>_chunkOXLZ6UIZjs.a.call(void 0, [n,s])),o=n=>u(new (0, _chunk5VTXJIR3js.a)(t.values).set(n.toArray()[0],n.toArray()[1]).entries()),i=n=>{let s=new (0, _chunk5VTXJIR3js.a)(t.values);return s.delete(n)?u(s.entries()):u(t.values.entries())},a=n=>t.values.get(n[0])===n[1],p=()=>t.values.size,v=n=>u(Array.from(t.values.entries()).map(([s,q])=>[s,n(q)])),V=n=>{let s=u(t.values.entries()).toList();return u(s.flatMap(n).toArray())},K=n=>l(r()).reduce(n),I=n=>l(r()).reduceRight(n),M=n=>s=>l(r()).foldLeft(n)(s),w=n=>s=>l(r()).foldRight(n)(s),N=n=>f(t.values.get(n)),z=(n,s)=>f(t.values.get(n)).getOrElse(s),F=()=>t.values.size===0;return{add:o,remove:i,contains:a,get size(){return p()},map:v,flatMap:V,reduce:K,reduceRight:I,foldLeft:M,foldRight:w,get:N,getOrElse:z,get isEmpty(){return F()},orElse:(n,s)=>f(t.values.get(n)).orElse(s),toList:()=>A(r()),toSet:()=>S(r()),toString:()=>`Map(${r().toString()})`}},Se= exports.n =e=>u(e);var x=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>x(e),orThrow:t=>e,toEither:()=>m(e),map:t=>P(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),_=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:()=>T(e),map:t=>_(e),flatMap:t=>_(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),P= exports.o =e=>{try{return x(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var L=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>L(e),map:t=>L(t(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=>m(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,flatMap:e=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,toEither:e=>T(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},y= exports.b =()=>R,f= exports.c =e=>e!=null?L(e):y();exports.a = L; exports.b = y; exports.c = f; exports.d = d; exports.e = l; exports.f = S; exports.g = A; exports.h = m; exports.i = T; exports.j = Ae; exports.k = ue; exports.l = ce; exports.m = me; exports.n = Se; exports.o = 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, f as isLeft, i as isRight, t as tryCatch } from '../index-
|
|
2
|
+
export { E as Either, e as Left, R as Right, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-BClvlOd9.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, f as isLeft, i as isRight, t as tryCatch } from '../index-
|
|
2
|
+
export { E as Either, e as Left, R as Right, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-CCr9-bb6.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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Left = _chunkYWNQJQONjs.i; exports.Right = _chunkYWNQJQONjs.h; exports.isLeft = _chunkYWNQJQONjs.k; exports.isRight = _chunkYWNQJQONjs.j; exports.tryCatch = _chunkYWNQJQONjs.l; exports.tryCatchAsync = _chunkYWNQJQONjs.m;
|
package/dist/either/Either.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as a,i as b,j as c,k as d,l as e}from"../chunk-
|
|
1
|
+
import{h as a,i as b,j as c,k as d,l as e,m as f}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Left,a as Right,d as isLeft,c as isRight,e as tryCatch,f as tryCatchAsync};
|
|
@@ -120,8 +120,11 @@ type Either<L extends Type, R extends Type> = {
|
|
|
120
120
|
value: L | R;
|
|
121
121
|
isLeft: () => boolean;
|
|
122
122
|
isRight: () => boolean;
|
|
123
|
+
getOrElse: (value: R) => R;
|
|
123
124
|
map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
|
|
125
|
+
mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
|
|
124
126
|
flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
|
|
127
|
+
flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
|
|
125
128
|
toOption: () => Option<R>;
|
|
126
129
|
toList: () => List<R>;
|
|
127
130
|
valueOf: () => {
|
|
@@ -139,6 +142,7 @@ declare const isLeft: <L, R>(either: Either<L, R>) => either is Either<L, R> & {
|
|
|
139
142
|
value: L;
|
|
140
143
|
};
|
|
141
144
|
declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
145
|
+
declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
142
146
|
|
|
143
147
|
type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
|
|
144
148
|
type Map<K, V> = {
|
|
@@ -158,10 +162,11 @@ type Try<T> = {
|
|
|
158
162
|
readonly error: Error | undefined;
|
|
159
163
|
isSuccess: () => boolean;
|
|
160
164
|
isFailure: () => boolean;
|
|
165
|
+
get: () => T;
|
|
161
166
|
getOrElse: (defaultValue: T) => T;
|
|
162
167
|
orElse: (alternative: Try<T>) => Try<T>;
|
|
168
|
+
orThrow: (error: Error) => T;
|
|
163
169
|
toEither: () => Either<Error, T>;
|
|
164
|
-
orThrow: () => T;
|
|
165
170
|
map: <U>(f: (value: T) => U) => Try<U>;
|
|
166
171
|
flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
|
|
167
172
|
valueOf: () => {
|
|
@@ -183,4 +188,4 @@ type Traversable<A extends Type> = Functor<A> & {
|
|
|
183
188
|
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
184
189
|
};
|
|
185
190
|
|
|
186
|
-
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, isLeft as f, type Traversable as
|
|
191
|
+
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, isLeft as f, tryCatchAsync as g, type Traversable as h, isRight as i, tryCatch as t };
|
|
@@ -120,8 +120,11 @@ type Either<L extends Type, R extends Type> = {
|
|
|
120
120
|
value: L | R;
|
|
121
121
|
isLeft: () => boolean;
|
|
122
122
|
isRight: () => boolean;
|
|
123
|
+
getOrElse: (value: R) => R;
|
|
123
124
|
map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
|
|
125
|
+
mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
|
|
124
126
|
flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
|
|
127
|
+
flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
|
|
125
128
|
toOption: () => Option<R>;
|
|
126
129
|
toList: () => List<R>;
|
|
127
130
|
valueOf: () => {
|
|
@@ -139,6 +142,7 @@ declare const isLeft: <L, R>(either: Either<L, R>) => either is Either<L, R> & {
|
|
|
139
142
|
value: L;
|
|
140
143
|
};
|
|
141
144
|
declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
145
|
+
declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
142
146
|
|
|
143
147
|
type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
|
|
144
148
|
type Map<K, V> = {
|
|
@@ -158,10 +162,11 @@ type Try<T> = {
|
|
|
158
162
|
readonly error: Error | undefined;
|
|
159
163
|
isSuccess: () => boolean;
|
|
160
164
|
isFailure: () => boolean;
|
|
165
|
+
get: () => T;
|
|
161
166
|
getOrElse: (defaultValue: T) => T;
|
|
162
167
|
orElse: (alternative: Try<T>) => Try<T>;
|
|
168
|
+
orThrow: (error: Error) => T;
|
|
163
169
|
toEither: () => Either<Error, T>;
|
|
164
|
-
orThrow: () => T;
|
|
165
170
|
map: <U>(f: (value: T) => U) => Try<U>;
|
|
166
171
|
flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
|
|
167
172
|
valueOf: () => {
|
|
@@ -183,4 +188,4 @@ type Traversable<A extends Type> = Functor<A> & {
|
|
|
183
188
|
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
184
189
|
};
|
|
185
190
|
|
|
186
|
-
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, isLeft as f, type Traversable as
|
|
191
|
+
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, isLeft as f, tryCatchAsync as g, type Traversable as h, isRight as i, 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, 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,
|
|
2
|
+
export { E as Either, 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, h as Traversable, T as Try, _ as _Iterable_, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-BClvlOd9.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, 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,
|
|
2
|
+
export { E as Either, 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, h as Traversable, T as Try, _ as _Iterable_, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-CCr9-bb6.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 _chunkYWNQJQONjs = require('./chunk-YWNQJQON.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-BNNK42JC.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');require('./chunk-XORABVON.js');require('./chunk-K3EKBPQE.js');exports.Left = _chunkYWNQJQONjs.i; exports.List = _chunkYWNQJQONjs.g; exports.Map = _chunkYWNQJQONjs.n; exports.None = _chunkYWNQJQONjs.b; exports.Option = _chunkYWNQJQONjs.c; exports.Right = _chunkYWNQJQONjs.h; exports.Seq = _chunkYWNQJQONjs.e; exports.Set = _chunkYWNQJQONjs.f; exports.Some = _chunkYWNQJQONjs.a; exports.Try = _chunkYWNQJQONjs.o; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkYWNQJQONjs.k; exports.isRight = _chunkYWNQJQONjs.j; exports.tryCatch = _chunkYWNQJQONjs.l; exports.tryCatchAsync = _chunkYWNQJQONjs.m;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m,n}from"./chunk-
|
|
1
|
+
import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n,o}from"./chunk-4JXKOGY4.mjs";import{a as m}from"./chunk-2I2NKDFN.mjs";import{a as p}from"./chunk-V7DKESTM.mjs";import"./chunk-RRAIFS3D.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import"./chunk-V2J3R5IU.mjs";import"./chunk-2ML63TYF.mjs";export{h as Left,f as List,n as Map,b as None,c as Option,g as Right,d as Seq,e as Set,a as Some,o as Try,m as Tuple,p as Typeable,j as isLeft,i as isRight,k as tryCatch,l 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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkYWNQJQONjs.e; exports.createSeq = _chunkYWNQJQONjs.d;
|
package/dist/iterable/Seq.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,e as b}from"../chunk-
|
|
1
|
+
import{d as a,e as b}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Seq,a as createSeq};
|
|
@@ -1,5 +1,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-BClvlOd9.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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkYWNQJQONjs.e;
|
package/dist/iterable/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"../chunk-
|
|
1
|
+
import{e as a}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Seq};
|
package/dist/list/List.d.mts
CHANGED
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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.List = _chunkYWNQJQONjs.g;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as a}from"../chunk-
|
|
1
|
+
import{g as a}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Map = _chunkYWNQJQONjs.n;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as a}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Map};
|
package/dist/option/Option.d.mts
CHANGED
|
@@ -1,5 +1,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-BClvlOd9.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-CCr9-bb6.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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.None = _chunkYWNQJQONjs.b; exports.Option = _chunkYWNQJQONjs.c; exports.Some = _chunkYWNQJQONjs.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as None,c as Option,a as Some};
|
package/dist/set/Set.d.mts
CHANGED
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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Set = _chunkYWNQJQONjs.f;
|
package/dist/set/Set.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as a}from"../chunk-
|
|
1
|
+
import{f as a}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Try = _chunkYWNQJQONjs.o;
|
package/dist/try/Try.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{o as a}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.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 _chunkYWNQJQONjs = require('../chunk-YWNQJQON.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkYWNQJQONjs.i.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkYWNQJQONjs.h.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{h as e,i as t}from"../chunk-
|
|
1
|
+
import{a as s}from"../chunk-VK5GL6NM.mjs";import{h as e,i as t}from"../chunk-4JXKOGY4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
|
package/lib/either/Either.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ export type Either<L extends Type, R extends Type> = {
|
|
|
7
7
|
value: L | R;
|
|
8
8
|
isLeft: () => boolean;
|
|
9
9
|
isRight: () => boolean;
|
|
10
|
+
getOrElse: (value: R) => R;
|
|
10
11
|
map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
|
|
12
|
+
mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
|
|
11
13
|
flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
|
|
14
|
+
flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
|
|
12
15
|
toOption: () => Option<R>;
|
|
13
16
|
toList: () => List<R>;
|
|
14
17
|
valueOf: () => {
|
|
@@ -26,3 +29,4 @@ export declare const isLeft: <L, R>(either: Either<L, R>) => either is Either<L,
|
|
|
26
29
|
value: L;
|
|
27
30
|
};
|
|
28
31
|
export declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
32
|
+
export declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
package/lib/try/Try.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ export type Try<T> = {
|
|
|
6
6
|
readonly error: Error | undefined;
|
|
7
7
|
isSuccess: () => boolean;
|
|
8
8
|
isFailure: () => boolean;
|
|
9
|
+
get: () => T;
|
|
9
10
|
getOrElse: (defaultValue: T) => T;
|
|
10
11
|
orElse: (alternative: Try<T>) => Try<T>;
|
|
12
|
+
orThrow: (error: Error) => T;
|
|
11
13
|
toEither: () => Either<Error, T>;
|
|
12
|
-
orThrow: () => T;
|
|
13
14
|
map: <U>(f: (value: T) => U) => Try<U>;
|
|
14
15
|
flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
|
|
15
16
|
valueOf: () => {
|
package/package.json
CHANGED
package/dist/chunk-CPKZHNLP.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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var m=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=>m(r.map(o)),flatMap:o=>m(r.flatMap(i=>o(i).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>m(r.filter(o)),filterNot:o=>m(r.filter(i=>!o(i))),find:o=>f(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?f(r[0]):T()},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=>i=>r.reduce(i,o),foldRight:o=>i=>r.reduceRight((a,p)=>i(p,a),o),valueOf:()=>({values:r})}},s= exports.e =e=>m(e);var d=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=s(t),o={...r,add:i=>d([...t,i]),remove:i=>{let a=new (0, _chunk3VJERXBPjs.a)(t);return a.delete(i),d(a)},contains:i=>t.has(i),has:i=>t.has(i),map:i=>d(r.map(i)),flatMap:i=>d(r.flatMap(i)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},h= exports.f =e=>d(e);var c=e=>{function t(a){return a!=null&&typeof a[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=s(r),i={...o,length:r.length,map:a=>c(r.map(a)),flatMap:a=>c(o.flatMap(a)),remove:a=>{let p=r.indexOf(a);return i.removeAt(p)},contains:a=>r.includes(a),add:a=>c([...r,a]),removeAt:a=>a<0||a>=r.length?i:c([...r.slice(0,a),...r.slice(a+1)]),get:a=>f(r[a]),concat:a=>c([...r,...a.toArray()]),toList:()=>i,toSet:()=>h(r),toString:()=>`List(${r.toString()})`};return new Proxy(i,{get(a,p){return typeof p=="symbol"||isNaN(Number(p))?a[p]:a.get(Number(p))}})},A= exports.g =e=>c(e);var U=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,map:t=>U(t(e)),flatMap:t=>t(e),toOption:()=>g(e),toList:()=>A([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),E=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,map:t=>E(e),flatMap:t=>E(e),toOption:()=>T(),toList:()=>A(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),b= exports.h =e=>U(e),y= exports.i =e=>E(e),Ae= exports.j =e=>e.isRight(),ue= exports.k =e=>e.isLeft(),ce= exports.l =(e,t)=>{try{return b(e())}catch(r){return y(t(r))}};var u=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([n,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [n,l])),o=n=>u(new (0, _chunk5VTXJIR3js.a)(t.values).set(n.toArray()[0],n.toArray()[1]).entries()),i=n=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(n)?u(l.entries()):u(t.values.entries())},a=n=>t.values.get(n[0])===n[1],p=()=>t.values.size,x=n=>u(Array.from(t.values.entries()).map(([l,q])=>[l,n(q)])),V=n=>{let l=u(t.values.entries()).toList();return u(l.flatMap(n).toArray())},K=n=>s(r()).reduce(n),I=n=>s(r()).reduceRight(n),M=n=>l=>s(r()).foldLeft(n)(l),N=n=>l=>s(r()).foldRight(n)(l),z=n=>f(t.values.get(n)),w=(n,l)=>f(t.values.get(n)).getOrElse(l),F=()=>t.values.size===0;return{add:o,remove:i,contains:a,get size(){return p()},map:x,flatMap:V,reduce:K,reduceRight:I,foldLeft:M,foldRight:N,get:z,getOrElse:w,get isEmpty(){return F()},orElse:(n,l)=>f(t.values.get(n)).orElse(l),toList:()=>A(r()),toSet:()=>h(r()),toString:()=>`Map(${r().toString()})`}},he= exports.m =e=>u(e);var v=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,getOrElse:t=>e,orElse:t=>v(e),toEither:()=>b(e),orThrow:()=>e,map:t=>C(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),_=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,getOrElse:t=>t,orElse:t=>t,toEither:()=>y(e),orThrow:()=>{throw e},map:t=>_(e),flatMap:t=>_(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),C= exports.n =e=>{try{return v(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var g=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>g(e),map:t=>g(t(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:()=>s([e]),contains:t=>t===e,size:1,toEither:t=>b(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:()=>R,flatMap:()=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>s([]),contains:()=>!1,size:0,toEither:e=>y(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},T= exports.b =()=>R,f= exports.c =e=>e!=null?g(e):T();exports.a = g; exports.b = T; exports.c = f; exports.d = m; exports.e = s; exports.f = h; exports.g = A; exports.h = b; exports.i = y; exports.j = Ae; exports.k = ue; exports.l = ce; exports.m = he; exports.n = C;
|
package/dist/chunk-MDNYGGCI.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O}from"./chunk-2I2NKDFN.mjs";import{a as B}from"./chunk-RRAIFS3D.mjs";import{a as S}from"./chunk-377WQNCB.mjs";import{a as L}from"./chunk-HA5XD5KC.mjs";var m=e=>{let t=B(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=>m(r.map(o)),flatMap:o=>m(r.flatMap(i=>o(i).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>m(r.filter(o)),filterNot:o=>m(r.filter(i=>!o(i))),find:o=>f(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?f(r[0]):T()},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=>i=>r.reduce(i,o),foldRight:o=>i=>r.reduceRight((a,p)=>i(p,a),o),valueOf:()=>({values:r})}},s=e=>m(e);var d=e=>{let t=B(e)?new L(e):new L(e?.toArray()??[]),r=s(t),o={...r,add:i=>d([...t,i]),remove:i=>{let a=new L(t);return a.delete(i),d(a)},contains:i=>t.has(i),has:i=>t.has(i),map:i=>d(r.map(i)),flatMap:i=>d(r.flatMap(i)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},h=e=>d(e);var c=e=>{function t(a){return a!=null&&typeof a[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=s(r),i={...o,length:r.length,map:a=>c(r.map(a)),flatMap:a=>c(o.flatMap(a)),remove:a=>{let p=r.indexOf(a);return i.removeAt(p)},contains:a=>r.includes(a),add:a=>c([...r,a]),removeAt:a=>a<0||a>=r.length?i:c([...r.slice(0,a),...r.slice(a+1)]),get:a=>f(r[a]),concat:a=>c([...r,...a.toArray()]),toList:()=>i,toSet:()=>h(r),toString:()=>`List(${r.toString()})`};return new Proxy(i,{get(a,p){return typeof p=="symbol"||isNaN(Number(p))?a[p]:a.get(Number(p))}})},A=e=>c(e);var U=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,map:t=>U(t(e)),flatMap:t=>t(e),toOption:()=>g(e),toList:()=>A([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),E=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,map:t=>E(e),flatMap:t=>E(e),toOption:()=>T(),toList:()=>A(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),b=e=>U(e),y=e=>E(e),Ae=e=>e.isRight(),ue=e=>e.isLeft(),ce=(e,t)=>{try{return b(e())}catch(r){return y(t(r))}};var u=e=>{let t={values:new S(e)},r=()=>Array.from(t.values.entries()).map(([n,l])=>O([n,l])),o=n=>u(new S(t.values).set(n.toArray()[0],n.toArray()[1]).entries()),i=n=>{let l=new S(t.values);return l.delete(n)?u(l.entries()):u(t.values.entries())},a=n=>t.values.get(n[0])===n[1],p=()=>t.values.size,x=n=>u(Array.from(t.values.entries()).map(([l,q])=>[l,n(q)])),V=n=>{let l=u(t.values.entries()).toList();return u(l.flatMap(n).toArray())},K=n=>s(r()).reduce(n),I=n=>s(r()).reduceRight(n),M=n=>l=>s(r()).foldLeft(n)(l),N=n=>l=>s(r()).foldRight(n)(l),z=n=>f(t.values.get(n)),w=(n,l)=>f(t.values.get(n)).getOrElse(l),F=()=>t.values.size===0;return{add:o,remove:i,contains:a,get size(){return p()},map:x,flatMap:V,reduce:K,reduceRight:I,foldLeft:M,foldRight:N,get:z,getOrElse:w,get isEmpty(){return F()},orElse:(n,l)=>f(t.values.get(n)).orElse(l),toList:()=>A(r()),toSet:()=>h(r()),toString:()=>`Map(${r().toString()})`}},he=e=>u(e);var v=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,getOrElse:t=>e,orElse:t=>v(e),toEither:()=>b(e),orThrow:()=>e,map:t=>C(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),_=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,getOrElse:t=>t,orElse:t=>t,toEither:()=>y(e),orThrow:()=>{throw e},map:t=>_(e),flatMap:t=>_(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),C=e=>{try{return v(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var g=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>g(e),map:t=>g(t(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:()=>s([e]),contains:t=>t===e,size:1,toEither:t=>b(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:()=>R,flatMap:()=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>s([]),contains:()=>!1,size:0,toEither:e=>y(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},T=()=>R,f=e=>e!=null?g(e):T();export{g as a,T as b,f as c,m as d,s as e,h as f,A as g,b as h,y as i,Ae as j,ue as k,ce as l,he as m,C as n};
|