okay-error
Advanced tools
+1
-1
| { | ||
| "name": "okay-error", | ||
| "version": "0.1.2", | ||
| "version": "0.1.3", | ||
| "author": "Henry Mao", | ||
@@ -5,0 +5,0 @@ "private": false, |
+7
-7
@@ -1,2 +0,2 @@ | ||
| # `ok-err` | ||
| # `okay-error` | ||
@@ -7,3 +7,3 @@ > **Typed, chain‑friendly, JSON‑safe Results for TypeScript** | ||
| ## Why *ok-err*? | ||
| ## Why *okay-error*? | ||
@@ -21,3 +21,3 @@ * **Plain object compatibility** - an `Ok` is `{ ok: true, value }`, an `Err` is `{ ok: false, error }`. Log it, persist it, send it over the wire. | ||
| ```bash | ||
| npm i ok-err | ||
| npm i okay-error | ||
| ``` | ||
@@ -31,3 +31,3 @@ | ||
| Here's how `ok-err` changes error handling from exceptions to data: | ||
| Here's how `okay-error` changes error handling from exceptions to data: | ||
@@ -46,3 +46,3 @@ ```ts | ||
| // Alternative approach with Result | ||
| import { ok, err, result } from 'ok-err'; | ||
| import { ok, err, result } from 'okay-error'; | ||
@@ -125,6 +125,6 @@ // Define functions that return Result types | ||
| `ok-err` can be used with async code to handle errors as data: | ||
| `okay-error` can be used with async code to handle errors as data: | ||
| ```ts | ||
| import { result } from 'ok-err'; | ||
| import { result } from 'okay-error'; | ||
@@ -131,0 +131,0 @@ // Wrap fetch with Result to handle both network and parsing errors |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
36076
0.08%