smart-result 0.0.3 → 0.0.5
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 +4 -4
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This type library is a very smart result type available in TypeScript 4.6 or later.
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
import type {
|
|
6
|
+
import type { Result } from "smart-result";
|
|
7
7
|
|
|
8
8
|
async function loadData(): Promise<Result<Data, Error>> {
|
|
9
9
|
try {
|
|
@@ -53,7 +53,7 @@ yarn add -D `smart-result`
|
|
|
53
53
|
### Void Pattern
|
|
54
54
|
|
|
55
55
|
```
|
|
56
|
-
import type {
|
|
56
|
+
import type { Result } from "smart-result";
|
|
57
57
|
|
|
58
58
|
async function start(): Promise<Result<true, Error>> {
|
|
59
59
|
try {
|
|
@@ -81,7 +81,7 @@ async function example() {
|
|
|
81
81
|
### Return Data Pattern
|
|
82
82
|
|
|
83
83
|
```
|
|
84
|
-
import type {
|
|
84
|
+
import type { Result } from "smart-result";
|
|
85
85
|
|
|
86
86
|
async function loadData(): Promise<Result<Data, Error>> {
|
|
87
87
|
try {
|
|
@@ -109,7 +109,7 @@ async function example() {
|
|
|
109
109
|
### Return Value Pattern
|
|
110
110
|
|
|
111
111
|
```
|
|
112
|
-
import type {
|
|
112
|
+
import type { Result } from "smart-result";
|
|
113
113
|
|
|
114
114
|
async function loadValue(): Promise<Result<{ value: number }, Error>> {
|
|
115
115
|
try {
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smart-result",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn clean && tsc -p ./tsconfig.json",
|
|
7
|
-
"clean": "del-cli dist module"
|
|
8
|
-
"versionup:major": "changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major",
|
|
9
|
-
"versionup:minor": "changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor",
|
|
10
|
-
"versionup:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch"
|
|
7
|
+
"clean": "del-cli dist module"
|
|
11
8
|
},
|
|
12
9
|
"repository": {
|
|
13
10
|
"type": "git",
|
|
@@ -26,11 +23,12 @@
|
|
|
26
23
|
"!**/__tests__"
|
|
27
24
|
],
|
|
28
25
|
"devDependencies": {
|
|
29
|
-
"generate-changelog": "^1.8.0",
|
|
30
26
|
"del-cli": "^4.0.1",
|
|
27
|
+
"generate-changelog": "^1.8.0",
|
|
31
28
|
"typescript": "^5.4.3"
|
|
32
29
|
},
|
|
33
30
|
"peerDependencies": {
|
|
34
31
|
"typescript": ">=4.6.0"
|
|
35
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"packageManager": "yarn@4.9.2"
|
|
36
34
|
}
|