@mkvlrn/result 4.0.17 → 4.0.19

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
@@ -5,7 +5,7 @@ Type-safe Result pattern for TypeScript representing success or error. Anything
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- yarn add @mkvlrn/result
8
+ pnpm add @mkvlrn/result
9
9
  ```
10
10
 
11
11
  ## Usage
package/build/index.d.ts CHANGED
@@ -7,9 +7,12 @@
7
7
  * make it easier to create Result objects.
8
8
  */
9
9
  export type Result<T, E extends Error> = {
10
- readonly error: undefined;
10
+ readonly isError: false;
11
+ readonly isOk: true;
11
12
  readonly value: T;
12
13
  } | {
14
+ readonly isError: true;
15
+ readonly isOk: false;
13
16
  readonly error: E;
14
17
  };
15
18
  /**
package/build/index.js CHANGED
@@ -2,6 +2,6 @@
2
2
  * Result utility functions for creating Result objects.
3
3
  */
4
4
  export const R = {
5
- ok: (value) => ({ error: undefined, value }),
6
- error: (error) => ({ error }),
5
+ ok: (value) => ({ isError: false, isOk: true, value }),
6
+ error: (error) => ({ isError: true, isOk: false, error }),
7
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mkvlrn/result",
3
3
  "description": "Simple Result type/pattern for TypeScript",
4
- "version": "4.0.17",
4
+ "version": "4.0.19",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "author": "Mike Valeriano <mkvlrn@proton.me>",
@@ -15,7 +15,7 @@
15
15
  "result"
16
16
  ],
17
17
  "engines": {
18
- "node": "24.x"
18
+ "node": "22.x"
19
19
  },
20
20
  "files": [
21
21
  "build"
@@ -24,25 +24,19 @@
24
24
  "types": "./build/index.d.ts",
25
25
  "default": "./build/index.js"
26
26
  },
27
- "scripts": {
28
- "build": "rimraf build && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json -f",
29
- "test": "vitest",
30
- "biome-check": "biome check --no-errors-on-unmatched",
31
- "biome-fix": "yarn biome-check --write",
32
- "typecheck": "tsc --noEmit",
33
- "lint-staged": "lint-staged",
34
- "prepare": "husky"
35
- },
36
27
  "devDependencies": {
37
- "@types/node": "^24.3.3",
38
- "@vitest/coverage-v8": "^3.2.4",
39
- "lint-staged": "^16.1.6",
28
+ "@types/node": "^24.7.2",
29
+ "lint-staged": "^16.2.4",
40
30
  "rimraf": "^6.0.1",
41
- "tsc-alias": "^1.8.16",
42
31
  "tsc-files": "^1.1.4",
43
- "tsx": "^4.20.5",
44
- "typescript": "^5.9.2",
45
- "vite-tsconfig-paths": "^5.1.4",
32
+ "tsx": "^4.20.6",
33
+ "typescript": "^5.9.3"
34
+ },
35
+ "dependencies": {
46
36
  "vitest": "^3.2.4"
37
+ },
38
+ "scripts": {
39
+ "build": "rimraf build && tsc -p tsconfig.build.json",
40
+ "typecheck": "tsc"
47
41
  }
48
- }
42
+ }