@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 +2 -0
- package/dist/index.cjs +240 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +160 -114
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +160 -114
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +225 -143
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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:
|