@praha/byethrow 0.10.0 → 0.10.1
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Result } from '../result.js';
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if a {@link Result} is a {@link Failure}.
|
|
4
4
|
*
|
|
5
5
|
* @function
|
|
6
|
-
* @typeParam
|
|
6
|
+
* @typeParam R - The type of the result to check.
|
|
7
7
|
* @param result - The {@link Result} to check.
|
|
8
8
|
* @returns `true` if the result is a {@link Failure}, otherwise `false`.
|
|
9
9
|
*
|
|
@@ -19,4 +19,6 @@ import type { Failure, Result } from '../result.js';
|
|
|
19
19
|
*
|
|
20
20
|
* @category Type Guards
|
|
21
21
|
*/
|
|
22
|
-
export declare const isFailure: <
|
|
22
|
+
export declare const isFailure: <R extends Result<unknown, unknown>>(result: R) => result is Extract<R, {
|
|
23
|
+
readonly type: "Failure";
|
|
24
|
+
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Result
|
|
1
|
+
import type { Result } from '../result.js';
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if a {@link Result} is a {@link Success}.
|
|
4
4
|
*
|
|
5
5
|
* @function
|
|
6
|
-
* @typeParam
|
|
6
|
+
* @typeParam R - The type of the result to check.
|
|
7
7
|
* @param result - The {@link Result} to check.
|
|
8
8
|
* @returns `true` if the result is a {@link Success}, otherwise `false`.
|
|
9
9
|
*
|
|
@@ -19,4 +19,6 @@ import type { Result, Success } from '../result.js';
|
|
|
19
19
|
*
|
|
20
20
|
* @category Type Guards
|
|
21
21
|
*/
|
|
22
|
-
export declare const isSuccess: <
|
|
22
|
+
export declare const isSuccess: <R extends Result<unknown, unknown>>(result: R) => result is Extract<R, {
|
|
23
|
+
readonly type: "Success";
|
|
24
|
+
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Result } from '../result.js';
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if a {@link Result} is a {@link Failure}.
|
|
4
4
|
*
|
|
5
5
|
* @function
|
|
6
|
-
* @typeParam
|
|
6
|
+
* @typeParam R - The type of the result to check.
|
|
7
7
|
* @param result - The {@link Result} to check.
|
|
8
8
|
* @returns `true` if the result is a {@link Failure}, otherwise `false`.
|
|
9
9
|
*
|
|
@@ -19,4 +19,6 @@ import type { Failure, Result } from '../result.js';
|
|
|
19
19
|
*
|
|
20
20
|
* @category Type Guards
|
|
21
21
|
*/
|
|
22
|
-
export declare const isFailure: <
|
|
22
|
+
export declare const isFailure: <R extends Result<unknown, unknown>>(result: R) => result is Extract<R, {
|
|
23
|
+
readonly type: "Failure";
|
|
24
|
+
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Result
|
|
1
|
+
import type { Result } from '../result.js';
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if a {@link Result} is a {@link Success}.
|
|
4
4
|
*
|
|
5
5
|
* @function
|
|
6
|
-
* @typeParam
|
|
6
|
+
* @typeParam R - The type of the result to check.
|
|
7
7
|
* @param result - The {@link Result} to check.
|
|
8
8
|
* @returns `true` if the result is a {@link Success}, otherwise `false`.
|
|
9
9
|
*
|
|
@@ -19,4 +19,6 @@ import type { Result, Success } from '../result.js';
|
|
|
19
19
|
*
|
|
20
20
|
* @category Type Guards
|
|
21
21
|
*/
|
|
22
|
-
export declare const isSuccess: <
|
|
22
|
+
export declare const isSuccess: <R extends Result<unknown, unknown>>(result: R) => result is Extract<R, {
|
|
23
|
+
readonly type: "Success";
|
|
24
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praha/byethrow",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "A lightweight, tree-shakable Result type package with a simple, consistent API designed",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"@standard-schema/spec": "^1.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@rslib/core": "0.
|
|
48
|
-
"eslint": "9.39.
|
|
47
|
+
"@rslib/core": "0.20.0",
|
|
48
|
+
"eslint": "9.39.4",
|
|
49
49
|
"typedoc": "0.28.17",
|
|
50
|
-
"typedoc-plugin-markdown": "4.
|
|
50
|
+
"typedoc-plugin-markdown": "4.11.0",
|
|
51
51
|
"typescript": "5.9.3",
|
|
52
|
-
"vitest": "4.0
|
|
52
|
+
"vitest": "4.1.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"typescript": ">=5.0.0"
|