functype 0.8.22 → 0.8.24
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-SZOZHGAQ.js +1 -0
- package/dist/chunk-TF4ZCVID.mjs +1 -0
- package/dist/collections/index.d.mts +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/either/Either.d.mts +1 -1
- package/dist/either/Either.d.ts +1 -1
- package/dist/either/Either.js +1 -1
- package/dist/either/Either.mjs +1 -1
- package/dist/either/EitherT.d.mts +1 -1
- package/dist/either/EitherT.d.ts +1 -1
- package/dist/either/EitherT.js +1 -1
- package/dist/either/EitherT.mjs +1 -1
- package/dist/{index-B3DiwP0P.d.mts → index-CLb1bm75.d.mts} +1 -0
- package/dist/{index-COhyPyGF.d.ts → index-DO4eHo7t.d.ts} +1 -0
- 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/serializable/Serializable.js +2 -2
- package/dist/serializable/Serializable.mjs +2 -2
- 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/iterable/Seq.d.ts +1 -0
- package/package.json +6 -3
- package/dist/chunk-R5GXK4Y7.mjs +0 -1
- package/dist/chunk-XF5WD6R4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var d=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,f)=>a(f,n),o),valueOf:()=>({values:r}),toString:()=>`Seq(${_safestablestringify2.default.call(void 0, e)})`}},u= 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=u(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>T(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},R= exports.f =e=>g(e);var c=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=u(r),a={...o,_tag:"List",length:r.length,map:n=>c(r.map(n)),flatMap:n=>c(o.flatMap(n)),remove:n=>{let f=r.indexOf(n);return a.removeAt(f)},contains:n=>r.includes(n),add:n=>c([...r,n]),removeAt:n=>n<0||n>=r.length?a:c([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>c([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${_safestablestringify2.default.call(void 0, e)})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,f){return typeof f=="symbol"||isNaN(Number(f))?n[f]:n.get(Number(f))}})},T= exports.g =e=>c(e),G= exports.h =e=>c(e);console.assert(G);var O=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>p(t(e)),mapAsync:t=>t(e).then(r=>p(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>L(e),toList:()=>T([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${_safestablestringify2.default.call(void 0, e)})`}),V=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>y(),toList:()=>T(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`}),p= exports.i =e=>O(e),s= exports.j =e=>V(e),B= exports.k =e=>e.isRight(),K= exports.l =e=>e.isLeft(),Be= exports.m =(e,t)=>{try{return p(e())}catch(r){return s(t(r))}},H= exports.n =e=>O(e);console.assert(H);var J=e=>V(e);console.assert(J);var xe=async(e,t)=>{try{let r=await e();return p(r)}catch(r){return s(t(r))}};function x(e){return{value:e,map(t){let r=e.then(o=>{if(B(o))try{let a=t(o.value);return p(a)}catch(a){return s(a)}else return s(o.value)});return x(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return x(r)},mapLeft(t){let r=e.then(o=>{if(K(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return p(o.value)});return x(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var m=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,l])),o=i=>m(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(i)?m(l.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],f=()=>t.values.size,M=i=>m(Array.from(t.values.entries()).map(([l,$])=>[l,i($)])),w=i=>{let l=m(t.values.entries()).toList();return m(l.flatMap(i).toArray())},P=i=>u(r()).reduce(i),q=i=>u(r()).reduceRight(i),z=i=>l=>u(r()).foldLeft(i)(l),N=i=>l=>u(r()).foldRight(i)(l),F=i=>A(t.values.get(i)),k=(i,l)=>A(t.values.get(i)).getOrElse(l),C=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return f()},map:M,flatMap:w,reduce:P,reduceRight:q,foldLeft:z,foldRight:N,get:F,getOrElse:k,get isEmpty(){return C()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>T(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},Ne= exports.r =e=>m(e);var I=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>I(e),orThrow:t=>e,toEither:()=>p(e),map:t=>W(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),S=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>S(e),flatMap:t=>S(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),W= exports.s =e=>{try{return I(e())}catch(t){return S(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)),filter(t){return t(e)?L(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>T([e]),contains:t=>t===e,size:1,toEither:t=>p(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,valueOf:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>T([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},y= exports.b =()=>h,A= exports.c =e=>e!=null?L(e):y();exports.a = L; exports.b = y; exports.c = A; exports.d = d; exports.e = u; exports.f = R; exports.g = T; exports.h = G; exports.i = p; exports.j = s; exports.k = B; exports.l = K; exports.m = Be; exports.n = H; exports.o = J; exports.p = xe; exports.q = x; exports.r = Ne; exports.s = W;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U}from"./chunk-HA5XD5KC.mjs";import{a as _}from"./chunk-2I2NKDFN.mjs";import{a as b}from"./chunk-RRAIFS3D.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import j from"safe-stable-stringify";var d=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=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,f)=>a(f,n),o),valueOf:()=>({values:r}),toString:()=>`Seq(${j(e)})`}},u=e=>d(e);var g=e=>{let t=b(e)?new U(e):new U(e?.toArray()??[]),r=u(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new U(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>T(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},R=e=>g(e);import D from"safe-stable-stringify";var c=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=u(r),a={...o,_tag:"List",length:r.length,map:n=>c(r.map(n)),flatMap:n=>c(o.flatMap(n)),remove:n=>{let f=r.indexOf(n);return a.removeAt(f)},contains:n=>r.includes(n),add:n=>c([...r,n]),removeAt:n=>n<0||n>=r.length?a:c([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>c([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${D(e)})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,f){return typeof f=="symbol"||isNaN(Number(f))?n[f]:n.get(Number(f))}})},T=e=>c(e),G=e=>c(e);console.assert(G);import v from"safe-stable-stringify";var O=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>p(t(e)),mapAsync:t=>t(e).then(r=>p(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>L(e),toList:()=>T([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${v(e)})`}),V=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>y(),toList:()=>T(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${v(e)})`}),p=e=>O(e),s=e=>V(e),B=e=>e.isRight(),K=e=>e.isLeft(),Be=(e,t)=>{try{return p(e())}catch(r){return s(t(r))}},H=e=>O(e);console.assert(H);var J=e=>V(e);console.assert(J);var xe=async(e,t)=>{try{let r=await e();return p(r)}catch(r){return s(t(r))}};function x(e){return{value:e,map(t){let r=e.then(o=>{if(B(o))try{let a=t(o.value);return p(a)}catch(a){return s(a)}else return s(o.value)});return x(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return x(r)},mapLeft(t){let r=e.then(o=>{if(K(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return p(o.value)});return x(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var m=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>_([i,l])),o=i=>m(new E(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new E(t.values);return l.delete(i)?m(l.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],f=()=>t.values.size,M=i=>m(Array.from(t.values.entries()).map(([l,$])=>[l,i($)])),w=i=>{let l=m(t.values.entries()).toList();return m(l.flatMap(i).toArray())},P=i=>u(r()).reduce(i),q=i=>u(r()).reduceRight(i),z=i=>l=>u(r()).foldLeft(i)(l),N=i=>l=>u(r()).foldRight(i)(l),F=i=>A(t.values.get(i)),k=(i,l)=>A(t.values.get(i)).getOrElse(l),C=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return f()},map:M,flatMap:w,reduce:P,reduceRight:q,foldLeft:z,foldRight:N,get:F,getOrElse:k,get isEmpty(){return C()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>T(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},Ne=e=>m(e);import Q from"safe-stable-stringify";var I=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>I(e),orThrow:t=>e,toEither:()=>p(e),map:t=>W(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${Q(e)})`}),S=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>S(e),flatMap:t=>S(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),W=e=>{try{return I(e())}catch(t){return S(t instanceof Error?t:new Error(String(t)))}};import X from"safe-stable-stringify";var L=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>L(e),map:t=>L(t(e)),filter(t){return t(e)?L(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>T([e]),contains:t=>t===e,size:1,toEither:t=>p(e),toString:()=>`Some(${X(e)})`,valueOf:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>T([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},y=()=>h,A=e=>e!=null?L(e):y();export{L as a,y as b,A as c,d,u as e,R as f,T as g,G as h,p as i,s as j,B as k,K as l,Be as m,H as n,J as o,xe as p,x as q,Ne as r,W as s};
|
package/dist/either/Either.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-
|
|
2
|
+
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-CLb1bm75.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, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-
|
|
2
|
+
export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-DO4eHo7t.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 _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.Left = _chunkSZOZHGAQjs.j; exports.Right = _chunkSZOZHGAQjs.i; exports.TypeCheckLeft = _chunkSZOZHGAQjs.o; exports.TypeCheckRight = _chunkSZOZHGAQjs.n; exports.isLeft = _chunkSZOZHGAQjs.l; exports.isRight = _chunkSZOZHGAQjs.k; exports.tryCatch = _chunkSZOZHGAQjs.m; exports.tryCatchAsync = _chunkSZOZHGAQjs.p;
|
package/dist/either/Either.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h}from"../chunk-
|
|
1
|
+
import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{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/either/EitherT.d.ts
CHANGED
package/dist/either/EitherT.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.EitherT = _chunkSZOZHGAQjs.q;
|
package/dist/either/EitherT.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as a}from"../chunk-
|
|
1
|
+
import{q as a}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{a as EitherT};
|
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, l as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, n as Traversable, m as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-
|
|
2
|
+
export { E as Either, l as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, n as Traversable, m as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-CLb1bm75.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, l as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, n as Traversable, m as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-
|
|
2
|
+
export { E as Either, l as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, n as Traversable, m as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-DO4eHo7t.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 _chunkSZOZHGAQjs = require('./chunk-SZOZHGAQ.js');require('./chunk-3VJERXBP.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');require('./chunk-BNNK42JC.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-K3EKBPQE.js');require('./chunk-5VTXJIR3.js');require('./chunk-XORABVON.js');exports.EitherT = _chunkSZOZHGAQjs.q; exports.Left = _chunkSZOZHGAQjs.j; exports.List = _chunkSZOZHGAQjs.g; exports.Map = _chunkSZOZHGAQjs.r; exports.None = _chunkSZOZHGAQjs.b; exports.Option = _chunkSZOZHGAQjs.c; exports.Right = _chunkSZOZHGAQjs.i; exports.Seq = _chunkSZOZHGAQjs.e; exports.Set = _chunkSZOZHGAQjs.f; exports.Some = _chunkSZOZHGAQjs.a; exports.TestList = _chunkSZOZHGAQjs.h; exports.Try = _chunkSZOZHGAQjs.s; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkSZOZHGAQjs.o; exports.TypeCheckRight = _chunkSZOZHGAQjs.n; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkSZOZHGAQjs.l; exports.isRight = _chunkSZOZHGAQjs.k; exports.tryCatch = _chunkSZOZHGAQjs.m; exports.tryCatchAsync = _chunkSZOZHGAQjs.p;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r,s}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 as m,o as n,p as o,q as p,r,s}from"./chunk-TF4ZCVID.mjs";import"./chunk-HA5XD5KC.mjs";import{a as q}from"./chunk-2I2NKDFN.mjs";import"./chunk-RRAIFS3D.mjs";import{a as t}from"./chunk-V7DKESTM.mjs";import"./chunk-2ML63TYF.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-V2J3R5IU.mjs";export{p as EitherT,i as Left,f as List,r as Map,b as None,c as Option,h as Right,d as Seq,e as Set,a as Some,g as TestList,s as Try,q as Tuple,n as TypeCheckLeft,m as TypeCheckRight,t as Typeable,k as isLeft,j as isRight,l as tryCatch,o 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 _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.Seq = _chunkSZOZHGAQjs.e; exports.createSeq = _chunkSZOZHGAQjs.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-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{b as Seq,a as createSeq};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { a as Seq, _ as _Iterable_ } from '../index-
|
|
2
|
+
export { a as Seq, _ as _Iterable_ } from '../index-CLb1bm75.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 _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.Seq = _chunkSZOZHGAQjs.e;
|
package/dist/iterable/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"../chunk-
|
|
1
|
+
import{e as a}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Seq};
|
package/dist/list/List.d.mts
CHANGED
package/dist/list/List.d.ts
CHANGED
package/dist/list/List.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.List = _chunkSZOZHGAQjs.g; exports.TestList = _chunkSZOZHGAQjs.h;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as a,h as b}from"../chunk-
|
|
1
|
+
import{g as a,h as b}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{a as List,b as TestList};
|
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 _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.Map = _chunkSZOZHGAQjs.r;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"../chunk-
|
|
1
|
+
import{r as a}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Map};
|
package/dist/option/Option.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { N as None, O as Option, S as Some } from '../index-
|
|
2
|
+
export { N as None, O as Option, S as Some } from '../index-CLb1bm75.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-DO4eHo7t.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 _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.None = _chunkSZOZHGAQjs.b; exports.Option = _chunkSZOZHGAQjs.c; exports.Some = _chunkSZOZHGAQjs.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{b as None,c as Option,a as Some};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);function a(e,t){return{...e,...t}}var i=a({name:"John",age:30},{json:{toJSON(){return _safestablestringify2.default.call(void 0, this)},fromJSON(e){return JSON.parse(e)}},yaml:{toYAML(){return Object.entries(this).map(([e,t])=>`${e}: ${t}`).join(`
|
|
2
2
|
`)},fromYAML(e){return Object.fromEntries(e.split(`
|
|
3
|
-
`).map(t=>t.split(": ")))}}});console.log(i.toJSON());console.log(i.toYAML());exports.createSerializable =
|
|
3
|
+
`).map(t=>t.split(": ")))}}});console.log(i.toJSON());console.log(i.toYAML());exports.createSerializable = a;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
function
|
|
1
|
+
import r from"safe-stable-stringify";function a(e,t){return{...e,...t}}var i=a({name:"John",age:30},{json:{toJSON(){return r(this)},fromJSON(e){return JSON.parse(e)}},yaml:{toYAML(){return Object.entries(this).map(([e,t])=>`${e}: ${t}`).join(`
|
|
2
2
|
`)},fromYAML(e){return Object.fromEntries(e.split(`
|
|
3
|
-
`).map(t=>t.split(": ")))}}});console.log(i.toJSON());console.log(i.toYAML());export{
|
|
3
|
+
`).map(t=>t.split(": ")))}}});console.log(i.toJSON());console.log(i.toYAML());export{a as createSerializable};
|
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 _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.Set = _chunkSZOZHGAQjs.f;
|
package/dist/set/Set.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as a}from"../chunk-
|
|
1
|
+
import{f as a}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Set};
|
package/dist/try/Try.d.mts
CHANGED
package/dist/try/Try.d.ts
CHANGED
package/dist/try/Try.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');exports.Try = _chunkSZOZHGAQjs.s;
|
package/dist/try/Try.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a}from"../chunk-
|
|
1
|
+
import{s as a}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Try};
|
package/dist/util/index.d.mts
CHANGED
package/dist/util/index.d.ts
CHANGED
package/dist/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkSZOZHGAQjs = require('../chunk-SZOZHGAQ.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkSZOZHGAQjs.j.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkSZOZHGAQjs.i.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{i as e,j as t}from"../chunk-
|
|
1
|
+
import{a as s}from"../chunk-VK5GL6NM.mjs";import{i as e,j as t}from"../chunk-TF4ZCVID.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
|
package/lib/iterable/Seq.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type Seq<A> = {
|
|
|
23
23
|
valueOf: () => {
|
|
24
24
|
values: A[];
|
|
25
25
|
};
|
|
26
|
+
toString: () => string;
|
|
26
27
|
} & _Iterable_<A>;
|
|
27
28
|
export declare const createSeq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
|
|
28
29
|
export declare const Seq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functype",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.24",
|
|
4
4
|
"description": "A smallish functional library for TypeScript",
|
|
5
5
|
"author": "jordan.burke@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"homepage": "https://github.com/jordanburke/functype#readme",
|
|
12
12
|
"url": "https://github.com/jordanburke/functype",
|
|
13
13
|
"devDependencies": {
|
|
14
|
+
"@types/jest": "29.5.13",
|
|
14
15
|
"@types/node": "^20.16.5",
|
|
15
16
|
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
16
17
|
"@typescript-eslint/parser": "^7.5.0",
|
|
17
|
-
"@types/jest": "29.5.13",
|
|
18
18
|
"cross-env": "^7.0.3",
|
|
19
19
|
"eslint": "^8.57.0",
|
|
20
20
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"jest": "^29.7.0",
|
|
25
25
|
"prettier": "^3.3.3",
|
|
26
26
|
"rimraf": "^6.0.1",
|
|
27
|
-
"tsup": "^8.3.0",
|
|
28
27
|
"ts-jest": "^29.2.5",
|
|
29
28
|
"ts-node": "^10.9.2",
|
|
29
|
+
"tsup": "^8.3.0",
|
|
30
30
|
"typescript": "^5.6.2"
|
|
31
31
|
},
|
|
32
32
|
"main": "./dist/index.js",
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
"lib",
|
|
44
44
|
"dist"
|
|
45
45
|
],
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"safe-stable-stringify": "^2.5.0"
|
|
48
|
+
},
|
|
46
49
|
"scripts": {
|
|
47
50
|
"ts-types": "tsc",
|
|
48
51
|
"build:dev": "rimraf lib && tsup --watch",
|
package/dist/chunk-R5GXK4Y7.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-2I2NKDFN.mjs";import{a as b}from"./chunk-RRAIFS3D.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import{a as U}from"./chunk-HA5XD5KC.mjs";var d=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=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,f)=>a(f,n),o),valueOf:()=>({values:r})}},u=e=>d(e);var g=e=>{let t=b(e)?new U(e):new U(e?.toArray()??[]),r=u(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new U(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>T(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},R=e=>g(e);var c=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=u(r),a={...o,_tag:"List",length:r.length,map:n=>c(r.map(n)),flatMap:n=>c(o.flatMap(n)),remove:n=>{let f=r.indexOf(n);return a.removeAt(f)},contains:n=>r.includes(n),add:n=>c([...r,n]),removeAt:n=>n<0||n>=r.length?a:c([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>c([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,f){return typeof f=="symbol"||isNaN(Number(f))?n[f]:n.get(Number(f))}})},T=e=>c(e),$=e=>c(e);console.assert($);var _=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>p(t(e)),mapAsync:t=>t(e).then(r=>p(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>L(e),toList:()=>T([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),O=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>y(),toList:()=>T(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),p=e=>_(e),s=e=>O(e),B=e=>e.isRight(),V=e=>e.isLeft(),de=(e,t)=>{try{return p(e())}catch(r){return s(t(r))}},J=e=>_(e);console.assert(J);var j=e=>O(e);console.assert(j);var ye=async(e,t)=>{try{let r=await e();return p(r)}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(o=>{if(B(o))try{let a=t(o.value);return p(a)}catch(a){return s(a)}else return s(o.value)});return S(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return S(r)},mapLeft(t){let r=e.then(o=>{if(V(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return p(o.value)});return S(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var m=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>v([i,l])),o=i=>m(new E(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new E(t.values);return l.delete(i)?m(l.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],f=()=>t.values.size,I=i=>m(Array.from(t.values.entries()).map(([l,C])=>[l,i(C)])),M=i=>{let l=m(t.values.entries()).toList();return m(l.flatMap(i).toArray())},w=i=>u(r()).reduce(i),P=i=>u(r()).reduceRight(i),N=i=>l=>u(r()).foldLeft(i)(l),z=i=>l=>u(r()).foldRight(i)(l),q=i=>A(t.values.get(i)),F=(i,l)=>A(t.values.get(i)).getOrElse(l),k=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return f()},map:I,flatMap:M,reduce:w,reduceRight:P,foldLeft:N,foldRight:z,get:q,getOrElse:F,get isEmpty(){return k()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>T(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},Ve=e=>m(e);var K=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>K(e),orThrow:t=>e,toEither:()=>p(e),map:t=>D(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),x=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>x(e),flatMap:t=>x(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),D=e=>{try{return K(e())}catch(t){return x(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)),filter(t){return t(e)?L(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>T([e]),contains:t=>t===e,size:1,toEither:t=>p(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>T([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},y=()=>h,A=e=>e!=null?L(e):y();export{L as a,y as b,A as c,d,u as e,R as f,T as g,$ as h,p as i,s as j,B as k,V as l,de as m,J as n,j as o,ye as p,S as q,Ve as r,D as s};
|
package/dist/chunk-XF5WD6R4.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 d=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,f)=>a(f,n),o),valueOf:()=>({values:r})}},u= 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=u(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>T(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},R= exports.f =e=>g(e);var c=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=u(r),a={...o,_tag:"List",length:r.length,map:n=>c(r.map(n)),flatMap:n=>c(o.flatMap(n)),remove:n=>{let f=r.indexOf(n);return a.removeAt(f)},contains:n=>r.includes(n),add:n=>c([...r,n]),removeAt:n=>n<0||n>=r.length?a:c([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>c([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,f){return typeof f=="symbol"||isNaN(Number(f))?n[f]:n.get(Number(f))}})},T= exports.g =e=>c(e),$= exports.h =e=>c(e);console.assert($);var _=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>p(t(e)),mapAsync:t=>t(e).then(r=>p(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>L(e),toList:()=>T([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),O=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>y(),toList:()=>T(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),p= exports.i =e=>_(e),s= exports.j =e=>O(e),B= exports.k =e=>e.isRight(),V= exports.l =e=>e.isLeft(),de= exports.m =(e,t)=>{try{return p(e())}catch(r){return s(t(r))}},J= exports.n =e=>_(e);console.assert(J);var j=e=>O(e);console.assert(j);var ye=async(e,t)=>{try{let r=await e();return p(r)}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(o=>{if(B(o))try{let a=t(o.value);return p(a)}catch(a){return s(a)}else return s(o.value)});return S(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return S(r)},mapLeft(t){let r=e.then(o=>{if(V(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return p(o.value)});return S(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var m=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,l])),o=i=>m(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(i)?m(l.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],f=()=>t.values.size,I=i=>m(Array.from(t.values.entries()).map(([l,C])=>[l,i(C)])),M=i=>{let l=m(t.values.entries()).toList();return m(l.flatMap(i).toArray())},w=i=>u(r()).reduce(i),P=i=>u(r()).reduceRight(i),N=i=>l=>u(r()).foldLeft(i)(l),z=i=>l=>u(r()).foldRight(i)(l),q=i=>A(t.values.get(i)),F=(i,l)=>A(t.values.get(i)).getOrElse(l),k=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return f()},map:I,flatMap:M,reduce:w,reduceRight:P,foldLeft:N,foldRight:z,get:q,getOrElse:F,get isEmpty(){return k()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>T(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},Ve= exports.r =e=>m(e);var K=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>K(e),orThrow:t=>e,toEither:()=>p(e),map:t=>D(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),x=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>x(e),flatMap:t=>x(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),D= exports.s =e=>{try{return K(e())}catch(t){return x(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)),filter(t){return t(e)?L(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>T([e]),contains:t=>t===e,size:1,toEither:t=>p(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>T([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},y= exports.b =()=>h,A= exports.c =e=>e!=null?L(e):y();exports.a = L; exports.b = y; exports.c = A; exports.d = d; exports.e = u; exports.f = R; exports.g = T; exports.h = $; exports.i = p; exports.j = s; exports.k = B; exports.l = V; exports.m = de; exports.n = J; exports.o = j; exports.p = ye; exports.q = S; exports.r = Ve; exports.s = D;
|