@mkvlrn/result 1.1.1 → 1.1.2

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/build/index.d.ts CHANGED
@@ -10,9 +10,6 @@ export type Result<T, E = Error> = {
10
10
  readonly ok: false;
11
11
  readonly error: E;
12
12
  };
13
- /**
14
- * Helper functions to create Result objects.
15
- */
16
13
  export declare const Result: {
17
14
  success<T>(value: T): Result<T, never>;
18
15
  error<E = Error>(error: E): Result<never, E>;
package/build/index.js CHANGED
@@ -1,21 +1,15 @@
1
- /**
2
- * Helper functions to create Result objects.
3
- */
1
+ // biome-ignore lint/nursery/useExplicitType: https://github.com/biomejs/biome/issues/5932
4
2
  export const Result = {
5
3
  /**
6
4
  * Creates a successful Result with the given value.
7
5
  * @param value The success value
8
6
  * @returns A Result object representing success
9
7
  */
10
- success: function (value) {
11
- return { ok: true, value: value };
12
- },
8
+ success: (value) => ({ ok: true, value: value }),
13
9
  /**
14
10
  * Creates a successful Result with the given value.
15
11
  * @param value The success value
16
12
  * @returns A Result object representing success
17
13
  */
18
- error: function (error) {
19
- return { ok: false, error: error };
20
- },
14
+ error: (error) => ({ ok: false, error: error }),
21
15
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mkvlrn/result",
3
3
  "description": "Result type for TypeScript",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {