@shirudo/result 0.0.3 → 0.0.5

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/README.md CHANGED
@@ -263,6 +263,8 @@ const result = await matchAsync({
263
263
  - `.serialize()`: Convert to `{ isSuccess, data?, error? }`.
264
264
  - `.toUserFriendly()`: User-friendly serialization with error messages.
265
265
 
266
+ **Error types:** Methods that throw (e.g., `.unwrap()`, `.unwrapErr()`, `.expect()`, `.expectErr()`, and invalid-state checks) now use custom error classes with stable `code` values like `ERR_UNWRAP_ON_ERR` and `ERR_INVALID_STATE`. These classes and constants are exported from the package for programmatic handling.
267
+
266
268
  ### Utilities
267
269
 
268
270
  Type guards and helper functions: