resumon 1.0.74 → 1.1.0
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 +9 -18
- package/dist/{resumon.es.js → resumon.es.mjs} +0 -0
- package/dist/resumon.umd.js +1 -1
- package/dist/types/err.d.ts +1 -1
- package/dist/types/ok.d.ts +1 -1
- package/package.json +27 -56
package/README.md
CHANGED
|
@@ -5,23 +5,14 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<a href="https://
|
|
9
|
-
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
<p align="center">
|
|
14
|
-
<a href="https://github.com/DerYeger/resumon/actions/workflows/ci.yml">
|
|
15
|
-
<img alt="CI" src="https://img.shields.io/github/workflow/status/DerYeger/resumon/CI?label=ci&logo=github&color=#4DC71F">
|
|
8
|
+
<a href="https://github.com/DerYeger/yeger/actions/workflows/ci.yml">
|
|
9
|
+
<img alt="CI" src="https://img.shields.io/github/workflow/status/DerYeger/yeger/CI?label=ci&logo=github&color=#4DC71F">
|
|
16
10
|
</a>
|
|
17
11
|
<a href="https://www.npmjs.com/package/resumon">
|
|
18
12
|
<img alt="NPM" src="https://img.shields.io/npm/v/resumon?logo=npm">
|
|
19
13
|
</a>
|
|
20
|
-
<a href="https://codecov.io/gh/DerYeger/resumon">
|
|
21
|
-
<img alt="Coverage" src="https://codecov.io/gh/DerYeger/
|
|
22
|
-
</a>
|
|
23
|
-
<a href="https://lgtm.com/projects/g/DerYeger/resumon">
|
|
24
|
-
<img alt="LGTM Grade" src="https://img.shields.io/lgtm/grade/javascript/github/DerYeger/resumon?logo=lgtm">
|
|
14
|
+
<a href="https://app.codecov.io/gh/DerYeger/yeger/tree/main/packages/resumon">
|
|
15
|
+
<img alt="Coverage" src="https://codecov.io/gh/DerYeger/yeger/branch/main/graph/badge.svg?token=DjcvNlg4hd&flag=resumon">
|
|
25
16
|
</a>
|
|
26
17
|
<a href="https://opensource.org/licenses/MIT">
|
|
27
18
|
<img alt="MIT" src="https://img.shields.io/npm/l/resumon?color=%234DC71F">
|
|
@@ -45,18 +36,18 @@ $ npm install resumon
|
|
|
45
36
|
|
|
46
37
|
```bash
|
|
47
38
|
# install dependencies
|
|
48
|
-
$
|
|
39
|
+
$ pnpm install
|
|
49
40
|
|
|
50
41
|
# build for production
|
|
51
|
-
$
|
|
42
|
+
$ pnpm build
|
|
52
43
|
|
|
53
44
|
# lint project files
|
|
54
|
-
$
|
|
45
|
+
$ pnpm lint
|
|
55
46
|
|
|
56
47
|
# run tests
|
|
57
|
-
$
|
|
48
|
+
$ pnpm test
|
|
58
49
|
```
|
|
59
50
|
|
|
60
51
|
## License
|
|
61
52
|
|
|
62
|
-
[MIT](
|
|
53
|
+
[MIT](https://github.com/DerYeger/yeger/blob/main/packages/resumon/LICENSE) - Copyright © Jan Müller
|
|
File without changes
|
package/dist/resumon.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 d=Object.defineProperty;var l=(r,e,n)=>e in r?d(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var o=(r,e,n)=>(l(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.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/err.d.ts
CHANGED
package/dist/types/ok.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,83 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resumon",
|
|
3
|
+
"version": "1.1.0",
|
|
3
4
|
"description": "A tiny TypeScript result monad.",
|
|
4
|
-
"version": "1.0.74",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "github:DerYeger/resumon",
|
|
7
|
-
"homepage": "https://resumon.yeger.eu",
|
|
8
|
-
"bugs": {
|
|
9
|
-
"url": "https://github.com/DerYeger/resumon/issues"
|
|
10
|
-
},
|
|
11
5
|
"author": {
|
|
12
6
|
"name": "Jan Müller",
|
|
13
7
|
"url": "https://github.com/DerYeger"
|
|
14
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "https://github.com/DerYeger/yeger/tree/main/packages/resumon",
|
|
11
|
+
"repository": "github:DerYeger/yeger",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/DerYeger/yeger/issues"
|
|
14
|
+
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"result",
|
|
17
17
|
"monad",
|
|
18
18
|
"typescript"
|
|
19
19
|
],
|
|
20
|
-
"
|
|
21
|
-
"prepare": "husky install",
|
|
22
|
-
"prebuild": "rimraf ./dist",
|
|
23
|
-
"build": "tsc --noEmit && vite build",
|
|
24
|
-
"docs:dev": "vitepress dev docs",
|
|
25
|
-
"docs:build": "vitepress build docs",
|
|
26
|
-
"lint": "yarn lint:prettier && yarn lint:eslint",
|
|
27
|
-
"lint:commits": "yarn commitlint --from=HEAD~1",
|
|
28
|
-
"lint:eslint": "eslint \"./**/*.{js,ts,vue}\"",
|
|
29
|
-
"lint:prettier": "prettier --check \"./**/*.{js,json,html,scss,ts,vue,yml}\"",
|
|
30
|
-
"fix": "yarn pretty && yarn lint:eslint --fix ",
|
|
31
|
-
"test": "vitest --api --open",
|
|
32
|
-
"test:ci": "rimraf ./coverage && c8 --reporter=lcov --reporter=text --all --src \"src\" --include \"src/*\" vitest --run",
|
|
33
|
-
"test:run": "vitest --run",
|
|
34
|
-
"pretty": "prettier --write \"./**/*.{js,json,html,scss,ts,vue,yml}\"",
|
|
35
|
-
"prepublishOnly": "yarn build"
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist"
|
|
39
|
-
],
|
|
40
|
-
"main": "./dist/resumon.umd.js",
|
|
41
|
-
"module": "./dist/resumon.es.js",
|
|
20
|
+
"sideEffects": false,
|
|
42
21
|
"exports": {
|
|
43
22
|
".": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
23
|
+
"require": "./dist/resumon.umd.js",
|
|
24
|
+
"import": "./dist/resumon.es.mjs"
|
|
46
25
|
}
|
|
47
26
|
},
|
|
27
|
+
"main": "./dist/resumon.umd.js",
|
|
28
|
+
"module": "./dist/resumon.es.mjs",
|
|
48
29
|
"types": "dist/types/main.d.ts",
|
|
49
|
-
"
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
50
33
|
"devDependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/node": "18.11.12",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "5.43.0",
|
|
55
|
-
"@typescript-eslint/parser": "5.43.0",
|
|
56
|
-
"@vitest/ui": "0.25.6",
|
|
34
|
+
"@types/node": "18.11.13",
|
|
35
|
+
"@vitest/ui": "0.25.7",
|
|
57
36
|
"@vue/component-compiler-utils": "3.3.0",
|
|
58
37
|
"c8": "7.12.0",
|
|
59
|
-
"eslint": "8.29.0",
|
|
60
|
-
"eslint-config-prettier": "8.5.0",
|
|
61
|
-
"eslint-plugin-import": "2.26.0",
|
|
62
|
-
"eslint-plugin-prettier": "4.2.1",
|
|
63
|
-
"eslint-plugin-tsdoc": "0.2.17",
|
|
64
|
-
"eslint-plugin-unused-imports": "2.0.0",
|
|
65
|
-
"eslint-plugin-vue": "9.8.0",
|
|
66
|
-
"husky": "8.0.2",
|
|
67
|
-
"lint-staged": "13.1.0",
|
|
68
|
-
"prettier": "2.8.1",
|
|
69
|
-
"rimraf": "3.0.2",
|
|
70
38
|
"typescript": "4.9.4",
|
|
71
|
-
"vite": "
|
|
39
|
+
"vite": "4.0.0",
|
|
72
40
|
"vite-plugin-dts": "1.7.1",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
41
|
+
"vitest": "0.25.7",
|
|
42
|
+
"@yeger/tsconfig": "1.1.0"
|
|
75
43
|
},
|
|
76
44
|
"publishConfig": {
|
|
77
45
|
"access": "public"
|
|
78
46
|
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "vite build",
|
|
49
|
+
"dev": "vite build --watch",
|
|
50
|
+
"lint": "yeger-lint",
|
|
51
|
+
"test": "vitest run --coverage",
|
|
52
|
+
"typecheck": "tsc --noEmit"
|
|
82
53
|
}
|
|
83
|
-
}
|
|
54
|
+
}
|