resumon 1.0.25 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resumon.es.js +37 -36
- package/dist/resumon.umd.js +1 -1
- package/package.json +14 -15
package/dist/resumon.es.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
class IllegalStateError extends Error {
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var i = (t, r, e) => r in t ? a(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var n = (t, r, e) => (i(t, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
class u extends Error {
|
|
8
5
|
}
|
|
9
|
-
class
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.error =
|
|
6
|
+
class o {
|
|
7
|
+
constructor(r) {
|
|
8
|
+
n(this, "isOk", !1);
|
|
9
|
+
n(this, "isError", !0);
|
|
10
|
+
this.error = r;
|
|
14
11
|
}
|
|
15
12
|
get() {
|
|
16
|
-
throw new
|
|
13
|
+
throw new u("Cannot get data or Err");
|
|
17
14
|
}
|
|
18
|
-
getOrElse(
|
|
19
|
-
return
|
|
15
|
+
getOrElse(r) {
|
|
16
|
+
return r;
|
|
20
17
|
}
|
|
21
18
|
getOrNull() {
|
|
22
19
|
return null;
|
|
23
20
|
}
|
|
24
21
|
getOrUndefined() {
|
|
25
|
-
return void 0;
|
|
26
22
|
}
|
|
27
23
|
getError() {
|
|
28
24
|
return this.error;
|
|
@@ -42,18 +38,18 @@ class Err {
|
|
|
42
38
|
map() {
|
|
43
39
|
return this;
|
|
44
40
|
}
|
|
45
|
-
mapError(
|
|
46
|
-
return new
|
|
41
|
+
mapError(r) {
|
|
42
|
+
return new o(r(this.error));
|
|
47
43
|
}
|
|
48
44
|
}
|
|
49
|
-
function
|
|
50
|
-
return new
|
|
45
|
+
function d(t) {
|
|
46
|
+
return new o(t);
|
|
51
47
|
}
|
|
52
|
-
class
|
|
53
|
-
constructor(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.data =
|
|
48
|
+
class s {
|
|
49
|
+
constructor(r) {
|
|
50
|
+
n(this, "isOk", !0);
|
|
51
|
+
n(this, "isError", !1);
|
|
52
|
+
this.data = r;
|
|
57
53
|
}
|
|
58
54
|
get() {
|
|
59
55
|
return this.data;
|
|
@@ -68,28 +64,33 @@ class Ok {
|
|
|
68
64
|
return this.data;
|
|
69
65
|
}
|
|
70
66
|
getError() {
|
|
71
|
-
throw new
|
|
67
|
+
throw new u("Cannot get error of Ok");
|
|
72
68
|
}
|
|
73
|
-
getErrorOrElse(
|
|
74
|
-
return
|
|
69
|
+
getErrorOrElse(r) {
|
|
70
|
+
return r;
|
|
75
71
|
}
|
|
76
72
|
getErrorOrNull() {
|
|
77
73
|
return null;
|
|
78
74
|
}
|
|
79
75
|
getErrorOrUndefined() {
|
|
80
|
-
return void 0;
|
|
81
76
|
}
|
|
82
|
-
andThen(
|
|
83
|
-
return
|
|
77
|
+
andThen(r) {
|
|
78
|
+
return r(this.data);
|
|
84
79
|
}
|
|
85
|
-
map(
|
|
86
|
-
return new
|
|
80
|
+
map(r) {
|
|
81
|
+
return new s(r(this.data));
|
|
87
82
|
}
|
|
88
83
|
mapError() {
|
|
89
84
|
return this;
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
|
-
function
|
|
93
|
-
return new
|
|
87
|
+
function h(t) {
|
|
88
|
+
return new s(t);
|
|
94
89
|
}
|
|
95
|
-
export {
|
|
90
|
+
export {
|
|
91
|
+
o as Err,
|
|
92
|
+
u as IllegalStateError,
|
|
93
|
+
s as Ok,
|
|
94
|
+
d as err,
|
|
95
|
+
h as ok
|
|
96
|
+
};
|
package/dist/resumon.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,e){typeof exports=="object"&&typeof module
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.resumon={}))})(this,function(r){"use strict";var l=Object.defineProperty;var d=(r,e,n)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var o=(r,e,n)=>(d(r,typeof e!="symbol"?e+"":e,n),n);class e extends Error{}class n{constructor(t){o(this,"isOk",!1);o(this,"isError",!0);this.error=t}get(){throw new e("Cannot get data or Err")}getOrElse(t){return t}getOrNull(){return null}getOrUndefined(){}getError(){return this.error}getErrorOrElse(){return this.error}getErrorOrNull(){return this.error}getErrorOrUndefined(){return this.error}andThen(){return this}map(){return this}mapError(t){return new n(t(this.error))}}function s(i){return new n(i)}class u{constructor(t){o(this,"isOk",!0);o(this,"isError",!1);this.data=t}get(){return this.data}getOrElse(){return this.data}getOrNull(){return this.data}getOrUndefined(){return this.data}getError(){throw new e("Cannot get error of Ok")}getErrorOrElse(t){return t}getErrorOrNull(){return null}getErrorOrUndefined(){}andThen(t){return t(this.data)}map(t){return new u(t(this.data))}mapError(){return this}}function a(i){return new u(i)}r.Err=n,r.IllegalStateError=e,r.Ok=u,r.err=s,r.ok=a,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resumon",
|
|
3
3
|
"description": "A tiny TypeScript result monad.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.29",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:DerYeger/resumon",
|
|
7
7
|
"homepage": "https://resumon.yeger.eu",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"prepare": "husky install",
|
|
22
22
|
"prebuild": "rimraf ./dist",
|
|
23
23
|
"build": "tsc --noEmit && vite build",
|
|
24
|
-
"docs:dev": "
|
|
25
|
-
"docs:build": "
|
|
24
|
+
"docs:dev": "vitepress dev docs",
|
|
25
|
+
"docs:build": "vitepress build docs",
|
|
26
26
|
"lint": "yarn lint:prettier && yarn lint:eslint",
|
|
27
27
|
"lint:commits": "yarn commitlint --from=HEAD~1",
|
|
28
28
|
"lint:eslint": "eslint \"./**/*.{js,ts,vue}\"",
|
|
@@ -50,29 +50,28 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@commitlint/cli": "17.0.3",
|
|
52
52
|
"@commitlint/config-conventional": "17.0.3",
|
|
53
|
-
"@types/node": "16.11.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
55
|
-
"@typescript-eslint/parser": "5.
|
|
56
|
-
"@vitest/ui": "0.
|
|
53
|
+
"@types/node": "16.11.47",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "5.33.0",
|
|
55
|
+
"@typescript-eslint/parser": "5.33.0",
|
|
56
|
+
"@vitest/ui": "0.21.0",
|
|
57
57
|
"@vue/component-compiler-utils": "3.3.0",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"eslint": "8.19.0",
|
|
58
|
+
"c8": "7.12.0",
|
|
59
|
+
"eslint": "8.21.0",
|
|
61
60
|
"eslint-config-prettier": "8.5.0",
|
|
62
61
|
"eslint-plugin-import": "2.26.0",
|
|
63
62
|
"eslint-plugin-prettier": "4.2.1",
|
|
64
63
|
"eslint-plugin-tsdoc": "0.2.16",
|
|
65
64
|
"eslint-plugin-unused-imports": "2.0.0",
|
|
66
|
-
"eslint-plugin-vue": "9.
|
|
65
|
+
"eslint-plugin-vue": "9.3.0",
|
|
67
66
|
"husky": "8.0.1",
|
|
68
67
|
"lint-staged": "13.0.3",
|
|
69
68
|
"prettier": "2.7.1",
|
|
70
69
|
"rimraf": "3.0.2",
|
|
71
70
|
"typescript": "4.7.4",
|
|
72
|
-
"vite": "
|
|
73
|
-
"vite-plugin-dts": "1.
|
|
74
|
-
"
|
|
75
|
-
"
|
|
71
|
+
"vite": "3.0.4",
|
|
72
|
+
"vite-plugin-dts": "1.4.1",
|
|
73
|
+
"vitepress": "1.0.0-alpha.4",
|
|
74
|
+
"vitest": "0.21.0"
|
|
76
75
|
},
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"access": "public"
|