resultfier 0.4.0 → 3.0.0

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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/dist/action/index.d.mts +6 -0
  4. package/dist/action/index.mjs +1 -0
  5. package/dist/core/index.mjs +2 -0
  6. package/dist/core-BdRFoSfb.mjs +101 -0
  7. package/dist/index.d.mts +6 -0
  8. package/dist/index.mjs +2 -0
  9. package/dist/result-DIdNM9rp.d.mts +147 -0
  10. package/package.json +42 -53
  11. package/.changeset/config.json +0 -11
  12. package/CHANGELOG.md +0 -31
  13. package/dist/action/action.d.ts +0 -5
  14. package/dist/action/action.js +0 -3
  15. package/dist/action/action.js.map +0 -1
  16. package/dist/action/index.d.ts +0 -2
  17. package/dist/action/index.js +0 -3
  18. package/dist/action/index.js.map +0 -1
  19. package/dist/chunk-7CTLLC5F.js +0 -3
  20. package/dist/chunk-7CTLLC5F.js.map +0 -1
  21. package/dist/chunk-D2DM2EYA.js +0 -7
  22. package/dist/chunk-D2DM2EYA.js.map +0 -1
  23. package/dist/chunk-GGEJTXXS.js +0 -74
  24. package/dist/chunk-GGEJTXXS.js.map +0 -1
  25. package/dist/chunk-GLSQCN75.js +0 -75
  26. package/dist/chunk-GLSQCN75.js.map +0 -1
  27. package/dist/chunk-ITR7ZRJM.js +0 -17
  28. package/dist/chunk-ITR7ZRJM.js.map +0 -1
  29. package/dist/chunk-SQ4P2HRX.js +0 -3
  30. package/dist/chunk-SQ4P2HRX.js.map +0 -1
  31. package/dist/core/err.d.ts +0 -1
  32. package/dist/core/err.js +0 -4
  33. package/dist/core/err.js.map +0 -1
  34. package/dist/core/index.d.ts +0 -169
  35. package/dist/core/index.js +0 -6
  36. package/dist/core/index.js.map +0 -1
  37. package/dist/core/ok.d.ts +0 -1
  38. package/dist/core/ok.js +0 -4
  39. package/dist/core/ok.js.map +0 -1
  40. package/dist/core/result.d.ts +0 -1
  41. package/dist/core/result.js +0 -3
  42. package/dist/core/result.js.map +0 -1
  43. package/dist/zod-wrapper/index.d.ts +0 -3
  44. package/dist/zod-wrapper/index.js +0 -7
  45. package/dist/zod-wrapper/index.js.map +0 -1
  46. package/dist/zod-wrapper/zod.d.ts +0 -6
  47. package/dist/zod-wrapper/zod.js +0 -7
  48. package/dist/zod-wrapper/zod.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Vitor Koch
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1 +1,48 @@
1
1
  # resultfier
2
+
3
+ A TypeScript/JavaScript library that brings Rust's `Result<T, E>` type to your projects. Provides robust error handling with type safety and functional programming patterns.
4
+
5
+ ## Features
6
+
7
+ - 🦀 Rust-inspired `Result<T, E>` type
8
+ - 🛡️ Type-safe error handling
9
+ - ⚡ Zero dependencies
10
+ - 🔄 Functional programming methods (map, andThen, etc.)
11
+ - 📦 TypeScript-first with full type support
12
+ - 🎯 Simple and intuitive API
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @vikoch/resultfier
18
+ # or
19
+ yarn add @vikoch/resultfier
20
+ # or
21
+ bun add @vikoch/resultfier
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```typescript
27
+ import type { Result } from '@vikoch/resultfier'
28
+ import { err, ok } from '@vikoch/resultfier'
29
+
30
+ function divide(a: number, b: number): Result<number, string> {
31
+ if (b === 0) {
32
+ return err('Cannot divide by zero')
33
+ }
34
+ return ok(a / b)
35
+ }
36
+
37
+ const result = divide(10, 2)
38
+
39
+ // Type Narrowing
40
+ if (result.isOk) {
41
+ console.log('Result:', result.value) // 5
42
+ // ^? Ok<number>
43
+ }
44
+ else {
45
+ console.log('Error:', result.error) // Cannot divide by zero
46
+ // ^? Err<string>
47
+ }
48
+ ```
@@ -0,0 +1,6 @@
1
+ import { t as AsyncResult } from "../result-DIdNM9rp.mjs";
2
+
3
+ //#region src/action/action.d.ts
4
+ type AsyncAction<TData, TError, TParams = null> = (params: TParams extends null ? void : TParams) => AsyncResult<TData, TError>;
5
+ //#endregion
6
+ export { type AsyncAction };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { a as err, i as Err, n as Ok, r as ok, t as toAsyncResult } from "../core-BdRFoSfb.mjs";
2
+ export { Err, Ok, err, ok, toAsyncResult };
@@ -0,0 +1,101 @@
1
+ var ResultBase = class {};
2
+ function _typeof(o) {
3
+ "@babel/helpers - typeof";
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
5
+ return typeof o$1;
6
+ } : function(o$1) {
7
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
8
+ }, _typeof(o);
9
+ }
10
+ function toPrimitive(t, r) {
11
+ if ("object" != _typeof(t) || !t) return t;
12
+ var e = t[Symbol.toPrimitive];
13
+ if (void 0 !== e) {
14
+ var i = e.call(t, r || "default");
15
+ if ("object" != _typeof(i)) return i;
16
+ throw new TypeError("@@toPrimitive must return a primitive value.");
17
+ }
18
+ return ("string" === r ? String : Number)(t);
19
+ }
20
+ function toPropertyKey(t) {
21
+ var i = toPrimitive(t, "string");
22
+ return "symbol" == _typeof(i) ? i : i + "";
23
+ }
24
+ function _defineProperty(e, r, t) {
25
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
26
+ value: t,
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0
30
+ }) : e[r] = t, e;
31
+ }
32
+ var Err = class Err extends ResultBase {
33
+ constructor(error) {
34
+ super();
35
+ this.error = error;
36
+ _defineProperty(this, "_tag", "err");
37
+ _defineProperty(this, "isOk", false);
38
+ _defineProperty(this, "isErr", true);
39
+ }
40
+ map(_fn) {
41
+ return this;
42
+ }
43
+ mapErr(fn) {
44
+ return new Err(fn(this.error));
45
+ }
46
+ valueOr(defaultValue) {
47
+ return defaultValue;
48
+ }
49
+ valueOrElse(fn) {
50
+ return fn(this.error);
51
+ }
52
+ andThen(_fn) {
53
+ return this;
54
+ }
55
+ contains(_value) {
56
+ return false;
57
+ }
58
+ containsErr(error) {
59
+ return this.error === error;
60
+ }
61
+ };
62
+ function err(error) {
63
+ return new Err(error);
64
+ }
65
+ var Ok = class Ok extends ResultBase {
66
+ constructor(value) {
67
+ super();
68
+ this.value = value;
69
+ _defineProperty(this, "_tag", "ok");
70
+ _defineProperty(this, "isOk", true);
71
+ _defineProperty(this, "isErr", false);
72
+ }
73
+ map(fn) {
74
+ return new Ok(fn(this.value));
75
+ }
76
+ mapErr(_fn) {
77
+ return this;
78
+ }
79
+ valueOr(_defaultValue) {
80
+ return this.value;
81
+ }
82
+ valueOrElse(_fn) {
83
+ return this.value;
84
+ }
85
+ andThen(fn) {
86
+ return fn(this.value);
87
+ }
88
+ contains(value) {
89
+ return this.value === value;
90
+ }
91
+ containsErr(_error) {
92
+ return false;
93
+ }
94
+ };
95
+ function ok(value) {
96
+ return new Ok(value);
97
+ }
98
+ async function toAsyncResult(callback) {
99
+ return Promise.resolve(callback()).then((value) => ok(value)).catch((error) => err(error));
100
+ }
101
+ export { err as a, Err as i, Ok as n, ok as r, toAsyncResult as t };
@@ -0,0 +1,6 @@
1
+ import { a as ok, i as Ok, n as Result, o as Err, r as ResultBase, s as err, t as AsyncResult } from "./result-DIdNM9rp.mjs";
2
+
3
+ //#region src/core/utils.d.ts
4
+ declare function toAsyncResult<T, E>(callback: () => Promise<T> | T): AsyncResult<T, E>;
5
+ //#endregion
6
+ export { AsyncResult, Err, Ok, Result, ResultBase, err, ok, toAsyncResult };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { a as err, i as Err, n as Ok, r as ok, t as toAsyncResult } from "./core-BdRFoSfb.mjs";
2
+ export { Err, Ok, err, ok, toAsyncResult };
@@ -0,0 +1,147 @@
1
+ //#region src/core/err.d.ts
2
+
3
+ /**
4
+ * Represents an error result containing an error value.
5
+ */
6
+ declare class Err<E> extends ResultBase<never, E> {
7
+ readonly error: E;
8
+ readonly _tag: "err";
9
+ readonly isOk = false;
10
+ readonly isErr = true;
11
+ constructor(error: E);
12
+ /**
13
+ * Maps the value type, but since this is `Err`, it's a no-op.
14
+ */
15
+ map<U>(_fn: (value: never) => U): Err<E>;
16
+ /**
17
+ * Maps the contained error using the provided function.
18
+ * Since this is `Err`, the function is always applied.
19
+ */
20
+ mapErr<F>(fn: (error: E) => F): Err<F>;
21
+ /**
22
+ * Returns the provided default value since this is `Err`.
23
+ */
24
+ valueOr<T>(defaultValue: T): T;
25
+ /**
26
+ * Computes and returns the fallback value using the provided function.
27
+ */
28
+ valueOrElse<T>(fn: (error: E) => T): T;
29
+ /**
30
+ * Returns this `Err` unchanged since there's no value to chain.
31
+ */
32
+ andThen<U>(_fn: (value: never) => Result<U, E>): Err<E>;
33
+ /**
34
+ * Always returns false since this is `Err`, not `Ok`.
35
+ */
36
+ contains(_value: never): boolean;
37
+ /**
38
+ * Checks if the contained error matches the provided error.
39
+ */
40
+ containsErr(error: E): boolean;
41
+ }
42
+ /**
43
+ * Creates a new `Err` result with the given error.
44
+ */
45
+ declare function err<E>(error: E): Err<E>;
46
+ //#endregion
47
+ //#region src/core/ok.d.ts
48
+ /**
49
+ * Represents a successful result containing a value.
50
+ */
51
+ declare class Ok<T> extends ResultBase<T, never> {
52
+ readonly value: T;
53
+ readonly _tag: "ok";
54
+ readonly isOk = true;
55
+ readonly isErr = false;
56
+ constructor(value: T);
57
+ /**
58
+ * Maps the contained value using the provided function.
59
+ * Since this is `Ok`, the function is always applied.
60
+ */
61
+ map<U>(fn: (value: T) => U): Ok<U>;
62
+ /**
63
+ * Maps the error type, but since this is `Ok`, it's a no-op.
64
+ */
65
+ mapErr<F>(_fn: (error: never) => F): Ok<T>;
66
+ /**
67
+ * Returns the contained value, ignoring the default.
68
+ */
69
+ valueOr(_defaultValue: T): T;
70
+ /**
71
+ * Returns the contained value, ignoring the fallback function.
72
+ */
73
+ valueOrElse(_fn: (error: never) => T): T;
74
+ /**
75
+ * Applies the function to the contained value and returns the result.
76
+ */
77
+ andThen<U>(fn: (value: T) => Result<U, never>): Result<U, never>;
78
+ /**
79
+ * Checks if the contained value matches the provided value.
80
+ */
81
+ contains(value: T): boolean;
82
+ /**
83
+ * Always returns false since this is `Ok`, not `Err`.
84
+ */
85
+ containsErr(_error: never): false;
86
+ }
87
+ /**
88
+ * Creates a new `Ok` result with the given value.
89
+ */
90
+ declare function ok<T>(value: T): Ok<T>;
91
+ //#endregion
92
+ //#region src/core/result.d.ts
93
+ /**
94
+ * Represents a Result type that can either be a success (`Ok`) or an error (`Err`).
95
+ * This is an abstract base class that provides common functionality for both variants.
96
+ */
97
+ declare abstract class ResultBase<T, E> {
98
+ /**
99
+ * Type guard to check if the result is an `Ok` variant.
100
+ */
101
+ abstract readonly isOk: boolean;
102
+ /**
103
+ * Type guard to check if the result is an `Err` variant.
104
+ */
105
+ abstract readonly isErr: boolean;
106
+ /**
107
+ * Maps a `Result<T, E>` to `Result<U, E>` by applying a function to a contained `Ok` value,
108
+ * leaving an `Err` value untouched.
109
+ */
110
+ abstract map<U>(fn: (value: T) => U): Result<U, E>;
111
+ /**
112
+ * Maps a `Result<T, E>` to `Result<T, F>` by applying a function to a contained `Err` value,
113
+ * leaving an `Ok` value untouched.
114
+ */
115
+ abstract mapErr<F>(fn: (error: E) => F): Result<T, F>;
116
+ /**
117
+ * Returns the contained `Ok` value or a provided default.
118
+ */
119
+ abstract valueOr(defaultValue: T): T;
120
+ /**
121
+ * Returns the contained `Ok` value or computes it from a closure.
122
+ */
123
+ abstract valueOrElse(fn: (error: E) => T): T;
124
+ /**
125
+ * Calls the provided function with the contained value and returns the result.
126
+ * If the result is `Err`, the function is not called and the `Err` is returned.
127
+ */
128
+ abstract andThen<U>(fn: (value: T) => Result<U, E>): Result<U, E>;
129
+ /**
130
+ * Returns true if the result is `Ok` and the value inside of it matches a predicate.
131
+ */
132
+ abstract contains(value: T): boolean;
133
+ /**
134
+ * Returns true if the result is `Err` and the error inside of it matches a predicate.
135
+ */
136
+ abstract containsErr(error: E): boolean;
137
+ }
138
+ /**
139
+ * Type alias for a `Result` that can be either `Ok<T>` or `Err<E>`.
140
+ */
141
+ type Result<T, E> = Ok<T> | Err<E>;
142
+ /**
143
+ * Type alias for an async `Result` (Promise-wrapped `Result`).
144
+ */
145
+ type AsyncResult<T, E> = Promise<Result<T, E>>;
146
+ //#endregion
147
+ export { ok as a, Ok as i, Result as n, Err as o, ResultBase as r, err as s, AsyncResult as t };
package/package.json CHANGED
@@ -1,54 +1,43 @@
1
1
  {
2
- "name": "resultfier",
3
- "type": "module",
4
- "version": "0.4.0",
5
- "description": "A TypeScript implementation of Rust-like Result type for better error handling",
6
- "author": "Vitor Koch <vitorgabrielkoch@gmail.com>",
7
- "license": "MIT",
8
- "homepage": "https://github.com/vitorkoch/resultfier#readme",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/vitorkoch/resultfier.git"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/vitorkoch/resultfier/issues"
15
- },
16
- "exports": {
17
- ".": {
18
- "types": "./dist/core/index.d.ts",
19
- "import": "./dist/core/index.js"
20
- },
21
- "./action": {
22
- "types": "./dist/action/index.d.ts",
23
- "import": "./dist/action/index.js"
24
- },
25
- "./zod": {
26
- "types": "./dist/zod-wrapper/zod.d.ts",
27
- "import": "./dist/zod-wrapper/zod.js"
28
- }
29
- },
30
- "main": "./dist/core/index.js",
31
- "module": "./dist/core/index.js",
32
- "types": "./dist/core/index.d.ts",
33
- "peerDependencies": {
34
- "zod": "^4.0.0"
35
- },
36
- "peerDependenciesMeta": {
37
- "zod": {
38
- "optional": true
39
- }
40
- },
41
- "devDependencies": {
42
- "@antfu/eslint-config": "^5.4.1",
43
- "@changesets/cli": "^2.29.7",
44
- "@types/bun": "latest",
45
- "eslint": "^9.36.0",
46
- "tsup": "^8.5.0",
47
- "typescript": "^5.9.2"
48
- },
49
- "scripts": {
50
- "build": "tsup",
51
- "lint": "eslint",
52
- "lint:fix": "eslint --fix"
53
- }
54
- }
2
+ "name": "resultfier",
3
+ "type": "module",
4
+ "version": "3.0.0",
5
+ "private": "false",
6
+ "packageManager": "bun@1.3.5",
7
+ "description": "A TypeScript/JavaScript library that brings Rust's Result<T, E> type for robust error handling",
8
+ "author": "Vitor Koch",
9
+ "license": "MIT",
10
+ "keywords": ["rust", "error handling", "result", "typescript"],
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.mts",
14
+ "import": "./dist/index.mjs"
15
+ },
16
+ "./core": {
17
+ "types": "./dist/core/index.d.mts",
18
+ "import": "./dist/core/index.mjs"
19
+ },
20
+ "./action": {
21
+ "types": "./dist/action/index.d.mts",
22
+ "import": "./dist/action/index.mjs"
23
+ }
24
+ },
25
+ "main": "./dist/index.mjs",
26
+ "module": "./dist/index.mjs",
27
+ "types": "./dist/index.d.mts",
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "scripts": {
32
+ "lint": "eslint",
33
+ "lint:fix": "eslint --fix",
34
+ "build": "tsdown",
35
+ "prepublishOnly": "npm run build"
36
+ },
37
+ "devDependencies": {
38
+ "@antfu/eslint-config": "^6.7.3",
39
+ "eslint": "^9.39.2",
40
+ "eslint-plugin-format": "^1.1.0",
41
+ "tsdown": "^0.18.2"
42
+ }
43
+ }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": true,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "public",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
package/CHANGELOG.md DELETED
@@ -1,31 +0,0 @@
1
- # resultfier
2
-
3
- ## 0.4.0
4
-
5
- ### Minor Changes
6
-
7
- - 2f11d84: add zod integration and reorganize the project
8
-
9
- ## 0.3.0
10
-
11
- ### Minor Changes
12
-
13
- - 7d5a07f: remove deprecated 'isOk' and 'isError' and add new module 'extra' with Action type
14
-
15
- ## 0.2.0
16
-
17
- ### Minor Changes
18
-
19
- - 1575817: fix exports
20
-
21
- ## 0.1.1
22
-
23
- ### Patch Changes
24
-
25
- - fix resolution bug
26
-
27
- ## 0.1.0
28
-
29
- ### Minor Changes
30
-
31
- - first release
@@ -1,5 +0,0 @@
1
- import { AsyncResult } from '../core/index.js';
2
-
3
- type Action<TParams, TData, TError> = (params: TParams) => AsyncResult<TData, TError>;
4
-
5
- export type { Action };
@@ -1,3 +0,0 @@
1
- import '../chunk-7CTLLC5F.js';
2
- //# sourceMappingURL=action.js.map
3
- //# sourceMappingURL=action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"action.js"}
@@ -1,2 +0,0 @@
1
- export { Action } from './action.js';
2
- import '../core/index.js';
@@ -1,3 +0,0 @@
1
- import '../chunk-7CTLLC5F.js';
2
- //# sourceMappingURL=index.js.map
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=chunk-7CTLLC5F.js.map
3
- //# sourceMappingURL=chunk-7CTLLC5F.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-7CTLLC5F.js"}
@@ -1,7 +0,0 @@
1
- // src/core/result.ts
2
- var ResultBase = class {
3
- };
4
-
5
- export { ResultBase };
6
- //# sourceMappingURL=chunk-D2DM2EYA.js.map
7
- //# sourceMappingURL=chunk-D2DM2EYA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/result.ts"],"names":[],"mappings":";AAOO,IAAe,aAAf,MAAgC;AA4DvC","file":"chunk-D2DM2EYA.js","sourcesContent":["import type { Err } from '@/core/err';\nimport type { Ok } from '@/core/ok';\n\n/**\n * Represents a Result type that can either be a success (`Ok`) or an error (`Err`).\n * This is an abstract base class that provides common functionality for both variants.\n */\nexport abstract class ResultBase<T, E> {\n /**\n * Type guard to check if the result is an `Ok` variant.\n */\n abstract readonly isOk: boolean;\n\n /**\n * Type guard to check if the result is an `Err` variant.\n */\n abstract readonly isErr: boolean;\n\n /**\n * Maps a `Result<T, E>` to `Result<U, E>` by applying a function to a contained `Ok` value,\n * leaving an `Err` value untouched.\n */\n abstract map<U>(fn: (value: T) => U): Result<U, E>;\n\n /**\n * Maps a `Result<T, E>` to `Result<T, F>` by applying a function to a contained `Err` value,\n * leaving an `Ok` value untouched.\n */\n abstract mapErr<F>(fn: (error: E) => F): Result<T, F>;\n\n /**\n * Returns the contained `Ok` value, consuming the self value.\n * Throws an error if the result is `Err`.\n */\n abstract unwrap(): T;\n\n /**\n * Returns the contained `Err` value, consuming the self value.\n * Throws an error if the result is Ok.\n */\n abstract unwrapErr(): E;\n\n /**\n * Returns the contained `Ok` value or a provided default.\n */\n abstract unwrapOr(defaultValue: T): T;\n\n /**\n * Returns the contained `Ok` value or computes it from a closure.\n */\n abstract unwrapOrElse(fn: (error: E) => T): T;\n\n /**\n * Calls the provided function with the contained value and returns the result.\n * If the result is `Err`, the function is not called and the `Err` is returned.\n */\n abstract andThen<U>(fn: (value: T) => Result<U, E>): Result<U, E>;\n\n /**\n * Returns true if the result is `Ok` and the value inside of it matches a predicate.\n */\n abstract contains(value: T): boolean;\n\n /**\n * Returns true if the result is `Err` and the error inside of it matches a predicate.\n */\n abstract containsErr(error: E): boolean;\n}\n\n/**\n * Type alias for a `Result` that can be either `Ok<T>` or `Err<E>`.\n */\nexport type Result<T, E> = Ok<T> | Err<E>;\n\n/**\n * Type alias for an async `Result` (Promise-wrapped `Result`).\n */\nexport type AsyncResult<T, E> = Promise<Result<T, E>>;\n"]}
@@ -1,74 +0,0 @@
1
- import { ResultBase } from './chunk-D2DM2EYA.js';
2
-
3
- // src/core/ok.ts
4
- var Ok = class _Ok extends ResultBase {
5
- constructor(value) {
6
- super();
7
- this.value = value;
8
- }
9
- _tag = "ok";
10
- isOk = true;
11
- isErr = false;
12
- /**
13
- * Maps the contained value using the provided function.
14
- * Since this is `Ok`, the function is always applied.
15
- */
16
- map(fn) {
17
- return new _Ok(fn(this.value));
18
- }
19
- /**
20
- * Maps the error type, but since this is `Ok`, it's a no-op.
21
- */
22
- mapErr(_fn) {
23
- return this;
24
- }
25
- /**
26
- * Returns the contained value.
27
- */
28
- unwrap() {
29
- return this.value;
30
- }
31
- /**
32
- * Throws an error since this is Ok, not Err.
33
- */
34
- unwrapErr() {
35
- throw new Error(`Called unwrapErr() on an Ok value: ${this.value}`);
36
- }
37
- /**
38
- * Returns the contained value, ignoring the default.
39
- */
40
- unwrapOr(_defaultValue) {
41
- return this.value;
42
- }
43
- /**
44
- * Returns the contained value, ignoring the fallback function.
45
- */
46
- unwrapOrElse(_fn) {
47
- return this.value;
48
- }
49
- /**
50
- * Applies the function to the contained value and returns the result.
51
- */
52
- andThen(fn) {
53
- return fn(this.value);
54
- }
55
- /**
56
- * Checks if the contained value matches the provided value.
57
- */
58
- contains(value) {
59
- return this.value === value;
60
- }
61
- /**
62
- * Always returns false since this is `Ok`, not `Err`.
63
- */
64
- containsErr(_error) {
65
- return false;
66
- }
67
- };
68
- function ok(value) {
69
- return new Ok(value);
70
- }
71
-
72
- export { Ok, ok };
73
- //# sourceMappingURL=chunk-GGEJTXXS.js.map
74
- //# sourceMappingURL=chunk-GGEJTXXS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/ok.ts"],"names":[],"mappings":";;;AAMO,IAAM,EAAA,GAAN,MAAM,GAAA,SAAc,UAAA,CAAqB;AAAA,EAK5C,YAAqB,KAAA,EAAU;AAC3B,IAAA,KAAA,EAAM;AADW,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA,EAErB;AAAA,EANS,IAAA,GAAO,IAAA;AAAA,EACP,IAAA,GAAO,IAAA;AAAA,EACP,KAAA,GAAQ,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUjB,IAAO,EAAA,EAA4B;AAC/B,IAAA,OAAO,IAAI,GAAA,CAAG,EAAA,CAAG,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA,EAKA,OAAU,GAAA,EAAiC;AACvC,IAAA,OAAO,IAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,MAAA,GAAY;AACR,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA,GAAmB;AACf,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,mCAAA,EAAsC,IAAA,CAAK,KAAK,CAAA,CAAE,CAAA;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,aAAA,EAAqB;AAC1B,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,GAAA,EAA6B;AACtC,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,QAAW,EAAA,EAAsD;AAC7D,IAAA,OAAO,EAAA,CAAG,KAAK,KAAK,CAAA;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,KAAA,EAAmB;AACxB,IAAA,OAAO,KAAK,KAAA,KAAU,KAAA;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKS,YAAY,MAAA,EAAsB;AACvC,IAAA,OAAO,KAAA;AAAA,EACX;AACJ;AAKO,SAAS,GAAM,KAAA,EAAiB;AACnC,EAAA,OAAO,IAAI,GAAG,KAAK,CAAA;AACvB","file":"chunk-GGEJTXXS.js","sourcesContent":["import type { Result } from '@/core/result';\nimport { ResultBase } from '@/core/result';\n\n/**\n * Represents a successful result containing a value.\n */\nexport class Ok<T> extends ResultBase<T, never> {\n readonly _tag = 'ok' as const;\n readonly isOk = true;\n readonly isErr = false;\n\n constructor(readonly value: T) {\n super();\n }\n\n /**\n * Maps the contained value using the provided function.\n * Since this is `Ok`, the function is always applied.\n */\n map<U>(fn: (value: T) => U): Ok<U> {\n return new Ok(fn(this.value));\n }\n\n /**\n * Maps the error type, but since this is `Ok`, it's a no-op.\n */\n mapErr<F>(_fn: (error: never) => F): Ok<T> {\n return this;\n }\n\n /**\n * Returns the contained value.\n */\n unwrap(): T {\n return this.value;\n }\n\n /**\n * Throws an error since this is Ok, not Err.\n */\n unwrapErr(): never {\n throw new Error(`Called unwrapErr() on an Ok value: ${this.value}`);\n }\n\n /**\n * Returns the contained value, ignoring the default.\n */\n unwrapOr(_defaultValue: T): T {\n return this.value;\n }\n\n /**\n * Returns the contained value, ignoring the fallback function.\n */\n unwrapOrElse(_fn: (error: never) => T): T {\n return this.value;\n }\n\n /**\n * Applies the function to the contained value and returns the result.\n */\n andThen<U>(fn: (value: T) => Result<U, never>): Result<U, never> {\n return fn(this.value);\n }\n\n /**\n * Checks if the contained value matches the provided value.\n */\n contains(value: T): boolean {\n return this.value === value;\n }\n\n /**\n * Always returns false since this is `Ok`, not `Err`.\n */\n override containsErr(_error: never): false {\n return false;\n }\n}\n\n/**\n * Creates a new `Ok` result with the given value.\n */\nexport function ok<T>(value: T): Ok<T> {\n return new Ok(value);\n}\n"]}
@@ -1,75 +0,0 @@
1
- import { ResultBase } from './chunk-D2DM2EYA.js';
2
-
3
- // src/core/err.ts
4
- var Err = class _Err extends ResultBase {
5
- // eslint-disable-next-line node/handle-callback-err
6
- constructor(error) {
7
- super();
8
- this.error = error;
9
- }
10
- _tag = "err";
11
- isOk = false;
12
- isErr = true;
13
- /**
14
- * Maps the value type, but since this is `Err`, it's a no-op.
15
- */
16
- map(_fn) {
17
- return this;
18
- }
19
- /**
20
- * Maps the contained error using the provided function.
21
- * Since this is `Err`, the function is always applied.
22
- */
23
- mapErr(fn) {
24
- return new _Err(fn(this.error));
25
- }
26
- /**
27
- * Throws an error since this is `Err`, not `Ok`.
28
- */
29
- unwrap() {
30
- throw new Error(`Called unwrap() on an Err value: ${this.error}`);
31
- }
32
- /**
33
- * Returns the contained error.
34
- */
35
- unwrapErr() {
36
- return this.error;
37
- }
38
- /**
39
- * Returns the provided default value since this is `Err`.
40
- */
41
- unwrapOr(defaultValue) {
42
- return defaultValue;
43
- }
44
- /**
45
- * Computes and returns the fallback value using the provided function.
46
- */
47
- unwrapOrElse(fn) {
48
- return fn(this.error);
49
- }
50
- /**
51
- * Returns this `Err` unchanged since there's no value to chain.
52
- */
53
- andThen(_fn) {
54
- return this;
55
- }
56
- /**
57
- * Always returns false since this is `Err`, not `Ok`.
58
- */
59
- contains(_value) {
60
- return false;
61
- }
62
- /**
63
- * Checks if the contained error matches the provided error.
64
- */
65
- containsErr(error) {
66
- return this.error === error;
67
- }
68
- };
69
- function err(error) {
70
- return new Err(error);
71
- }
72
-
73
- export { Err, err };
74
- //# sourceMappingURL=chunk-GLSQCN75.js.map
75
- //# sourceMappingURL=chunk-GLSQCN75.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/err.ts"],"names":[],"mappings":";;;AAMO,IAAM,GAAA,GAAN,MAAM,IAAA,SAAe,UAAA,CAAqB;AAAA;AAAA,EAM7C,YAAqB,KAAA,EAAU;AAC3B,IAAA,KAAA,EAAM;AADW,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA,EAErB;AAAA,EAPS,IAAA,GAAO,KAAA;AAAA,EACP,IAAA,GAAO,KAAA;AAAA,EACP,KAAA,GAAQ,IAAA;AAAA;AAAA;AAAA;AAAA,EAUjB,IAAO,GAAA,EAAkC;AACrC,IAAA,OAAO,IAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAU,EAAA,EAA6B;AACnC,IAAA,OAAO,IAAI,IAAA,CAAI,EAAA,CAAG,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAA,GAAgB;AACZ,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,iCAAA,EAAoC,IAAA,CAAK,KAAK,CAAA,CAAE,CAAA;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA,GAAe;AACX,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,SAAY,YAAA,EAAoB;AAC5B,IAAA,OAAO,YAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,aAAgB,EAAA,EAAwB;AACpC,IAAA,OAAO,EAAA,CAAG,KAAK,KAAK,CAAA;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAKA,QAAW,GAAA,EAA6C;AACpD,IAAA,OAAO,IAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,MAAA,EAAwB;AAC7B,IAAA,OAAO,KAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY,KAAA,EAAmB;AAC3B,IAAA,OAAO,KAAK,KAAA,KAAU,KAAA;AAAA,EAC1B;AACJ;AAKO,SAAS,IAAO,KAAA,EAAkB;AACrC,EAAA,OAAO,IAAI,IAAI,KAAK,CAAA;AACxB","file":"chunk-GLSQCN75.js","sourcesContent":["import type { Result } from '@/core/result';\nimport { ResultBase } from '@/core/result';\n\n/**\n * Represents an error result containing an error value.\n */\nexport class Err<E> extends ResultBase<never, E> {\n readonly _tag = 'err' as const;\n readonly isOk = false;\n readonly isErr = true;\n\n // eslint-disable-next-line node/handle-callback-err\n constructor(readonly error: E) {\n super();\n }\n\n /**\n * Maps the value type, but since this is `Err`, it's a no-op.\n */\n map<U>(_fn: (value: never) => U): Err<E> {\n return this;\n }\n\n /**\n * Maps the contained error using the provided function.\n * Since this is `Err`, the function is always applied.\n */\n mapErr<F>(fn: (error: E) => F): Err<F> {\n return new Err(fn(this.error));\n }\n\n /**\n * Throws an error since this is `Err`, not `Ok`.\n */\n unwrap(): never {\n throw new Error(`Called unwrap() on an Err value: ${this.error}`);\n }\n\n /**\n * Returns the contained error.\n */\n unwrapErr(): E {\n return this.error;\n }\n\n /**\n * Returns the provided default value since this is `Err`.\n */\n unwrapOr<T>(defaultValue: T): T {\n return defaultValue;\n }\n\n /**\n * Computes and returns the fallback value using the provided function.\n */\n unwrapOrElse<T>(fn: (error: E) => T): T {\n return fn(this.error);\n }\n\n /**\n * Returns this `Err` unchanged since there's no value to chain.\n */\n andThen<U>(_fn: (value: never) => Result<U, E>): Err<E> {\n return this;\n }\n\n /**\n * Always returns false since this is `Err`, not `Ok`.\n */\n contains(_value: never): boolean {\n return false;\n }\n\n /**\n * Checks if the contained error matches the provided error.\n */\n containsErr(error: E): boolean {\n return this.error === error;\n }\n}\n\n/**\n * Creates a new `Err` result with the given error.\n */\nexport function err<E>(error: E): Err<E> {\n return new Err(error);\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { err } from './chunk-GLSQCN75.js';
2
- import { ok } from './chunk-GGEJTXXS.js';
3
-
4
- // src/zod-wrapper/zod.ts
5
- function resultHandlerFromZod(schema) {
6
- return (value) => {
7
- const result = schema.safeParse(value);
8
- if (result.success) {
9
- return ok(result.data);
10
- }
11
- return err(result.error);
12
- };
13
- }
14
-
15
- export { resultHandlerFromZod };
16
- //# sourceMappingURL=chunk-ITR7ZRJM.js.map
17
- //# sourceMappingURL=chunk-ITR7ZRJM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/zod-wrapper/zod.ts"],"names":[],"mappings":";;;;AAIO,SAAS,qBAAwB,MAAA,EAAsB;AAC1D,EAAA,OAAO,CAAC,KAAA,KAA6C;AACjD,IAAA,MAAM,MAAA,GAAS,MAAA,CAAO,SAAA,CAAU,KAAK,CAAA;AACrC,IAAA,IAAI,OAAO,OAAA,EAAS;AAChB,MAAA,OAAO,EAAA,CAAG,OAAO,IAAI,CAAA;AAAA,IACzB;AACA,IAAA,OAAO,GAAA,CAAI,OAAO,KAAK,CAAA;AAAA,EAC3B,CAAA;AACJ","file":"chunk-ITR7ZRJM.js","sourcesContent":["import type z from 'zod';\nimport type { Result } from '@/core';\nimport { err, ok } from '@/core';\n\nexport function resultHandlerFromZod<T>(schema: z.ZodType<T>) {\n return (value: unknown): Result<T, z.ZodError<T>> => {\n const result = schema.safeParse(value);\n if (result.success) {\n return ok(result.data);\n }\n return err(result.error);\n };\n}\n"]}
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=chunk-SQ4P2HRX.js.map
3
- //# sourceMappingURL=chunk-SQ4P2HRX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-SQ4P2HRX.js"}
@@ -1 +0,0 @@
1
- export { Err, err } from './index.js';
package/dist/core/err.js DELETED
@@ -1,4 +0,0 @@
1
- export { Err, err } from '../chunk-GLSQCN75.js';
2
- import '../chunk-D2DM2EYA.js';
3
- //# sourceMappingURL=err.js.map
4
- //# sourceMappingURL=err.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"err.js"}
@@ -1,169 +0,0 @@
1
- /**
2
- * Represents an error result containing an error value.
3
- */
4
- declare class Err<E> extends ResultBase<never, E> {
5
- readonly error: E;
6
- readonly _tag: "err";
7
- readonly isOk = false;
8
- readonly isErr = true;
9
- constructor(error: E);
10
- /**
11
- * Maps the value type, but since this is `Err`, it's a no-op.
12
- */
13
- map<U>(_fn: (value: never) => U): Err<E>;
14
- /**
15
- * Maps the contained error using the provided function.
16
- * Since this is `Err`, the function is always applied.
17
- */
18
- mapErr<F>(fn: (error: E) => F): Err<F>;
19
- /**
20
- * Throws an error since this is `Err`, not `Ok`.
21
- */
22
- unwrap(): never;
23
- /**
24
- * Returns the contained error.
25
- */
26
- unwrapErr(): E;
27
- /**
28
- * Returns the provided default value since this is `Err`.
29
- */
30
- unwrapOr<T>(defaultValue: T): T;
31
- /**
32
- * Computes and returns the fallback value using the provided function.
33
- */
34
- unwrapOrElse<T>(fn: (error: E) => T): T;
35
- /**
36
- * Returns this `Err` unchanged since there's no value to chain.
37
- */
38
- andThen<U>(_fn: (value: never) => Result<U, E>): Err<E>;
39
- /**
40
- * Always returns false since this is `Err`, not `Ok`.
41
- */
42
- contains(_value: never): boolean;
43
- /**
44
- * Checks if the contained error matches the provided error.
45
- */
46
- containsErr(error: E): boolean;
47
- }
48
- /**
49
- * Creates a new `Err` result with the given error.
50
- */
51
- declare function err<E>(error: E): Err<E>;
52
-
53
- /**
54
- * Represents a successful result containing a value.
55
- */
56
- declare class Ok<T> extends ResultBase<T, never> {
57
- readonly value: T;
58
- readonly _tag: "ok";
59
- readonly isOk = true;
60
- readonly isErr = false;
61
- constructor(value: T);
62
- /**
63
- * Maps the contained value using the provided function.
64
- * Since this is `Ok`, the function is always applied.
65
- */
66
- map<U>(fn: (value: T) => U): Ok<U>;
67
- /**
68
- * Maps the error type, but since this is `Ok`, it's a no-op.
69
- */
70
- mapErr<F>(_fn: (error: never) => F): Ok<T>;
71
- /**
72
- * Returns the contained value.
73
- */
74
- unwrap(): T;
75
- /**
76
- * Throws an error since this is Ok, not Err.
77
- */
78
- unwrapErr(): never;
79
- /**
80
- * Returns the contained value, ignoring the default.
81
- */
82
- unwrapOr(_defaultValue: T): T;
83
- /**
84
- * Returns the contained value, ignoring the fallback function.
85
- */
86
- unwrapOrElse(_fn: (error: never) => T): T;
87
- /**
88
- * Applies the function to the contained value and returns the result.
89
- */
90
- andThen<U>(fn: (value: T) => Result<U, never>): Result<U, never>;
91
- /**
92
- * Checks if the contained value matches the provided value.
93
- */
94
- contains(value: T): boolean;
95
- /**
96
- * Always returns false since this is `Ok`, not `Err`.
97
- */
98
- containsErr(_error: never): false;
99
- }
100
- /**
101
- * Creates a new `Ok` result with the given value.
102
- */
103
- declare function ok<T>(value: T): Ok<T>;
104
-
105
- /**
106
- * Represents a Result type that can either be a success (`Ok`) or an error (`Err`).
107
- * This is an abstract base class that provides common functionality for both variants.
108
- */
109
- declare abstract class ResultBase<T, E> {
110
- /**
111
- * Type guard to check if the result is an `Ok` variant.
112
- */
113
- abstract readonly isOk: boolean;
114
- /**
115
- * Type guard to check if the result is an `Err` variant.
116
- */
117
- abstract readonly isErr: boolean;
118
- /**
119
- * Maps a `Result<T, E>` to `Result<U, E>` by applying a function to a contained `Ok` value,
120
- * leaving an `Err` value untouched.
121
- */
122
- abstract map<U>(fn: (value: T) => U): Result<U, E>;
123
- /**
124
- * Maps a `Result<T, E>` to `Result<T, F>` by applying a function to a contained `Err` value,
125
- * leaving an `Ok` value untouched.
126
- */
127
- abstract mapErr<F>(fn: (error: E) => F): Result<T, F>;
128
- /**
129
- * Returns the contained `Ok` value, consuming the self value.
130
- * Throws an error if the result is `Err`.
131
- */
132
- abstract unwrap(): T;
133
- /**
134
- * Returns the contained `Err` value, consuming the self value.
135
- * Throws an error if the result is Ok.
136
- */
137
- abstract unwrapErr(): E;
138
- /**
139
- * Returns the contained `Ok` value or a provided default.
140
- */
141
- abstract unwrapOr(defaultValue: T): T;
142
- /**
143
- * Returns the contained `Ok` value or computes it from a closure.
144
- */
145
- abstract unwrapOrElse(fn: (error: E) => T): T;
146
- /**
147
- * Calls the provided function with the contained value and returns the result.
148
- * If the result is `Err`, the function is not called and the `Err` is returned.
149
- */
150
- abstract andThen<U>(fn: (value: T) => Result<U, E>): Result<U, E>;
151
- /**
152
- * Returns true if the result is `Ok` and the value inside of it matches a predicate.
153
- */
154
- abstract contains(value: T): boolean;
155
- /**
156
- * Returns true if the result is `Err` and the error inside of it matches a predicate.
157
- */
158
- abstract containsErr(error: E): boolean;
159
- }
160
- /**
161
- * Type alias for a `Result` that can be either `Ok<T>` or `Err<E>`.
162
- */
163
- type Result<T, E> = Ok<T> | Err<E>;
164
- /**
165
- * Type alias for an async `Result` (Promise-wrapped `Result`).
166
- */
167
- type AsyncResult<T, E> = Promise<Result<T, E>>;
168
-
169
- export { type AsyncResult, Err, Ok, type Result, ResultBase, err, ok };
@@ -1,6 +0,0 @@
1
- import '../chunk-SQ4P2HRX.js';
2
- export { Err, err } from '../chunk-GLSQCN75.js';
3
- export { Ok, ok } from '../chunk-GGEJTXXS.js';
4
- import '../chunk-D2DM2EYA.js';
5
- //# sourceMappingURL=index.js.map
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/core/ok.d.ts DELETED
@@ -1 +0,0 @@
1
- export { Ok, ok } from './index.js';
package/dist/core/ok.js DELETED
@@ -1,4 +0,0 @@
1
- export { Ok, ok } from '../chunk-GGEJTXXS.js';
2
- import '../chunk-D2DM2EYA.js';
3
- //# sourceMappingURL=ok.js.map
4
- //# sourceMappingURL=ok.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"ok.js"}
@@ -1 +0,0 @@
1
- export { AsyncResult, Result, ResultBase } from './index.js';
@@ -1,3 +0,0 @@
1
- export { ResultBase } from '../chunk-D2DM2EYA.js';
2
- //# sourceMappingURL=result.js.map
3
- //# sourceMappingURL=result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"result.js"}
@@ -1,3 +0,0 @@
1
- export { resultHandlerFromZod } from './zod.js';
2
- import 'zod';
3
- import '../core/index.js';
@@ -1,7 +0,0 @@
1
- export { resultHandlerFromZod } from '../chunk-ITR7ZRJM.js';
2
- import '../chunk-SQ4P2HRX.js';
3
- import '../chunk-GLSQCN75.js';
4
- import '../chunk-GGEJTXXS.js';
5
- import '../chunk-D2DM2EYA.js';
6
- //# sourceMappingURL=index.js.map
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,6 +0,0 @@
1
- import z from 'zod';
2
- import { Result } from '../core/index.js';
3
-
4
- declare function resultHandlerFromZod<T>(schema: z.ZodType<T>): (value: unknown) => Result<T, z.ZodError<T>>;
5
-
6
- export { resultHandlerFromZod };
@@ -1,7 +0,0 @@
1
- export { resultHandlerFromZod } from '../chunk-ITR7ZRJM.js';
2
- import '../chunk-SQ4P2HRX.js';
3
- import '../chunk-GLSQCN75.js';
4
- import '../chunk-GGEJTXXS.js';
5
- import '../chunk-D2DM2EYA.js';
6
- //# sourceMappingURL=zod.js.map
7
- //# sourceMappingURL=zod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"zod.js"}