functype 0.8.35 → 0.8.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -43
- package/dist/chunk-4H62YQ42.mjs +0 -0
- package/dist/chunk-BOSMSYRM.mjs +1 -0
- package/dist/chunk-KJV27YM3.js +1 -0
- package/dist/chunk-WTWWDZY6.js +1 -0
- package/dist/collections/index.d.mts +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/core/task/Task.d.mts +1 -1
- package/dist/core/task/Task.d.ts +1 -1
- package/dist/core/task/Task.js +1 -1
- package/dist/core/task/Task.mjs +1 -1
- package/dist/either/Either.d.mts +1 -1
- package/dist/either/Either.d.ts +1 -1
- package/dist/either/Either.js +1 -1
- package/dist/either/Either.mjs +1 -1
- package/dist/functor/index.d.mts +4 -1
- package/dist/functor/index.d.ts +4 -1
- package/dist/{index-B6k3GVAd.d.ts → index-1xz2kaxi.d.ts} +53 -59
- package/dist/{index-Cwkc_dEO.d.mts → index-DvBKFQoa.d.mts} +53 -59
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/index.d.mts +1 -1
- package/dist/iterable/index.d.ts +1 -1
- package/dist/iterable/index.js +1 -1
- package/dist/iterable/index.mjs +1 -1
- package/dist/list/List.d.mts +2 -2
- package/dist/list/List.d.ts +2 -2
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/map/Map.d.mts +1 -1
- package/dist/map/Map.d.ts +1 -1
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/option/Option.d.mts +1 -1
- package/dist/option/Option.d.ts +1 -1
- package/dist/option/Option.js +1 -1
- package/dist/option/Option.mjs +1 -1
- package/dist/set/Set.d.mts +1 -1
- package/dist/set/Set.d.ts +1 -1
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/try/Try.d.mts +1 -1
- package/dist/try/Try.d.ts +1 -1
- package/dist/try/Try.js +1 -1
- package/dist/try/Try.mjs +1 -1
- package/dist/typeable/Typeable.d.mts +5 -4
- package/dist/typeable/Typeable.d.ts +5 -4
- 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/dist/util/isIterable.js +1 -1
- package/dist/util/isIterable.mjs +1 -1
- package/package.json +10 -10
- package/dist/chunk-52OPFRS2.js +0 -1
- package/dist/chunk-BNNK42JC.js +0 -1
- package/dist/chunk-QBAH7SOA.mjs +0 -1
- package/dist/chunk-RRAIFS3D.mjs +0 -1
- package/dist/iterable/Seq.d.mts +0 -8
- package/dist/iterable/Seq.d.ts +0 -8
- package/dist/iterable/Seq.js +0 -1
- package/dist/iterable/Seq.mjs +0 -1
- package/lib/TaskPromise.d.ts +0 -3
- package/lib/collections/index.d.ts +0 -8
- package/lib/either/Either.d.ts +0 -52
- package/lib/either/EitherT.d.ts +0 -9
- package/lib/error/ParseError.d.ts +0 -6
- package/lib/functor/index.d.ts +0 -15
- package/lib/identity/Identity.d.ts +0 -4
- package/lib/index.d.ts +0 -21
- package/lib/iterable/Seq.d.ts +0 -31
- package/lib/iterable/index.d.ts +0 -22
- package/lib/list/List.d.ts +0 -26
- package/lib/map/Map.d.ts +0 -17
- package/lib/map/shim.d.ts +0 -2
- package/lib/option/Option.d.ts +0 -30
- package/lib/serializable/Serializable.d.ts +0 -15
- package/lib/set/Set.d.ts +0 -15
- package/lib/set/shim.d.ts +0 -2
- package/lib/try/Try.d.ts +0 -18
- package/lib/tuple/Tuple.d.ts +0 -9
- package/lib/typeable/Typeable.d.ts +0 -4
- package/lib/util/index.d.ts +0 -3
- package/lib/util/isIterable.d.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.mjs';
|
|
1
|
+
export { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type } from './functor/index.mjs';
|
|
2
2
|
export { Base } from './core/base/Base.mjs';
|
|
3
3
|
export { Throwable } from './core/error/Throwable.mjs';
|
|
4
|
-
export { A as AppException,
|
|
4
|
+
export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-DvBKFQoa.mjs';
|
|
5
5
|
export { Identity } from './identity/Identity.mjs';
|
|
6
6
|
export { Tuple } from './tuple/Tuple.mjs';
|
|
7
|
-
export { Typeable } from './typeable/Typeable.mjs';
|
|
7
|
+
export { Typeable, UnTag } from './typeable/Typeable.mjs';
|
|
8
8
|
import './valuable/Valuable.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.js';
|
|
1
|
+
export { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type } from './functor/index.js';
|
|
2
2
|
export { Base } from './core/base/Base.js';
|
|
3
3
|
export { Throwable } from './core/error/Throwable.js';
|
|
4
|
-
export { A as AppException,
|
|
4
|
+
export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-1xz2kaxi.js';
|
|
5
5
|
export { Identity } from './identity/Identity.js';
|
|
6
6
|
export { Tuple } from './tuple/Tuple.js';
|
|
7
|
-
export { Typeable } from './typeable/Typeable.js';
|
|
7
|
+
export { Typeable, UnTag } from './typeable/Typeable.js';
|
|
8
8
|
import './valuable/Valuable.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('./chunk-KJV27YM3.js');var _chunkSQWNJC6Ojs = require('./chunk-SQWNJC6O.js');var _chunk2U34DUZUjs = require('./chunk-2U34DUZU.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-XORABVON.js');require('./chunk-K3EKBPQE.js');require('./chunk-WTWWDZY6.js');exports.AppException = _chunkKJV27YM3js.o; exports.AppResult = _chunkKJV27YM3js.p; exports.AsyncTask = _chunkKJV27YM3js.r; exports.Base = _chunkSQWNJC6Ojs.a; exports.Either = _chunkKJV27YM3js.n; exports.Left = _chunkKJV27YM3js.g; exports.List = _chunkKJV27YM3js.e; exports.Map = _chunkKJV27YM3js.s; exports.None = _chunkKJV27YM3js.b; exports.Option = _chunkKJV27YM3js.c; exports.Right = _chunkKJV27YM3js.f; exports.Set = _chunkKJV27YM3js.d; exports.Some = _chunkKJV27YM3js.a; exports.Task = _chunkKJV27YM3js.q; exports.Throwable = _chunk2U34DUZUjs.a; exports.Try = _chunkKJV27YM3js.t; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkKJV27YM3js.l; exports.TypeCheckRight = _chunkKJV27YM3js.k; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkKJV27YM3js.i; exports.isRight = _chunkKJV27YM3js.h; exports.tryCatch = _chunkKJV27YM3js.j; exports.tryCatchAsync = _chunkKJV27YM3js.m;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,b as e,c as f,
|
|
1
|
+
import{a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as w,t as x}from"./chunk-BOSMSYRM.mjs";import{a as b}from"./chunk-JF5YGNCO.mjs";import{a as c}from"./chunk-HD6YYUHO.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import{a as v}from"./chunk-2I2NKDFN.mjs";import{a}from"./chunk-V7DKESTM.mjs";import"./chunk-V2J3R5IU.mjs";import"./chunk-2ML63TYF.mjs";import"./chunk-4H62YQ42.mjs";export{r as AppException,s as AppResult,u as AsyncTask,b as Base,q as Either,j as Left,h as List,w as Map,e as None,f as Option,i as Right,g as Set,d as Some,t as Task,c as Throwable,x as Try,v as Tuple,o as TypeCheckLeft,n as TypeCheckRight,a as Typeable,l as isLeft,k as isRight,m as tryCatch,p as tryCatchAsync};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export {
|
|
2
|
+
export { I as IterableType } from '../index-DvBKFQoa.mjs';
|
|
3
3
|
import '../core/base/Base.mjs';
|
|
4
4
|
import '../core/error/Throwable.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";
|
|
1
|
+
"use strict";require('../chunk-WTWWDZY6.js');
|
package/dist/iterable/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../chunk-4H62YQ42.mjs";
|
package/dist/list/List.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { L as List, T as TestList } from '../index-Cwkc_dEO.mjs';
|
|
2
|
-
import '../typeable/Typeable.mjs';
|
|
3
1
|
import '../functor/index.mjs';
|
|
2
|
+
export { L as List } from '../index-DvBKFQoa.mjs';
|
|
3
|
+
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../core/base/Base.mjs';
|
|
5
5
|
import '../core/error/Throwable.mjs';
|
|
6
6
|
import '../identity/Identity.mjs';
|
package/dist/list/List.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { L as List, T as TestList } from '../index-B6k3GVAd.js';
|
|
2
|
-
import '../typeable/Typeable.js';
|
|
3
1
|
import '../functor/index.js';
|
|
2
|
+
export { L as List } from '../index-1xz2kaxi.js';
|
|
3
|
+
import '../typeable/Typeable.js';
|
|
4
4
|
import '../core/base/Base.js';
|
|
5
5
|
import '../core/error/Throwable.js';
|
|
6
6
|
import '../identity/Identity.js';
|
package/dist/list/List.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.List = _chunkKJV27YM3js.e;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";export{a as List};
|
package/dist/map/Map.d.mts
CHANGED
package/dist/map/Map.d.ts
CHANGED
package/dist/map/Map.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Map = _chunkKJV27YM3js.s;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";export{a as Map};
|
package/dist/option/Option.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.mjs';
|
|
2
|
-
export { N as None, O as Option, S as Some } from '../index-
|
|
2
|
+
export { N as None, O as Option, S as Some } from '../index-DvBKFQoa.mjs';
|
|
3
3
|
import '../typeable/Typeable.mjs';
|
|
4
4
|
import '../valuable/Valuable.mjs';
|
|
5
5
|
import '../core/base/Base.mjs';
|
package/dist/option/Option.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../functor/index.js';
|
|
2
|
-
export { N as None, O as Option, S as Some } from '../index-
|
|
2
|
+
export { N as None, O as Option, S as Some } from '../index-1xz2kaxi.js';
|
|
3
3
|
import '../typeable/Typeable.js';
|
|
4
4
|
import '../valuable/Valuable.js';
|
|
5
5
|
import '../core/base/Base.js';
|
package/dist/option/Option.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.None = _chunkKJV27YM3js.b; exports.Option = _chunkKJV27YM3js.c; exports.Some = _chunkKJV27YM3js.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";export{b as None,c as Option,a as Some};
|
package/dist/set/Set.d.mts
CHANGED
package/dist/set/Set.d.ts
CHANGED
package/dist/set/Set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Set = _chunkKJV27YM3js.d;
|
package/dist/set/Set.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";export{a as Set};
|
package/dist/try/Try.d.mts
CHANGED
package/dist/try/Try.d.ts
CHANGED
package/dist/try/Try.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Try = _chunkKJV27YM3js.t;
|
package/dist/try/Try.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as a}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";export{a as Try};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
declare function Typeable(type:
|
|
2
|
-
readonly _tag:
|
|
1
|
+
declare function Typeable<T extends string>(type: T): {
|
|
2
|
+
readonly _tag: T;
|
|
3
3
|
};
|
|
4
|
-
type Typeable<T extends string> = ReturnType<typeof Typeable
|
|
4
|
+
type Typeable<T extends string> = ReturnType<typeof Typeable<T>>;
|
|
5
|
+
type UnTag<T> = Omit<T, "_tag">;
|
|
5
6
|
|
|
6
|
-
export { Typeable };
|
|
7
|
+
export { Typeable, type UnTag };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
declare function Typeable(type:
|
|
2
|
-
readonly _tag:
|
|
1
|
+
declare function Typeable<T extends string>(type: T): {
|
|
2
|
+
readonly _tag: T;
|
|
3
3
|
};
|
|
4
|
-
type Typeable<T extends string> = ReturnType<typeof Typeable
|
|
4
|
+
type Typeable<T extends string> = ReturnType<typeof Typeable<T>>;
|
|
5
|
+
type UnTag<T> = Omit<T, "_tag">;
|
|
5
6
|
|
|
6
|
-
export { Typeable };
|
|
7
|
+
export { Typeable, type UnTag };
|
package/dist/util/index.d.mts
CHANGED
package/dist/util/index.d.ts
CHANGED
package/dist/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkKJV27YM3js = require('../chunk-KJV27YM3.js');require('../chunk-SQWNJC6O.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkKJV27YM3js.g.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkKJV27YM3js.f.call(void 0, r)};exports.parseNumber = a;
|
package/dist/util/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"../chunk-VK5GL6NM.mjs";import{
|
|
1
|
+
import{a as s}from"../chunk-VK5GL6NM.mjs";import{f as e,g as t}from"../chunk-BOSMSYRM.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-4H62YQ42.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
|
package/dist/util/isIterable.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";exports.isIterable = e;
|
package/dist/util/isIterable.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";export{e as isIterable};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functype",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.37",
|
|
4
4
|
"description": "A smallish functional library for TypeScript",
|
|
5
5
|
"author": "jordan.burke@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,27 +11,27 @@
|
|
|
11
11
|
"homepage": "https://github.com/jordanburke/functype#readme",
|
|
12
12
|
"url": "https://github.com/jordanburke/functype",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@eslint/compat": "^1.2.
|
|
15
|
-
"@eslint/eslintrc": "^3.
|
|
16
|
-
"@eslint/js": "^9.
|
|
14
|
+
"@eslint/compat": "^1.2.3",
|
|
15
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
16
|
+
"@eslint/js": "^9.16.0",
|
|
17
17
|
"@types/jest": "29.5.14",
|
|
18
|
-
"@types/node": "^22.
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
20
|
-
"@typescript-eslint/parser": "^8.
|
|
18
|
+
"@types/node": "^22.10.1",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
|
20
|
+
"@typescript-eslint/parser": "^8.16.0",
|
|
21
21
|
"cross-env": "^7.0.3",
|
|
22
|
-
"eslint": "^9.
|
|
22
|
+
"eslint": "^9.16.0",
|
|
23
23
|
"eslint-config-prettier": "^9.1.0",
|
|
24
24
|
"eslint-plugin-import": "^2.31.0",
|
|
25
25
|
"eslint-plugin-prettier": "^5.2.1",
|
|
26
26
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
27
27
|
"globals": "^15.12.0",
|
|
28
28
|
"jest": "^29.7.0",
|
|
29
|
-
"prettier": "^3.
|
|
29
|
+
"prettier": "^3.4.1",
|
|
30
30
|
"rimraf": "^6.0.1",
|
|
31
31
|
"ts-jest": "^29.2.5",
|
|
32
32
|
"ts-node": "^10.9.2",
|
|
33
33
|
"tsup": "^8.3.5",
|
|
34
|
-
"typescript": "
|
|
34
|
+
"typescript": "5.6.3"
|
|
35
35
|
},
|
|
36
36
|
"main": "./dist/index.js",
|
|
37
37
|
"module": "./dist/index.mjs",
|
package/dist/chunk-52OPFRS2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk2U34DUZUjs = require('./chunk-2U34DUZU.js');var _chunkSQWNJC6Ojs = require('./chunk-SQWNJC6O.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var A=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),p="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:p,map:o=>A(r.map(o)),flatMap:o=>A(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>A(r.filter(o)),filterNot:o=>A(r.filter(n=>!o(n))),find:o=>T(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?T(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=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((f,S)=>n(S,f),o),toString:()=>`Seq(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:p,value:r})}},L= exports.e =e=>A(e);var R=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),p={...r,add:o=>R([...t,o]),remove:o=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(o),R(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>R(r.map(o)),flatMap:o=>R(r.flatMap(o)),toList:()=>u(t),toSet:()=>p,toString:()=>`Set(${Array.from(t).toString()})`};return p},b= exports.f =e=>R(e);var d=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],p=L(r),o={...p,_tag:"List",length:r.length,map:n=>d(r.map(n)),flatMap:n=>d(p.flatMap(n)),remove:n=>{let f=r.indexOf(n);return o.removeAt(f)},contains:n=>r.includes(n),add:n=>d([...r,n]),removeAt:n=>n<0||n>=r.length?o:d([...r.slice(0,n),...r.slice(n+1)]),get:n=>T(r[n]),concat:n=>d([...r,...n.toArray()]),toList:()=>o,toSet:()=>b(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${_safestablestringify2.default.call(void 0, u(r))})`};return new Proxy(o,{get(n,f){return typeof f=="symbol"||isNaN(Number(f))?n[f]:n.get(Number(f))}})},u= exports.g =e=>d(e),W= exports.h =e=>d(e);console.assert(W);var K=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>s(t(e)),mapAsync:t=>t(e).then(r=>s(r)).catch(r=>Promise.resolve(a(r))),merge:t=>t.isLeft()?a(t.value):s([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>a(r)),toOption:()=>c(e),toList:()=>u([e]),toString:()=>`Right(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){yield e},yield:function*(){yield e},traverse:t=>{let r=t(e);return r.isLeft()?a(r.value):s([r.value])},lazyMap:function*(t){yield s(t(e))},tap:t=>(t(e),s(e)),tapLeft:t=>s(e),mapLeft:t=>s(e),bimap:(t,r)=>s(r(e)),fold:(t,r)=>r(e),swap:()=>a(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),I=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>a(e),mapAsync:t=>Promise.resolve(a(e)),merge:t=>a(e),flatMap:t=>a(e),flatMapAsync:t=>Promise.resolve(a(e)),toOption:()=>y(),toList:()=>u(),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>a(e),lazyMap:function*(t){yield a(e)},tap:t=>a(e),tapLeft:t=>(t(e),a(e)),mapLeft:t=>a(t(e)),bimap:(t,r)=>a(t(e)),fold:(t,r)=>t(e),swap:()=>s(e),then:(t,r)=>Promise.reject(e).then(null,r)}),s= exports.i =e=>K(e),a= exports.j =e=>I(e),ve= exports.k =e=>e.isRight(),Ve= exports.l =e=>e.isLeft(),Oe= exports.m =(e,t)=>{try{return s(e())}catch(r){return a(t(r))}},X= exports.n =e=>K(e);console.assert(X);var Y=e=>I(e);console.assert(Y);var we=async(e,t)=>{try{let r=await e();return s(r)}catch(r){return a(t(r))}},Z= exports.q ={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return a(r.value);t.push(r.value)}return s(t)},traverse:(e,t)=>Z.sequence(e.map(t)),fromNullable:(e,t)=>e==null?a(t):s(e),fromPredicate:(e,t,r)=>t(e)?s(e):a(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return s(r)}catch(r){return a(t(r))}}};var U=(e,t)=>{let r=_chunk2U34DUZUjs.a.call(void 0, e,t);return{..._chunkSQWNJC6Ojs.a.call(void 0, "AppException"),...a(r)}},B= exports.s =e=>({..._chunkSQWNJC6Ojs.a.call(void 0, "AppResult"),...s(e)});function M(e,t=r=>r){try{return B(e())}catch(r){return U(t(r))}}M.success=e=>B(e);M.fail=e=>U(e);async function k(e,t=r=>r){try{let r=await e();return B(r)}catch(r){let p=await t(r);return U(p)}}k.success=e=>B(e);k.fail=e=>U(e);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])),p=i=>m(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),o=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,S=i=>m(Array.from(t.values.entries()).map(([l,H])=>[l,i(H)])),q=i=>{let l=m(t.values.entries()).toList();return m(l.flatMap(i).toArray())},z=i=>L(r()).reduce(i),F=i=>L(r()).reduceRight(i),C=i=>l=>L(r()).foldLeft(i)(l),$=i=>l=>L(r()).foldRight(i)(l),j=i=>T(t.values.get(i)),G=(i,l)=>T(t.values.get(i)).getOrElse(l),D=()=>t.values.size===0;return{add:p,remove:o,contains:n,get size(){return f()},map:S,flatMap:q,reduce:z,reduceRight:F,foldLeft:C,foldRight:$,get:j,getOrElse:G,get isEmpty(){return D()},orElse:(i,l)=>T(t.values.get(i)).orElse(l),toList:()=>u(r()),toSet:()=>b(r()),toString:()=>`Map(${r().toString()})`}},He= exports.v =e=>m(e);var N=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>N(e),orThrow:t=>e,toEither:()=>s(e),map:t=>ee(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),v=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>a(e),map:t=>v(e),flatMap:t=>v(e),toString:()=>`Failure(${_safestablestringify2.default.call(void 0, e)}))`}),ee= exports.w =e=>{try{return N(e())}catch(t){return v(t instanceof Error?t:new Error(String(t)))}};var c=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:()=>c(e),getOrNull:()=>e,map:t=>c(t(e)),filter(t){return t(e)?c(e):h},fold:(t,r)=>r(e),flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>u([e]),contains:t=>t===e,size:1,toEither:t=>s(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,getOrNull:()=>null,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>u([]),contains:()=>!1,size:0,toEither:e=>a(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},y= exports.b =()=>h,T= exports.c =e=>e!=null?c(e):y();T.from=e=>T(e);T.none=()=>y();exports.a = c; exports.b = y; exports.c = T; exports.d = A; exports.e = L; exports.f = b; exports.g = u; exports.h = W; exports.i = s; exports.j = a; exports.k = ve; exports.l = Ve; exports.m = Oe; exports.n = X; exports.o = Y; exports.p = we; exports.q = Z; exports.r = U; exports.s = B; exports.t = M; exports.u = k; exports.v = He; exports.w = ee;
|
package/dist/chunk-BNNK42JC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";exports.a = e;
|
package/dist/chunk-QBAH7SOA.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O}from"./chunk-2I2NKDFN.mjs";import{a as g}from"./chunk-RRAIFS3D.mjs";import{a as V}from"./chunk-HD6YYUHO.mjs";import{a as _}from"./chunk-JF5YGNCO.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import{a as x}from"./chunk-HA5XD5KC.mjs";import te from"safe-stable-stringify";import w from"safe-stable-stringify";import Q from"safe-stable-stringify";import J from"safe-stable-stringify";var A=e=>{let t=g(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),p="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:p,map:o=>A(r.map(o)),flatMap:o=>A(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>A(r.filter(o)),filterNot:o=>A(r.filter(n=>!o(n))),find:o=>T(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?T(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=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((f,S)=>n(S,f),o),toString:()=>`Seq(${J(e)})`,toValue:()=>({_tag:p,value:r})}},L=e=>A(e);var R=e=>{let t=g(e)?new x(e):new x(e?.toArray()??[]),r=L(t),p={...r,add:o=>R([...t,o]),remove:o=>{let n=new x(t);return n.delete(o),R(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>R(r.map(o)),flatMap:o=>R(r.flatMap(o)),toList:()=>u(t),toSet:()=>p,toString:()=>`Set(${Array.from(t).toString()})`};return p},b=e=>R(e);var d=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],p=L(r),o={...p,_tag:"List",length:r.length,map:n=>d(r.map(n)),flatMap:n=>d(p.flatMap(n)),remove:n=>{let f=r.indexOf(n);return o.removeAt(f)},contains:n=>r.includes(n),add:n=>d([...r,n]),removeAt:n=>n<0||n>=r.length?o:d([...r.slice(0,n),...r.slice(n+1)]),get:n=>T(r[n]),concat:n=>d([...r,...n.toArray()]),toList:()=>o,toSet:()=>b(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${Q(u(r))})`};return new Proxy(o,{get(n,f){return typeof f=="symbol"||isNaN(Number(f))?n[f]:n.get(Number(f))}})},u=e=>d(e),W=e=>d(e);console.assert(W);var K=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>s(t(e)),mapAsync:t=>t(e).then(r=>s(r)).catch(r=>Promise.resolve(a(r))),merge:t=>t.isLeft()?a(t.value):s([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>a(r)),toOption:()=>c(e),toList:()=>u([e]),toString:()=>`Right(${w(e)})`,[Symbol.iterator]:function*(){yield e},yield:function*(){yield e},traverse:t=>{let r=t(e);return r.isLeft()?a(r.value):s([r.value])},lazyMap:function*(t){yield s(t(e))},tap:t=>(t(e),s(e)),tapLeft:t=>s(e),mapLeft:t=>s(e),bimap:(t,r)=>s(r(e)),fold:(t,r)=>r(e),swap:()=>a(e),then:(t,r)=>Promise.resolve(e).then(t,r)}),I=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>a(e),mapAsync:t=>Promise.resolve(a(e)),merge:t=>a(e),flatMap:t=>a(e),flatMapAsync:t=>Promise.resolve(a(e)),toOption:()=>y(),toList:()=>u(),toString:()=>`Left(${w(e)})`,[Symbol.iterator]:function*(){},yield:function*(){},traverse:t=>a(e),lazyMap:function*(t){yield a(e)},tap:t=>a(e),tapLeft:t=>(t(e),a(e)),mapLeft:t=>a(t(e)),bimap:(t,r)=>a(t(e)),fold:(t,r)=>t(e),swap:()=>s(e),then:(t,r)=>Promise.reject(e).then(null,r)}),s=e=>K(e),a=e=>I(e),ve=e=>e.isRight(),Ve=e=>e.isLeft(),Oe=(e,t)=>{try{return s(e())}catch(r){return a(t(r))}},X=e=>K(e);console.assert(X);var Y=e=>I(e);console.assert(Y);var we=async(e,t)=>{try{let r=await e();return s(r)}catch(r){return a(t(r))}},Z={sequence:e=>{let t=[];for(let r of e){if(r.isLeft())return a(r.value);t.push(r.value)}return s(t)},traverse:(e,t)=>Z.sequence(e.map(t)),fromNullable:(e,t)=>e==null?a(t):s(e),fromPredicate:(e,t,r)=>t(e)?s(e):a(r),ap:(e,t)=>e.flatMap(r=>t.map(r)),fromPromise:async(e,t)=>{try{let r=await e;return s(r)}catch(r){return a(t(r))}}};var U=(e,t)=>{let r=V(e,t);return{..._("AppException"),...a(r)}},B=e=>({..._("AppResult"),...s(e)});function M(e,t=r=>r){try{return B(e())}catch(r){return U(t(r))}}M.success=e=>B(e);M.fail=e=>U(e);async function k(e,t=r=>r){try{let r=await e();return B(r)}catch(r){let p=await t(r);return U(p)}}k.success=e=>B(e);k.fail=e=>U(e);var m=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>O([i,l])),p=i=>m(new E(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),o=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,S=i=>m(Array.from(t.values.entries()).map(([l,H])=>[l,i(H)])),q=i=>{let l=m(t.values.entries()).toList();return m(l.flatMap(i).toArray())},z=i=>L(r()).reduce(i),F=i=>L(r()).reduceRight(i),C=i=>l=>L(r()).foldLeft(i)(l),$=i=>l=>L(r()).foldRight(i)(l),j=i=>T(t.values.get(i)),G=(i,l)=>T(t.values.get(i)).getOrElse(l),D=()=>t.values.size===0;return{add:p,remove:o,contains:n,get size(){return f()},map:S,flatMap:q,reduce:z,reduceRight:F,foldLeft:C,foldRight:$,get:j,getOrElse:G,get isEmpty(){return D()},orElse:(i,l)=>T(t.values.get(i)).orElse(l),toList:()=>u(r()),toSet:()=>b(r()),toString:()=>`Map(${r().toString()})`}},He=e=>m(e);import P from"safe-stable-stringify";var N=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>N(e),orThrow:t=>e,toEither:()=>s(e),map:t=>ee(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${P(e)})`}),v=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>a(e),map:t=>v(e),flatMap:t=>v(e),toString:()=>`Failure(${P(e)}))`}),ee=e=>{try{return N(e())}catch(t){return v(t instanceof Error?t:new Error(String(t)))}};var c=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,getOrThrow:()=>e,orElse:()=>c(e),getOrNull:()=>e,map:t=>c(t(e)),filter(t){return t(e)?c(e):h},fold:(t,r)=>r(e),flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>u([e]),contains:t=>t===e,size:1,toEither:t=>s(e),toString:()=>`Some(${te(e)})`,toValue:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,getOrThrow(e){throw e},orElse:e=>e,getOrNull:()=>null,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},fold:(e,t)=>e(),foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>u([]),contains:()=>!1,size:0,toEither:e=>a(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},y=()=>h,T=e=>e!=null?c(e):y();T.from=e=>T(e);T.none=()=>y();export{c as a,y as b,T as c,A as d,L as e,b as f,u as g,W as h,s as i,a as j,ve as k,Ve as l,Oe as m,X as n,Y as o,we as p,Z as q,U as r,B as s,M as t,k as u,He as v,ee as w};
|
package/dist/chunk-RRAIFS3D.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";export{e as a};
|
package/dist/iterable/Seq.d.mts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { a as Seq, c as createSeq } from '../index-Cwkc_dEO.mjs';
|
|
2
|
-
import '../typeable/Typeable.mjs';
|
|
3
|
-
import '../functor/index.mjs';
|
|
4
|
-
import '../core/base/Base.mjs';
|
|
5
|
-
import '../core/error/Throwable.mjs';
|
|
6
|
-
import '../identity/Identity.mjs';
|
|
7
|
-
import '../tuple/Tuple.mjs';
|
|
8
|
-
import '../valuable/Valuable.mjs';
|
package/dist/iterable/Seq.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { a as Seq, c as createSeq } from '../index-B6k3GVAd.js';
|
|
2
|
-
import '../typeable/Typeable.js';
|
|
3
|
-
import '../functor/index.js';
|
|
4
|
-
import '../core/base/Base.js';
|
|
5
|
-
import '../core/error/Throwable.js';
|
|
6
|
-
import '../identity/Identity.js';
|
|
7
|
-
import '../tuple/Tuple.js';
|
|
8
|
-
import '../valuable/Valuable.js';
|
package/dist/iterable/Seq.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk52OPFRS2js = require('../chunk-52OPFRS2.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-2U34DUZU.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunk52OPFRS2js.e; exports.createSeq = _chunk52OPFRS2js.d;
|
package/dist/iterable/Seq.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as a,e as b}from"../chunk-QBAH7SOA.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Seq,a as createSeq};
|
package/lib/TaskPromise.d.ts
DELETED
package/lib/either/Either.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Functor, Type } from "../functor";
|
|
2
|
-
import { List } from "../list/List";
|
|
3
|
-
import { Option } from "../option/Option";
|
|
4
|
-
import { Typeable } from "../typeable/Typeable";
|
|
5
|
-
export type Either<L extends Type, R extends Type> = {
|
|
6
|
-
readonly _tag: "Left" | "Right";
|
|
7
|
-
value: L | R;
|
|
8
|
-
isLeft: () => boolean;
|
|
9
|
-
isRight: () => boolean;
|
|
10
|
-
getOrElse: (defaultValue: R) => R;
|
|
11
|
-
getOrThrow: () => R;
|
|
12
|
-
map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
|
|
13
|
-
merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>;
|
|
14
|
-
mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
|
|
15
|
-
flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
|
|
16
|
-
flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
|
|
17
|
-
toOption: () => Option<R>;
|
|
18
|
-
toList: () => List<R>;
|
|
19
|
-
toString: () => string;
|
|
20
|
-
[Symbol.iterator]: () => Iterator<R>;
|
|
21
|
-
yield: () => Generator<R, void, unknown>;
|
|
22
|
-
traverse: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U[]>;
|
|
23
|
-
lazyMap: <U extends Type>(f: (value: R) => U) => Generator<Either<L, U>, void, unknown>;
|
|
24
|
-
tap: (f: (value: R) => void) => Either<L, R>;
|
|
25
|
-
tapLeft: (f: (value: L) => void) => Either<L, R>;
|
|
26
|
-
mapLeft: <L2 extends Type>(f: (value: L) => L2) => Either<L2, R>;
|
|
27
|
-
bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>;
|
|
28
|
-
fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T;
|
|
29
|
-
swap: () => Either<R, L>;
|
|
30
|
-
} & Typeable<"Left" | "Right"> & PromiseLike<R>;
|
|
31
|
-
export type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
|
|
32
|
-
export declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
|
|
33
|
-
export declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
|
|
34
|
-
export declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
|
|
35
|
-
value: R;
|
|
36
|
-
};
|
|
37
|
-
export declare const isLeft: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
|
|
38
|
-
value: L;
|
|
39
|
-
};
|
|
40
|
-
export declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
41
|
-
export declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
|
|
42
|
-
export declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
|
|
43
|
-
export declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
|
|
44
|
-
export declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
|
|
45
|
-
export declare const Either: {
|
|
46
|
-
sequence: <L extends Type, R extends Type>(eithers: Either<L, R>[]) => Either<L, R[]>;
|
|
47
|
-
traverse: <L extends Type, R extends Type, U extends Type>(arr: R[], f: (value: R) => Either<L, U>) => Either<L, U[]>;
|
|
48
|
-
fromNullable: <L extends Type, R extends Type>(value: R | null | undefined, leftValue: L) => Either<L, R>;
|
|
49
|
-
fromPredicate: <L extends Type, R extends Type>(value: R, predicate: (value: R) => boolean, leftValue: L) => Either<L, R>;
|
|
50
|
-
ap: <L extends Type, R extends Type, U extends Type>(eitherF: Either<L, (value: R) => U>, eitherV: Either<L, R>) => Either<L, U>;
|
|
51
|
-
fromPromise: <L, R>(promise: Promise<R>, onRejected: (reason: unknown) => L) => Promise<Either<L, R>>;
|
|
52
|
-
};
|
package/lib/either/EitherT.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Either } from "./Either";
|
|
2
|
-
export type EitherT<L, R> = {
|
|
3
|
-
value: Promise<Either<L, R>>;
|
|
4
|
-
map<U>(f: (value: R) => U): EitherT<L, U>;
|
|
5
|
-
flatMap<U>(f: (value: R) => EitherT<L, U>): EitherT<L, U>;
|
|
6
|
-
mapLeft<U>(f: (value: L) => U): EitherT<U, R>;
|
|
7
|
-
fold<U>(onLeft: (error: L) => U, onRight: (value: R) => U): Promise<U>;
|
|
8
|
-
};
|
|
9
|
-
export declare function EitherT<L, R>(value: Promise<Either<L, R>>): EitherT<L, R>;
|
package/lib/functor/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type SingleType = unknown;
|
|
2
|
-
export type ArrayType = SingleType[];
|
|
3
|
-
export type Type = SingleType | ArrayType;
|
|
4
|
-
export type AbstractFunctor<A extends Type> = {
|
|
5
|
-
map(f: (value: A) => Type): AbstractFunctor<Type>;
|
|
6
|
-
flatMap(f: (value: A) => AbstractFunctor<Type>): AbstractFunctor<Type>;
|
|
7
|
-
};
|
|
8
|
-
export type Functor<A extends Type> = AbstractFunctor<A> & {
|
|
9
|
-
map<B extends Type>(f: (value: A) => B): Functor<B>;
|
|
10
|
-
flatMap<B extends Type>(f: (value: A) => Functor<B>): Functor<B>;
|
|
11
|
-
};
|
|
12
|
-
export type ArrayFunctor<A extends ArrayType> = AbstractFunctor<A> & {
|
|
13
|
-
map<U extends ArrayType>(f: (value: A) => U): ArrayFunctor<U>;
|
|
14
|
-
flatMap<U extends ArrayType>(f: (value: A) => ArrayFunctor<U>): ArrayFunctor<U>;
|
|
15
|
-
};
|
package/lib/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Functor, Type } from "./functor";
|
|
2
|
-
export type Traversable<A extends Type> = Functor<A> & {
|
|
3
|
-
get size(): number;
|
|
4
|
-
get isEmpty(): boolean;
|
|
5
|
-
contains(value: A): boolean;
|
|
6
|
-
reduce(f: (b: A, a: A) => A): A;
|
|
7
|
-
reduceRight(f: (b: A, a: A) => A): A;
|
|
8
|
-
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
9
|
-
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
10
|
-
};
|
|
11
|
-
export * from "./either/Either";
|
|
12
|
-
export * from "./functor";
|
|
13
|
-
export * from "./identity/Identity";
|
|
14
|
-
export * from "./iterable";
|
|
15
|
-
export * from "./list/List";
|
|
16
|
-
export * from "./map/Map";
|
|
17
|
-
export * from "./option/Option";
|
|
18
|
-
export * from "./set/Set";
|
|
19
|
-
export * from "./try/Try";
|
|
20
|
-
export * from "./tuple/Tuple";
|
|
21
|
-
export * from "./typeable/Typeable";
|
package/lib/iterable/Seq.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Option } from "../option/Option";
|
|
2
|
-
import { Typeable } from "../typeable/Typeable";
|
|
3
|
-
import { _Iterable_ } from "./index";
|
|
4
|
-
export type Seq<A> = {
|
|
5
|
-
readonly length: number;
|
|
6
|
-
readonly [Symbol.iterator]: () => Iterator<A>;
|
|
7
|
-
map: <B>(f: (a: A) => B) => Seq<B>;
|
|
8
|
-
flatMap: <B>(f: (a: A) => _Iterable_<B>) => Seq<B>;
|
|
9
|
-
forEach: (f: (a: A) => void) => void;
|
|
10
|
-
count: (p: (x: A) => boolean) => number;
|
|
11
|
-
exists: (p: (a: A) => boolean) => boolean;
|
|
12
|
-
filter: (p: (a: A) => boolean) => Seq<A>;
|
|
13
|
-
filterNot: (p: (a: A) => boolean) => Seq<A>;
|
|
14
|
-
find: (p: (a: A) => boolean) => Option<A>;
|
|
15
|
-
readonly head: A;
|
|
16
|
-
readonly headOption: Option<A>;
|
|
17
|
-
readonly isEmpty: boolean;
|
|
18
|
-
readonly size: number;
|
|
19
|
-
toArray: () => A[];
|
|
20
|
-
reduce: (f: (prev: A, curr: A) => A) => A;
|
|
21
|
-
reduceRight: (f: (prev: A, curr: A) => A) => A;
|
|
22
|
-
foldLeft: <B>(z: B) => (op: (b: B, a: A) => B) => B;
|
|
23
|
-
foldRight: <B>(z: B) => (op: (a: A, b: B) => B) => B;
|
|
24
|
-
toString: () => string;
|
|
25
|
-
toValue: () => {
|
|
26
|
-
_tag: string;
|
|
27
|
-
value: A[];
|
|
28
|
-
};
|
|
29
|
-
} & _Iterable_<A> & Typeable<"Seq">;
|
|
30
|
-
export declare const createSeq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
|
|
31
|
-
export declare const Seq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
|