@carbonteq/fp 0.7.0 → 0.8.0-alpha.1

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/dist/result.cjs CHANGED
@@ -1,34 +1,17 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var result_exports = {};
21
- __export(result_exports, {
22
- Result: () => Result,
23
- UnwrappedErrWithOk: () => UnwrappedErrWithOk,
24
- UnwrappedOkWithErr: () => UnwrappedOkWithErr
25
- });
26
- module.exports = __toCommonJS(result_exports);
27
- var import_types = require("node:util/types");
28
- var import_unit = require("./unit.js");
1
+ 'use strict';
2
+
3
+ var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
4
+ var assert = require('node:assert');
5
+ var types = require('node:util/types');
6
+ var unit_js = require('./unit.js');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var assert__default = /*#__PURE__*/_interopDefault(assert);
11
+
29
12
  class UnwrappedErrWithOk extends Error {
30
13
  static {
31
- __name(this, "UnwrappedErrWithOk");
14
+ chunkPK6SKIKE_cjs.__name(this, "UnwrappedErrWithOk");
32
15
  }
33
16
  constructor(r) {
34
17
  super(`Attempted to call unwrapErr on an okay value: <${r}>`);
@@ -36,253 +19,403 @@ class UnwrappedErrWithOk extends Error {
36
19
  }
37
20
  class UnwrappedOkWithErr extends Error {
38
21
  static {
39
- __name(this, "UnwrappedOkWithErr");
22
+ chunkPK6SKIKE_cjs.__name(this, "UnwrappedOkWithErr");
40
23
  }
41
24
  constructor(r) {
42
25
  super(`Attempted to call unwrap on an Err value: <${r}>`);
43
26
  }
44
27
  }
45
- const okPred = /* @__PURE__ */ __name((el) => el.isOk(), "okPred");
46
- const errPred = /* @__PURE__ */ __name((el) => el.isErr(), "errPred");
47
- const preds = [
48
- okPred,
49
- errPred
50
- ];
51
28
  const Sentinel = Symbol.for("ResultSentinel");
52
29
  class Result {
53
30
  static {
54
- __name(this, "Result");
55
- }
56
- val;
57
- error;
58
- static UNIT_RESULT = new Result(import_unit.UNIT, null);
59
- constructor(val, error) {
60
- this.val = val;
61
- this.error = error;
31
+ chunkPK6SKIKE_cjs.__name(this, "Result");
32
+ }
33
+ static UNIT_RESULT = new Result(unit_js.UNIT, {
34
+ errSlot: Sentinel
35
+ });
36
+ // Actual value holder. In async ops, will be used to chain. Cannot go back to normal after promise chain starts, although that could be looked into
37
+ #val;
38
+ // to prevent unnecessary chaining - no other purpose. Should be modifiable only within the creating method
39
+ #ctx;
40
+ constructor(val, ctx) {
41
+ this.#val = val;
42
+ this.#ctx = ctx;
62
43
  }
63
44
  static Ok(val) {
64
- return new Result(val, Sentinel);
45
+ return new Result(val, {
46
+ errSlot: Sentinel
47
+ });
65
48
  }
66
49
  static Err(err) {
67
- return new Result(Sentinel, err);
50
+ return new Result(Sentinel, {
51
+ errSlot: err
52
+ });
68
53
  }
69
54
  isOk() {
70
- return this.val !== Sentinel;
55
+ return this.#ctx.errSlot === Sentinel;
71
56
  }
72
57
  isErr() {
73
- return this.error !== Sentinel;
58
+ return this.#ctx.errSlot !== Sentinel;
74
59
  }
75
60
  isUnit() {
76
- return this.val === import_unit.UNIT;
61
+ return this.#val === unit_js.UNIT;
77
62
  }
78
63
  toString() {
79
- if (this.val !== Sentinel) {
80
- return `Result::Ok<${this.val}>`;
64
+ if (this.isOk()) {
65
+ return `Result::Ok<${String(this.#val)}>`;
81
66
  }
82
- return `Result::Err<${this.error}>`;
67
+ return `Result::Err<${String(this.#ctx.errSlot)}>`;
83
68
  }
84
69
  unwrap() {
85
- if (this.val === Sentinel) {
86
- if (this.error instanceof Error) throw this.error;
70
+ const curr = this.#val;
71
+ if (this.isErr()) {
72
+ const err = this.#ctx.errSlot;
73
+ if (err instanceof Error) throw err;
87
74
  throw new UnwrappedOkWithErr(this);
88
75
  }
89
- return this.val;
90
- }
91
- unwrapOr(def) {
92
- if (this.val === Sentinel) return def;
93
- return this.val;
94
- }
95
- unwrapOrElse(def) {
96
- if (this.val === Sentinel) return def();
97
- return this.val;
98
- }
99
- safeUnwrap() {
100
- return this.val === Sentinel ? null : this.val;
76
+ if (types.isPromise(curr)) {
77
+ return new Promise((resolve, reject) => {
78
+ curr.then((v) => {
79
+ if (v === Sentinel) {
80
+ let e;
81
+ if (this.#ctx.errSlot instanceof Error) e = this.#ctx.errSlot;
82
+ else e = new UnwrappedOkWithErr(this);
83
+ reject(e);
84
+ }
85
+ resolve(v);
86
+ }, reject);
87
+ });
88
+ }
89
+ return curr;
101
90
  }
102
91
  unwrapErr() {
103
- if (this.isOk()) {
104
- throw new UnwrappedErrWithOk(this);
92
+ const errSlot = this.#ctx.errSlot;
93
+ if (errSlot !== Sentinel) {
94
+ return errSlot;
105
95
  }
106
- return this.error;
96
+ const curr = this.#val;
97
+ if (types.isPromise(curr)) {
98
+ return new Promise((resolve, reject) => {
99
+ curr.then((v) => {
100
+ if (v !== Sentinel) {
101
+ reject(new UnwrappedErrWithOk(this));
102
+ }
103
+ resolve(this.#ctx.errSlot);
104
+ }, reject);
105
+ });
106
+ }
107
+ assert__default.default(curr !== Sentinel, "value must not be Sentinel at this point");
108
+ throw new UnwrappedErrWithOk(this);
107
109
  }
108
- safeUnwrapErr() {
109
- return this.error === Sentinel ? null : this.error;
110
+ safeUnwrap() {
111
+ return this.#val === Sentinel ? null : this.#val;
110
112
  }
111
113
  map(fn) {
112
- if (this.val === Sentinel) return Result.Err(this.error);
113
- const r = fn(this.val);
114
- if ((0, import_types.isPromise)(r)) {
115
- return r.then((val) => Result.Ok(val));
114
+ if (this.isErr()) return Result.Err(this.#ctx.errSlot);
115
+ assert__default.default(this.#val !== Sentinel, "cannot be Sentinel at this point");
116
+ const curr = this.#val;
117
+ const immutableCtx = this.#ctx;
118
+ const mutableCtx = {
119
+ errSlot: Sentinel
120
+ };
121
+ if (types.isPromise(curr)) {
122
+ const p = curr;
123
+ const out = p.then((v) => {
124
+ if (v === Sentinel) {
125
+ mutableCtx.errSlot = immutableCtx.errSlot;
126
+ return Sentinel;
127
+ }
128
+ const mapped = fn(v);
129
+ return mapped;
130
+ });
131
+ return new Result(out, mutableCtx);
116
132
  }
117
- return Result.Ok(r);
133
+ const next = fn(curr);
134
+ return new Result(next, mutableCtx);
118
135
  }
119
136
  /** Same as map, but for the error value instead of the Ok value */
120
137
  mapErr(fn) {
121
- if (this.error !== Sentinel) {
122
- const mappedErr = fn(this.error);
138
+ if (this.isErr()) {
139
+ const mappedErr = fn(this.#ctx.errSlot);
123
140
  return Result.Err(mappedErr);
124
141
  }
125
- return Result.Ok(this.val);
126
- }
127
- mapOr(default_, fn) {
128
- if (this.val === Sentinel) return default_;
129
- return fn(this.val);
130
- }
131
- mapOrAsync(default_, fn) {
132
- if (this.val === Sentinel) return Promise.resolve(default_);
133
- return fn(this.val);
142
+ const curr = this.#val;
143
+ const newCtx = {
144
+ errSlot: Sentinel
145
+ };
146
+ const ctx = this.#ctx;
147
+ if (types.isPromise(curr)) {
148
+ const p = curr.then((v) => {
149
+ if (ctx.errSlot !== Sentinel) {
150
+ const mappedErr = fn(ctx.errSlot);
151
+ newCtx.errSlot = mappedErr;
152
+ }
153
+ return v;
154
+ });
155
+ return new Result(p, newCtx);
156
+ }
157
+ return new Result(this.#val, newCtx);
134
158
  }
135
- /** For combining two results. For the lazy eval version, see {@link flatZip} and {@link zipAsync} */
136
- and(r) {
137
- if (this.isErr()) return this;
138
- if (r.isErr()) return r;
139
- return Result.Ok([
140
- this.val,
141
- r.val
142
- ]);
159
+ mapBoth(fnOk, fnErr) {
160
+ if (this.isErr()) {
161
+ return this.mapErr(fnErr);
162
+ }
163
+ if (types.isPromise(this.#val)) {
164
+ return this.map(fnOk);
165
+ }
166
+ return this.map(fnOk);
143
167
  }
144
168
  flatMap(fn) {
145
- if (this.val !== Sentinel) return fn(this.val);
146
- return Result.Err(this.error);
169
+ if (this.isErr()) return Result.Err(this.#ctx.errSlot);
170
+ assert__default.default(this.#val !== Sentinel, "cannot be Sentinel at this point");
171
+ const curr = this.#val;
172
+ const immutableCtx = this.#ctx;
173
+ const mutableCtx = {
174
+ errSlot: Sentinel
175
+ };
176
+ if (types.isPromise(curr)) {
177
+ const newP = new Promise((resolve, reject) => {
178
+ curr.then((v) => {
179
+ if (v === Sentinel) {
180
+ mutableCtx.errSlot = immutableCtx.errSlot;
181
+ return resolve(Sentinel);
182
+ }
183
+ const mapped2 = fn(v);
184
+ const p2 = Result.flatMapHelper(mutableCtx, mapped2);
185
+ resolve(p2);
186
+ }, reject);
187
+ });
188
+ return new Result(newP, mutableCtx);
189
+ }
190
+ const mapped = fn(curr);
191
+ const p = Result.flatMapHelper(mutableCtx, mapped);
192
+ return new Result(p, mutableCtx);
147
193
  }
148
- bind(fn) {
149
- if (this.val !== Sentinel) return fn(this.val);
150
- return Result.Err(this.error);
194
+ static flatMapHelper(mutableCtx, mapped) {
195
+ if (types.isPromise(mapped)) {
196
+ return mapped.then((r) => Result.flatMapInnerHelper(mutableCtx, r));
197
+ }
198
+ return Result.flatMapInnerHelper(mutableCtx, mapped);
199
+ }
200
+ static flatMapInnerHelper(mutableCtx, r) {
201
+ if (types.isPromise(r.#val)) {
202
+ return r.#val.then((v) => {
203
+ if (v === Sentinel) {
204
+ mutableCtx.errSlot = r.#ctx.errSlot;
205
+ }
206
+ return v;
207
+ });
208
+ }
209
+ if (r.#val === Sentinel) {
210
+ mutableCtx.errSlot = r.#ctx.errSlot;
211
+ return Sentinel;
212
+ }
213
+ return r.#val;
151
214
  }
152
215
  zipErr(fn) {
153
- if (this.val === Sentinel) return Result.Err(this.error);
154
- const r = fn(this.val);
155
- if ((0, import_types.isPromise)(r)) {
156
- return r.then((result) => result.map((_) => this.val));
216
+ if (this.isErr()) {
217
+ return Result.Err(this.#ctx.errSlot);
157
218
  }
158
- return r.map((_) => this.val);
159
- }
160
- /** For running infallible side-effects on the contained value. Up to the programmer to ensure the underlying function doesn't fail */
161
- tap(fn) {
162
- if (this.val !== Sentinel) {
163
- fn(this.val);
219
+ assert__default.default(this.#val !== Sentinel, "cannot be Sentinel at this point");
220
+ const curr = this.#val;
221
+ const immutableCtx = this.#ctx;
222
+ const mutableCtx = {
223
+ errSlot: Sentinel
224
+ };
225
+ if (types.isPromise(curr)) {
226
+ const newP2 = curr.then((v) => {
227
+ if (v === Sentinel) {
228
+ mutableCtx.errSlot = immutableCtx.errSlot;
229
+ return Sentinel;
230
+ }
231
+ const r2 = fn(v);
232
+ return Result.zipErrHelper(v, r2, mutableCtx);
233
+ });
234
+ return new Result(newP2, mutableCtx);
164
235
  }
165
- return this;
166
- }
167
- /**
168
- * Async version of {@link tap}
169
- * @see {@link tap}
170
- */
171
- async tapAsync(fn) {
172
- if (this.val !== Sentinel) {
173
- await fn(this.val);
236
+ const r = fn(curr);
237
+ const newP = Result.zipErrHelper(curr, r, mutableCtx);
238
+ return new Result(newP, mutableCtx);
239
+ }
240
+ static zipErrHelper(v, r, newCtx) {
241
+ if (types.isPromise(r)) {
242
+ const finalPromise = r.then((newResult) => {
243
+ if (newResult.#ctx.errSlot !== Sentinel) newCtx.errSlot = newResult.#ctx.errSlot;
244
+ return v;
245
+ });
246
+ return finalPromise;
174
247
  }
175
- return this;
248
+ if (r.#ctx.errSlot !== Sentinel) newCtx.errSlot = r.#ctx.errSlot;
249
+ return v;
176
250
  }
177
251
  zip(fn) {
178
- if (this.val === Sentinel) return Result.Err(this.error);
179
- const r = fn(this.val);
180
- if ((0, import_types.isPromise)(r)) {
181
- return r.then((u) => Result.Ok([
182
- this.val,
183
- u
184
- ]));
252
+ if (this.isErr()) return Result.Err(this.#ctx.errSlot);
253
+ const curr = this.#val;
254
+ assert__default.default(this.#val !== Sentinel, "cannot be Sentinel at this point");
255
+ const immutableCtx = this.#ctx;
256
+ const mutableCtx = {
257
+ errSlot: Sentinel
258
+ };
259
+ if (types.isPromise(curr)) {
260
+ const newP = curr.then((v) => {
261
+ if (v === Sentinel) {
262
+ mutableCtx.errSlot = immutableCtx.errSlot;
263
+ return Sentinel;
264
+ }
265
+ const u2 = fn(v);
266
+ if (types.isPromise(u2)) return u2.then((uu) => [
267
+ v,
268
+ uu
269
+ ]);
270
+ return [
271
+ v,
272
+ u2
273
+ ];
274
+ });
275
+ return new Result(newP, mutableCtx);
185
276
  }
186
- return Result.Ok([
187
- this.val,
188
- r
189
- ]);
190
- }
191
- flatZip(fn) {
192
- if (this.val === Sentinel) return Result.Err(this.error);
193
- const r = fn(this.val);
194
- if ((0, import_types.isPromise)(r)) {
195
- return r.then((other) => other.map((u) => [
196
- this.val,
197
- u
198
- ]));
277
+ const u = fn(curr);
278
+ if (types.isPromise(u)) {
279
+ return new Result(u.then((uu) => [
280
+ curr,
281
+ uu
282
+ ]), mutableCtx);
199
283
  }
200
- return r.map((u) => [
201
- this.val,
284
+ return new Result([
285
+ curr,
202
286
  u
203
- ]);
287
+ ], mutableCtx);
204
288
  }
205
- static all(c, seq) {
206
- const pred = preds[Number(c === "ok")];
207
- for (const el of seq) {
208
- if (!pred(el)) return false;
289
+ flatZip(fn) {
290
+ if (this.isErr()) return Result.Err(this.#ctx.errSlot);
291
+ const curr = this.#val;
292
+ assert__default.default(this.#val !== Sentinel, "cannot be Sentinel at this point");
293
+ const immutableCtx = this.#ctx;
294
+ const mutableCtx = {
295
+ errSlot: Sentinel
296
+ };
297
+ if (types.isPromise(curr)) {
298
+ const newP = curr.then((v) => {
299
+ if (v === Sentinel) {
300
+ mutableCtx.errSlot = immutableCtx.errSlot;
301
+ return v;
302
+ }
303
+ const mapped2 = fn(v);
304
+ return Result.flatZipHelper(mutableCtx, v, mapped2);
305
+ });
306
+ return new Result(newP, mutableCtx);
209
307
  }
210
- return true;
308
+ const mapped = fn(curr);
309
+ const p = Result.flatZipHelper(mutableCtx, curr, mapped);
310
+ return new Result(p, mutableCtx);
211
311
  }
212
- /** Whether any of the underlying results are Ok or Err */
213
- static any(c, seq) {
214
- const pred = preds[Number(c === "ok")];
215
- for (const el of seq) {
216
- if (pred(el)) return true;
312
+ static flatZipHelper(mutableCtx, originalVal, mapped) {
313
+ if (types.isPromise(mapped)) {
314
+ return mapped.then((r) => Result.flatZipInnerHelper(mutableCtx, originalVal, r));
217
315
  }
218
- return false;
219
- }
220
- /**
221
- * `Result.sequence(Result<T1, E1>, Result<T2, E2>, ...)` will return `Result<[T1, T2, ...], E1 | E2 | ...>`
222
- * @example
223
- * const r1 = Result.Ok<string, string>("abc")
224
- * const r2 = Result.Ok<number, Error>(123)
225
- * const r = Result.sequence(r1, r2) // r will be of type Result<[string, number], string | Error>
226
- */
227
- static sequence(...results) {
228
- const vals = [];
229
- for (const r of results) {
230
- if (r.isErr()) return r;
231
- vals.push(r.unwrap());
316
+ return Result.flatZipInnerHelper(mutableCtx, originalVal, mapped);
317
+ }
318
+ static flatZipInnerHelper(mutableCtx, originalVal, r) {
319
+ if (types.isPromise(r.#val)) {
320
+ return r.#val.then((v) => {
321
+ if (v === Sentinel) {
322
+ mutableCtx.errSlot = r.#ctx.errSlot;
323
+ }
324
+ return [
325
+ originalVal,
326
+ v
327
+ ];
328
+ });
232
329
  }
233
- return Result.Ok(vals);
234
- }
235
- /** Convert a Result of a Promise to the Promise of a Result */
236
- static async lift(r) {
237
- if (r.isErr()) return Promise.resolve(Result.Err(r.error));
238
- return r.val.then((v) => Result.Ok(v));
330
+ if (r.#val === Sentinel) {
331
+ mutableCtx.errSlot = r.#ctx.errSlot;
332
+ return Sentinel;
333
+ }
334
+ return [
335
+ originalVal,
336
+ r.#val
337
+ ];
239
338
  }
240
339
  //#endregion
241
- // static innerMap<T, U, E>(
242
- // r: Result<Array<T>, E>,
243
- // mapper: (val: T) => U,
244
- // ): Result<Array<U>, E> {
245
- // return r.map((inner) => inner.map(mapper));
246
- // }
247
- // innerMap<Inner, U>(
248
- // this: Result<Array<Inner>, E>,
249
- // mapper: (val: T) => U,
250
- // ): Result<Array<U>, E>;
251
- // innerMap<U>(this: Result<unknown, E>, mapper: (val: T) => U): never;
252
- // innerMap<U>(this: Result<unknown, E>, mapper: (val: T) => U) {
253
- // if (this.val === Sentinel) return this;
254
- //
255
- // if (Array.isArray(this.val)) {
256
- // return Result.Ok(this.val.map(mapper));
257
- // }
258
- //
259
- // throw new Error("Can only be called for Result<Array<T>, E>");
260
- // }
261
340
  innerMap(mapper) {
262
- if (this.val === Sentinel) return this;
263
- if (Array.isArray(this.val)) {
264
- return Result.Ok(this.val.map(mapper));
341
+ if (this.isErr()) return this;
342
+ if (Array.isArray(this.#val)) {
343
+ return new Result(this.#val.map(mapper), this.#ctx);
265
344
  }
266
345
  throw new Error("Can only be called for Result<Array<T>, E>");
267
346
  }
268
- pipe(...fns) {
269
- let res3 = this;
270
- for (const fn of fns) {
271
- res3 = res3.map(fn);
347
+ async toPromise() {
348
+ const v = await this.#val;
349
+ return new Result(v, this.#ctx);
350
+ }
351
+ validate(validators) {
352
+ if (this.isErr()) return this;
353
+ const currVal = this.#val;
354
+ const currCtx = this.#ctx;
355
+ const mutableCtx = {
356
+ errSlot: Sentinel
357
+ };
358
+ if (types.isPromise(currVal)) {
359
+ return new Result(currVal.then(async (c) => {
360
+ if (currCtx.errSlot !== Sentinel) {
361
+ mutableCtx.errSlot = currCtx.errSlot;
362
+ return Sentinel;
363
+ }
364
+ const results2 = validators.map((v) => v(currVal));
365
+ return Promise.all(results2).then((resolved) => Result.validateHelper(resolved, mutableCtx, c));
366
+ }), mutableCtx);
367
+ }
368
+ const results = validators.map((v) => v(currVal));
369
+ if (results.some(types.isPromise)) {
370
+ return new Result(Promise.all(results).then((resolved) => Result.validateHelper(resolved, mutableCtx, currVal)), mutableCtx);
371
+ }
372
+ const values = results.map((r) => r.#val);
373
+ if (values.some(types.isPromise)) {
374
+ return new Result(Result.validateHelper(results, mutableCtx, currVal), mutableCtx);
375
+ }
376
+ const combinedRes = Result.all(...results);
377
+ return combinedRes.isErr() ? combinedRes : this;
378
+ }
379
+ static validateHelper(results, currCtx, currVal) {
380
+ const combinedRes = Result.all(...results);
381
+ if (types.isPromise(combinedRes)) {
382
+ return combinedRes.then((cRes) => {
383
+ if (cRes.isErr()) {
384
+ currCtx.errSlot = cRes.#ctx.errSlot;
385
+ return Sentinel;
386
+ }
387
+ return currVal;
388
+ });
272
389
  }
273
- return res3;
390
+ if (combinedRes.isErr()) {
391
+ currCtx.errSlot = combinedRes.#ctx.errSlot;
392
+ return Sentinel;
393
+ }
394
+ return currVal;
395
+ }
396
+ static all(...results) {
397
+ const vals = results.map((r) => r.#val);
398
+ const mutableCtx = {
399
+ errSlot: Sentinel
400
+ };
401
+ if (vals.some(types.isPromise)) {
402
+ return new Result(Promise.all(vals).then((v) => {
403
+ if (results.some((r) => r.isErr())) {
404
+ mutableCtx.errSlot = results.filter((r) => r.isErr()).map((r) => r.#ctx.errSlot);
405
+ return Sentinel;
406
+ }
407
+ return v;
408
+ }), mutableCtx);
409
+ }
410
+ if (results.some((r) => r.isErr())) {
411
+ return Result.Err(results.filter((r) => r.isErr()).map((r) => r.#ctx.errSlot));
412
+ }
413
+ return Result.Ok(vals);
274
414
  }
275
415
  }
276
- const res = Result.Ok([
277
- 1,
278
- 2,
279
- 3
280
- ]);
281
- const res2 = Result.Ok(123);
282
- // Annotate the CommonJS export names for ESM import in node:
283
- 0 && (module.exports = {
284
- Result,
285
- UnwrappedErrWithOk,
286
- UnwrappedOkWithErr
287
- });
416
+
417
+ exports.Result = Result;
418
+ exports.UnwrappedErrWithOk = UnwrappedErrWithOk;
419
+ exports.UnwrappedOkWithErr = UnwrappedOkWithErr;
420
+ //# sourceMappingURL=result.cjs.map
288
421
  //# sourceMappingURL=result.cjs.map