functype 0.8.35 → 0.8.36
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-5NZRFQ7O.mjs +1 -0
- package/dist/chunk-OTZ4XGNK.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/{index-B6k3GVAd.d.ts → index-Bvqg1Srg.d.ts} +47 -55
- package/dist/{index-Cwkc_dEO.d.mts → index-D6OHxaFT.d.mts} +47 -55
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/index.d.mts +1 -1
- package/dist/iterable/index.d.ts +1 -1
- package/dist/iterable/index.js +1 -1
- package/dist/iterable/index.mjs +1 -1
- package/dist/list/List.d.mts +1 -1
- package/dist/list/List.d.ts +1 -1
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/map/Map.d.mts +1 -1
- package/dist/map/Map.d.ts +1 -1
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/option/Option.d.mts +1 -1
- package/dist/option/Option.d.ts +1 -1
- package/dist/option/Option.js +1 -1
- package/dist/option/Option.mjs +1 -1
- package/dist/set/Set.d.mts +1 -1
- package/dist/set/Set.d.ts +1 -1
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/try/Try.d.mts +1 -1
- package/dist/try/Try.d.ts +1 -1
- package/dist/try/Try.js +1 -1
- package/dist/try/Try.mjs +1 -1
- package/dist/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/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 _chunkOTZ4XGNKjs = require('../chunk-OTZ4XGNK.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.List = _chunkOTZ4XGNKjs.e;
|
package/dist/list/List.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as a}from"../chunk-5NZRFQ7O.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.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 _chunkOTZ4XGNKjs = require('../chunk-OTZ4XGNK.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Map = _chunkOTZ4XGNKjs.s;
|
package/dist/map/Map.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a}from"../chunk-5NZRFQ7O.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.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-D6OHxaFT.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-Bvqg1Srg.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 _chunkOTZ4XGNKjs = require('../chunk-OTZ4XGNK.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.None = _chunkOTZ4XGNKjs.b; exports.Option = _chunkOTZ4XGNKjs.c; exports.Some = _chunkOTZ4XGNKjs.a;
|
package/dist/option/Option.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-5NZRFQ7O.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.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 _chunkOTZ4XGNKjs = require('../chunk-OTZ4XGNK.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Set = _chunkOTZ4XGNKjs.d;
|
package/dist/set/Set.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as a}from"../chunk-5NZRFQ7O.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.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 _chunkOTZ4XGNKjs = require('../chunk-OTZ4XGNK.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');exports.Try = _chunkOTZ4XGNKjs.t;
|
package/dist/try/Try.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as a}from"../chunk-5NZRFQ7O.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.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 _chunkOTZ4XGNKjs = require('../chunk-OTZ4XGNK.js');require('../chunk-SQWNJC6O.js');require('../chunk-5O6YELD3.js');require('../chunk-2U34DUZU.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');require('../chunk-WTWWDZY6.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkOTZ4XGNKjs.g.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkOTZ4XGNKjs.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-5NZRFQ7O.mjs";import"../chunk-JF5YGNCO.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.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.36",
|
|
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.15.0",
|
|
17
17
|
"@types/jest": "29.5.14",
|
|
18
|
-
"@types/node": "^22.9.
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
20
|
-
"@typescript-eslint/parser": "^8.
|
|
18
|
+
"@types/node": "^22.9.3",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
20
|
+
"@typescript-eslint/parser": "^8.15.0",
|
|
21
21
|
"cross-env": "^7.0.3",
|
|
22
|
-
"eslint": "^9.
|
|
22
|
+
"eslint": "^9.15.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": "^5.
|
|
34
|
+
"typescript": "^5.7.2"
|
|
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>;
|
package/lib/iterable/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Functor, Type } from "../functor";
|
|
2
|
-
import { Option } from "../option/Option";
|
|
3
|
-
export type _Iterable_<A extends Type> = {
|
|
4
|
-
count(p: (x: A) => boolean): number;
|
|
5
|
-
find(p: (a: A) => boolean): Option<A>;
|
|
6
|
-
forEach(f: (a: A) => void): void;
|
|
7
|
-
exists(p: (a: A) => boolean): boolean;
|
|
8
|
-
filter(p: (a: A) => boolean): _Iterable_<A>;
|
|
9
|
-
filterNot(p: (a: A) => boolean): _Iterable_<A>;
|
|
10
|
-
reduce(f: (b: A, a: A) => A): A;
|
|
11
|
-
reduceRight(f: (b: A, a: A) => A): A;
|
|
12
|
-
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
13
|
-
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
14
|
-
get head(): A;
|
|
15
|
-
get headOption(): Option<A>;
|
|
16
|
-
get isEmpty(): boolean;
|
|
17
|
-
map<B extends Type>(f: (a: A) => B): _Iterable_<B>;
|
|
18
|
-
flatMap<B extends Type>(f: (a: A) => _Iterable_<B> | Iterable<B>): _Iterable_<B>;
|
|
19
|
-
get size(): number;
|
|
20
|
-
toArray(): readonly A[];
|
|
21
|
-
} & Functor<A>;
|
|
22
|
-
export { Seq } from "./Seq";
|
package/lib/list/List.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Collection } from "../collections";
|
|
2
|
-
import { _Iterable_, Seq } from "../iterable";
|
|
3
|
-
import { Option } from "../option/Option";
|
|
4
|
-
import { Set } from "../set/Set";
|
|
5
|
-
import { Typeable } from "../typeable/Typeable";
|
|
6
|
-
export type List<A> = {
|
|
7
|
-
add: (item: A) => List<A>;
|
|
8
|
-
map: <B>(f: (a: A) => B) => List<B>;
|
|
9
|
-
flatMap: <B>(f: (a: A) => _Iterable_<B>) => List<B>;
|
|
10
|
-
remove: (value: A) => List<A>;
|
|
11
|
-
contains: (value: A) => boolean;
|
|
12
|
-
removeAt: (index: number) => List<A>;
|
|
13
|
-
get: (index: number) => Option<A>;
|
|
14
|
-
concat: (other: List<A>) => List<A>;
|
|
15
|
-
toList: () => List<A>;
|
|
16
|
-
toSet: () => Set<A>;
|
|
17
|
-
toString: () => string;
|
|
18
|
-
toValue: () => {
|
|
19
|
-
_tag: string;
|
|
20
|
-
value: A[];
|
|
21
|
-
};
|
|
22
|
-
} & Seq<A> & Typeable<"List">;
|
|
23
|
-
type InternalList<A> = List<A> & ArrayLike<A> & _Iterable_<A> & Collection<A>;
|
|
24
|
-
export declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
|
|
25
|
-
export declare const TestList: <A>(values?: Iterable<A> | _Iterable_<A>) => InternalList<A>;
|
|
26
|
-
export {};
|
package/lib/map/Map.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Collection } from "../collections";
|
|
2
|
-
import { Traversable } from "../index";
|
|
3
|
-
import { _Iterable_ } from "../iterable";
|
|
4
|
-
import { Option } from "../option/Option";
|
|
5
|
-
import { Tuple } from "../tuple/Tuple";
|
|
6
|
-
type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
|
|
7
|
-
export type Map<K, V> = {
|
|
8
|
-
add(item: Tuple<[K, V]>): Map<K, V>;
|
|
9
|
-
remove(value: K): Map<K, V>;
|
|
10
|
-
map<U>(f: (value: V) => U): Map<K, U>;
|
|
11
|
-
flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => _Iterable_<[K2, V2]>): Map<K2, V2>;
|
|
12
|
-
get(key: K): Option<V>;
|
|
13
|
-
getOrElse(key: K, defaultValue: V): V;
|
|
14
|
-
orElse(key: K, alternative: Option<V>): Option<V>;
|
|
15
|
-
} & SafeTraversable<K, V> & Collection<Tuple<[K, V]>>;
|
|
16
|
-
export declare const Map: <K, V>(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null) => Map<K, V>;
|
|
17
|
-
export {};
|
package/lib/map/shim.d.ts
DELETED
package/lib/option/Option.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Functor, Type } from "../functor";
|
|
2
|
-
import { Either, List, Traversable } from "../index";
|
|
3
|
-
import { Typeable } from "../typeable/Typeable";
|
|
4
|
-
export type Option<T extends Type> = {
|
|
5
|
-
readonly _tag: "Some" | "None";
|
|
6
|
-
readonly value: T | undefined;
|
|
7
|
-
isEmpty: boolean;
|
|
8
|
-
get(): T;
|
|
9
|
-
getOrElse(defaultValue: T): T;
|
|
10
|
-
orElse(alternative: Option<T>): Option<T>;
|
|
11
|
-
map<U extends Type>(f: (value: T) => U): Option<U>;
|
|
12
|
-
filter(predicate: (value: T) => boolean): Option<T>;
|
|
13
|
-
flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
|
|
14
|
-
reduce<U>(f: (acc: U, value: T) => U): U;
|
|
15
|
-
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
16
|
-
foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
|
|
17
|
-
foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
|
|
18
|
-
toList(): List<T>;
|
|
19
|
-
contains(value: T): boolean;
|
|
20
|
-
size: number;
|
|
21
|
-
toEither<E>(left: E): Either<E, T>;
|
|
22
|
-
toString(): string;
|
|
23
|
-
toValue(): {
|
|
24
|
-
_tag: "Some" | "None";
|
|
25
|
-
value: T;
|
|
26
|
-
};
|
|
27
|
-
} & (Traversable<T> & Functor<T> & Typeable<"Some" | "None">);
|
|
28
|
-
export declare const Some: <T extends Type>(value: T) => Option<T>;
|
|
29
|
-
export declare const None: <T extends Type>() => Option<T>;
|
|
30
|
-
export declare const Option: <T extends Type>(value: T | null | undefined) => Option<T>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type SerializableTypes = "json" | "yaml";
|
|
2
|
-
type SerializationMethods<T> = {
|
|
3
|
-
json: {
|
|
4
|
-
toJSON(): string;
|
|
5
|
-
fromJSON(json: string): T;
|
|
6
|
-
};
|
|
7
|
-
yaml: {
|
|
8
|
-
toYAML(): string;
|
|
9
|
-
fromYAML(yaml: string): T;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type Serializable<STypes extends SerializableTypes[], T> = T & (STypes extends [] ? NonNullable<unknown> : STypes extends [infer First, ...infer Rest] ? First extends keyof SerializationMethods<T> ? SerializationMethods<T>[First] & Serializable<Rest extends SerializableTypes[] ? Rest : [], T> : never : never);
|
|
13
|
-
export type SupportedSerializationTypes<T> = T extends Serializable<infer Types, never> ? Types : never;
|
|
14
|
-
export declare function createSerializable<STypes extends SerializableTypes[], T>(obj: T, serializationMethods: Pick<SerializationMethods<T>, STypes[number]>): Serializable<STypes, T>;
|
|
15
|
-
export {};
|