@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 { Failure, Result } from '../result.js';
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 E - The type of the error value.
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: <E>(result: Result<unknown, E>) => result is Failure<E>;
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, Success } from '../result.js';
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 T - The type of the success value.
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: <T>(result: Result<T, unknown>) => result is Success<T>;
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 { Failure, Result } from '../result.js';
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 E - The type of the error value.
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: <E>(result: Result<unknown, E>) => result is Failure<E>;
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, Success } from '../result.js';
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 T - The type of the success value.
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: <T>(result: Result<T, unknown>) => result is Success<T>;
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.0",
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.19.5",
48
- "eslint": "9.39.2",
47
+ "@rslib/core": "0.20.0",
48
+ "eslint": "9.39.4",
49
49
  "typedoc": "0.28.17",
50
- "typedoc-plugin-markdown": "4.10.0",
50
+ "typedoc-plugin-markdown": "4.11.0",
51
51
  "typescript": "5.9.3",
52
- "vitest": "4.0.18"
52
+ "vitest": "4.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "typescript": ">=5.0.0"