@mkvlrn/result 1.1.2 → 1.1.4

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
@@ -2,6 +2,9 @@
2
2
  * Result type to represent the outcome of an operation.
3
3
  * It can either be a success with a value or an error with an error message.
4
4
  * This is a generic type that can be used with any type of value and error.
5
+ *
6
+ * It is also an alias object containing the success and error functions to
7
+ * make it easier to create Result objects.
5
8
  */
6
9
  export type Result<T, E = Error> = {
7
10
  readonly ok: true;
package/build/index.js CHANGED
@@ -7,9 +7,9 @@ export const Result = {
7
7
  */
8
8
  success: (value) => ({ ok: true, value: value }),
9
9
  /**
10
- * Creates a successful Result with the given value.
11
- * @param value The success value
12
- * @returns A Result object representing success
10
+ * Creates an error Result with the given error.
11
+ * @param error The error value
12
+ * @returns A Result object representing error
13
13
  */
14
14
  error: (error) => ({ ok: false, error: error }),
15
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.2",
4
+ "version": "1.1.4",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {