@cobol-ts/errors 0.0.14 → 0.0.17
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 +15 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cobol-ts/errors
|
|
2
2
|
|
|
3
3
|
A lightweight TypeScript utility that provides an **ErrorsOr<T>** data type and helper functions for managing operations that can succeed with a value or fail with one or more errors.
|
|
4
4
|
|
|
@@ -13,6 +13,20 @@ Whether you’re familiar with functional “monad” patterns or new to them, t
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
## Quick orientation
|
|
17
|
+
|
|
18
|
+
**In this README:** [Installation](#installation) · [Principle Types](#principle-types) · [Working with `mapErrorsOr` & `flatMapErrorsOr`](#working-with-maperrorsor-flatmaperrorsor) · [Creating Errors](#creating-errors) · [Extracting Values & Errors](#extracting-values-errors) · [Mapping Helpers](#mapping-helpers) · [Recovery & Partitioning](#recovery-partitioning) · [Further Reading](#further-reading)
|
|
19
|
+
|
|
20
|
+
**Responsibility.** Compose computations that return either a value or accumulated human-readable error messages.
|
|
21
|
+
|
|
22
|
+
**Boundary.** `ErrorsOr` makes validation and transformation failures explicit; consuming callers decide when to throw.
|
|
23
|
+
|
|
24
|
+
**Public modules.** [error.monad.ts](./src/error.monad.ts), [error.report.ts](./src/error.report.ts).
|
|
25
|
+
|
|
26
|
+
**Tests.** [error.monad.spec.ts](src/error.monad.spec.ts)
|
|
27
|
+
|
|
28
|
+
**Related packages.** [@cobol-ts/validate](../validator/README.md) · [@cobol-ts/file-catalogue](../../config/file-catalogue/README.md).
|
|
29
|
+
|
|
16
30
|
## Installation
|
|
17
31
|
|
|
18
32
|
```bash
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobol-ts/errors",
|
|
3
3
|
"description": "How errors are represented",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.17",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"types": "dist/index",
|
|
7
7
|
"browserslist": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cobol-ts/records": "0.0.
|
|
20
|
+
"@cobol-ts/records": "0.0.17"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"typescript": "^5.2.2",
|