functype 0.8.84 → 0.8.85

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.
@@ -267,7 +267,7 @@ interface Set<A> extends FunctypeCollection<A, "Set">, Collection<A> {
267
267
  fold: <U extends Type>(onEmpty: () => U, onValue: (value: A) => U) => U;
268
268
  toList: () => List<A>;
269
269
  toSet: () => Set<A>;
270
- toArray: <B = A>() => readonly B[];
270
+ toArray: <B = A>() => B[];
271
271
  toString: () => string;
272
272
  }
273
273
  declare const Set: (<A>(iterable?: Iterable<A>) => Set<A>) & {
@@ -507,7 +507,7 @@ interface CollectionOps<A extends Type, Self> {
507
507
  /**
508
508
  * Converts the collection to an array.
509
509
  */
510
- toArray<B = A>(): readonly B[];
510
+ toArray<B = A>(): B[];
511
511
  }
512
512
 
513
513
  /**
@@ -706,4 +706,4 @@ declare const Either: {
706
706
  fromBinary: <L extends Type, R extends Type>(binary: string) => Either<L, R>;
707
707
  };
708
708
 
709
- export { type AsyncMonad as A, type Collection as C, Either as E, type Foldable as F, List as L, type Matchable as M, None as N, Option as O, type Pipe as P, Right as R, type Serializable as S, type Traversable as T, type FunctypeBase as a, type Extractable as b, type TestEither as c, Left as d, isLeft as e, TypeCheckRight as f, TypeCheckLeft as g, tryCatchAsync as h, isRight as i, type Functype as j, type FunctypeCollection as k, MatchableUtils as l, Some as m, OptionConstructor as n, type SerializationMethods as o, Set as p, type CollectionOps as q, type ContainerOps as r, type Applicative as s, tryCatch as t, type Functor as u, type Monad as v };
709
+ export { type Applicative as A, type Collection as C, Either as E, type Foldable as F, List as L, type Matchable as M, None as N, Option as O, type Pipe as P, Right as R, type Serializable as S, type Traversable as T, type FunctypeBase as a, type Extractable as b, type TestEither as c, Left as d, isLeft as e, TypeCheckRight as f, TypeCheckLeft as g, tryCatchAsync as h, isRight as i, type Functype as j, type FunctypeCollection as k, MatchableUtils as l, Some as m, OptionConstructor as n, type SerializationMethods as o, Set as p, type CollectionOps as q, type ContainerOps as r, type AsyncMonad as s, tryCatch as t, type Functor as u, type Monad as v };
@@ -38,5 +38,5 @@ value: ${JSON.stringify(r)}`,toBinary:()=>Buffer.from(JSON.stringify({_tag:"Stac
38
38
  `)[1]?.split(": ")[1];if(!r)return ge([]);let n=JSON.parse(r);return ge(n)},fromBinary:e=>{let t=Buffer.from(e,"base64").toString();return _e.fromJSON(t)}},ge=E(at,_e);var b=e=>({_tag:"Some",value:e,isEmpty:false,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:t=>b(e),orNull:()=>e,orUndefined:()=>e,map:t=>b(t(e)),ap:t=>t._tag==="Some"&&t.value?b(t.value(e)):K,filter(t){return t(e)?b(e):K},count:t=>t(e)?1:0,find:t=>t(e)?b(e):K,exists:t=>t(e),forEach:t=>t(e),fold:(t,r)=>r(e),match:t=>t.Some(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:()=>m([e]),contains:t=>t===e,size:1,toEither:t=>T(e),toString:()=>`Some(${te(e)})`,toValue:()=>({_tag:"Some",value:e}),pipe:t=>t(e),serialize:()=>({toJSON:()=>JSON.stringify({_tag:"Some",value:e}),toYAML:()=>`_tag: Some
39
39
  value: ${te(e)}`,toBinary:()=>Buffer.from(JSON.stringify({_tag:"Some",value:e})).toString("base64")})}),K={_tag:"None",value:void 0,isEmpty:true,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,orNull:()=>null,orUndefined:()=>{},map:e=>K,ap:e=>K,filter(e){return K},count:e=>0,find:e=>K,exists:e=>false,forEach:e=>{},flatMap:e=>K,flatMapAsync:async e=>K,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),match:e=>e.None(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>m([]),contains:()=>false,size:0,toEither:e=>c(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0}),pipe:e=>e(void 0),serialize:()=>({toJSON:()=>JSON.stringify({_tag:"None",value:null}),toYAML:()=>`_tag: None
40
40
  value: null`,toBinary:()=>Buffer.from(JSON.stringify({_tag:"None",value:null})).toString("base64")})},k=()=>K,st=e=>e!=null?b(e):k(),Ce={from:e=>f(e),none:()=>k(),fromJSON:e=>{let t=JSON.parse(e);return t._tag==="Some"?b(t.value):k()},fromYAML:e=>{let t=e.split(`
41
- `),r=t[0]?.split(": ")[1],n=t[1]?.split(": ")[1];if(!r||!n)return k();let o=n==="null"?null:JSON.parse(n);return r==="Some"?b(o):k()},fromBinary:e=>{let t=Buffer.from(e,"base64").toString();return Ce.fromJSON(t)}},f=E(st,Ce);export{me as $,$t as A,Jt as B,Wt as C,Dt as D,Ht as E,H as F,ie as G,R as H,He as I,fe as J,Qe as K,Ue as L,Se as M,Te as N,F as O,Oe as P,le as Q,yr as R,dr as S,gr as T,xr as U,de as V,w as W,_r as X,N as Y,Qr as Z,re as _,E as a,ot as aa,b,ge as ba,k as c,st as d,f as e,Y as f,m as g,T as h,c as i,bt as j,vt as k,wt as l,We as m,je as n,Ut as o,xe as p,M as q,Ye as r,Nt as s,zt as t,_t as u,Ft as v,Ct as w,Vt as x,Kt as y,It as z};//# sourceMappingURL=chunk-JMCOLAJY.mjs.map
42
- //# sourceMappingURL=chunk-JMCOLAJY.mjs.map
41
+ `),r=t[0]?.split(": ")[1],n=t[1]?.split(": ")[1];if(!r||!n)return k();let o=n==="null"?null:JSON.parse(n);return r==="Some"?b(o):k()},fromBinary:e=>{let t=Buffer.from(e,"base64").toString();return Ce.fromJSON(t)}},f=E(st,Ce);export{me as $,$t as A,Jt as B,Wt as C,Dt as D,Ht as E,H as F,ie as G,R as H,He as I,fe as J,Qe as K,Ue as L,Se as M,Te as N,F as O,Oe as P,le as Q,yr as R,dr as S,gr as T,xr as U,de as V,w as W,_r as X,N as Y,Qr as Z,re as _,E as a,ot as aa,b,ge as ba,k as c,st as d,f as e,Y as f,m as g,T as h,c as i,bt as j,vt as k,wt as l,We as m,je as n,Ut as o,xe as p,M as q,Ye as r,Nt as s,zt as t,_t as u,Ft as v,Ct as w,Vt as x,Kt as y,It as z};//# sourceMappingURL=chunk-JAPOUVPL.mjs.map
42
+ //# sourceMappingURL=chunk-JAPOUVPL.mjs.map