wellcrafted 0.16.1 → 0.17.0

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.
@@ -18,7 +18,7 @@
18
18
  type BaseError = Readonly<{
19
19
  name: string;
20
20
  message: string;
21
- context: Record<string, unknown>;
21
+ context?: Record<string, unknown>;
22
22
  cause: unknown;
23
23
  }>;
24
24
  /**
@@ -54,6 +54,18 @@ type BaseError = Readonly<{
54
54
  * }
55
55
  * return Ok(input);
56
56
  * }
57
+ *
58
+ * // Context is optional - omit when not needed:
59
+ * function checkAuth(): Result<User, AuthError> {
60
+ * if (!isAuthenticated) {
61
+ * return Err({
62
+ * name: "AuthError",
63
+ * message: "User not authenticated",
64
+ * cause: null,
65
+ * });
66
+ * }
67
+ * return Ok(currentUser);
68
+ * }
57
69
  * ```
58
70
  */
59
71
  type TaggedError<T extends string> = BaseError & {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/error/types.ts","../../src/error/utils.ts"],"sourcesContent":[],"mappings":";;AAgBA;;;;AAAgC;AA0ChC;;;;AACiB;;;;ACxBjB;;KDnBY,SAAA,GAAY;;;WAGd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCE,gCAAgC;iBAC5B;;;;;;AA3ChB;;;;AAAgC;AA0ChC;;;;AACiB;;;;ACxBjB;;;;;;;;;;;;;;;;;;;;;iBAAgB,mBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/error/types.ts","../../src/error/utils.ts"],"sourcesContent":[],"mappings":";;AAgBA;;;;AAAgC;AAsDhC;;;;AACiB;;;;ACpCjB;;KDnBY,SAAA,GAAY;;;YAGb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmDC,gCAAgC;iBAC5B;;;;;;AAvDhB;;;;AAAgC;AAsDhC;;;;AACiB;;;;ACpCjB;;;;;;;;;;;;;;;;;;;;;iBAAgB,mBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wellcrafted",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "Delightful TypeScript patterns for elegant, type-safe applications",
5
5
  "type": "module",
6
6
  "files": [