@fgv/ts-utils 4.5.0-1 → 4.5.0-3
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/ts-utils.d.ts +121 -17
- package/lib/packlets/base/mapResults.js +1 -1
- package/lib/packlets/base/mapResults.js.map +1 -1
- package/lib/packlets/base/result.d.ts +78 -15
- package/lib/packlets/base/result.d.ts.map +1 -1
- package/lib/packlets/base/result.js +101 -19
- package/lib/packlets/base/result.js.map +1 -1
- package/lib/packlets/conversion/converters.d.ts.map +1 -1
- package/lib/packlets/conversion/converters.js.map +1 -1
- package/lib/packlets/conversion/objectConverter.d.ts +40 -2
- package/lib/packlets/conversion/objectConverter.d.ts.map +1 -1
- package/lib/packlets/conversion/objectConverter.js +81 -45
- package/lib/packlets/conversion/objectConverter.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,9 +23,13 @@
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.DetailedFailure = exports.DetailedSuccess = exports.Failure = exports.Success = void 0;
|
|
25
25
|
exports.succeed = succeed;
|
|
26
|
+
exports.succeeds = succeeds;
|
|
26
27
|
exports.fail = fail;
|
|
28
|
+
exports.fails = fails;
|
|
27
29
|
exports.succeedWithDetail = succeedWithDetail;
|
|
30
|
+
exports.succeedsWithDetail = succeedsWithDetail;
|
|
28
31
|
exports.failWithDetail = failWithDetail;
|
|
32
|
+
exports.failsWithDetail = failsWithDetail;
|
|
29
33
|
exports.propagateWithDetail = propagateWithDetail;
|
|
30
34
|
exports.captureResult = captureResult;
|
|
31
35
|
/**
|
|
@@ -96,7 +100,7 @@ class Success {
|
|
|
96
100
|
* {@inheritdoc IResult.onSuccess}
|
|
97
101
|
*/
|
|
98
102
|
onSuccess(cb) {
|
|
99
|
-
return cb(this.
|
|
103
|
+
return cb(this._value);
|
|
100
104
|
}
|
|
101
105
|
/**
|
|
102
106
|
* {@inheritdoc IResult.onFailure}
|
|
@@ -114,20 +118,29 @@ class Success {
|
|
|
114
118
|
* {@inheritdoc IResult.withFailureDetail}
|
|
115
119
|
*/
|
|
116
120
|
withFailureDetail(__detail) {
|
|
117
|
-
return succeedWithDetail(this.
|
|
121
|
+
return succeedWithDetail(this._value);
|
|
118
122
|
}
|
|
119
123
|
/**
|
|
120
124
|
* {@inheritdoc IResult.withDetail}
|
|
121
125
|
*/
|
|
122
126
|
withDetail(detail, successDetail) {
|
|
123
|
-
return succeedWithDetail(this.
|
|
127
|
+
return succeedWithDetail(this._value, successDetail !== null && successDetail !== void 0 ? successDetail : detail);
|
|
124
128
|
}
|
|
125
129
|
/**
|
|
126
130
|
* {@inheritdoc IResult.aggregateError}
|
|
127
131
|
*/
|
|
128
|
-
aggregateError(
|
|
132
|
+
aggregateError(__errors) {
|
|
129
133
|
return this;
|
|
130
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Creates a {@link Success | Success<T>} with the supplied value.
|
|
137
|
+
* @param value - The value to be returned.
|
|
138
|
+
* @returns The resulting {@link Success | Success<T>} with the supplied value.
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
static with(value) {
|
|
142
|
+
return new Success(value);
|
|
143
|
+
}
|
|
131
144
|
}
|
|
132
145
|
exports.Success = Success;
|
|
133
146
|
/**
|
|
@@ -201,37 +214,37 @@ class Failure {
|
|
|
201
214
|
* {@inheritdoc IResult.onSuccess}
|
|
202
215
|
*/
|
|
203
216
|
onSuccess(__) {
|
|
204
|
-
return new Failure(this.
|
|
217
|
+
return new Failure(this._message);
|
|
205
218
|
}
|
|
206
219
|
/**
|
|
207
220
|
* {@inheritdoc IResult.onFailure}
|
|
208
221
|
*/
|
|
209
222
|
onFailure(cb) {
|
|
210
|
-
return cb(this.
|
|
223
|
+
return cb(this._message);
|
|
211
224
|
}
|
|
212
225
|
/**
|
|
213
226
|
* {@inheritdoc IResult.withErrorFormat}
|
|
214
227
|
*/
|
|
215
228
|
withErrorFormat(cb) {
|
|
216
|
-
return fail(cb(this.
|
|
229
|
+
return fail(cb(this._message));
|
|
217
230
|
}
|
|
218
231
|
/**
|
|
219
232
|
* {@inheritdoc IResult.withFailureDetail}
|
|
220
233
|
*/
|
|
221
234
|
withFailureDetail(detail) {
|
|
222
|
-
return failWithDetail(this.
|
|
235
|
+
return failWithDetail(this._message, detail);
|
|
223
236
|
}
|
|
224
237
|
/**
|
|
225
238
|
* {@inheritdoc IResult.withDetail}
|
|
226
239
|
*/
|
|
227
240
|
withDetail(detail, __successDetail) {
|
|
228
|
-
return failWithDetail(this.
|
|
241
|
+
return failWithDetail(this._message, detail);
|
|
229
242
|
}
|
|
230
243
|
/**
|
|
231
244
|
* {@inheritdoc IResult.aggregateError}
|
|
232
245
|
*/
|
|
233
246
|
aggregateError(errors) {
|
|
234
|
-
errors.addMessage(this.
|
|
247
|
+
errors.addMessage(this._message);
|
|
235
248
|
return this;
|
|
236
249
|
}
|
|
237
250
|
/**
|
|
@@ -241,29 +254,58 @@ class Failure {
|
|
|
241
254
|
* @returns A string representing this object.
|
|
242
255
|
*/
|
|
243
256
|
toString() {
|
|
244
|
-
return this.
|
|
257
|
+
return this._message;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Creates a {@link Failure | Failure<T>} with the supplied error message.
|
|
261
|
+
* @param message - The error message to be returned.
|
|
262
|
+
* @returns The resulting {@link Failure | Failure<T>} with the supplied error message.
|
|
263
|
+
*/
|
|
264
|
+
static with(message) {
|
|
265
|
+
return new Failure(message);
|
|
245
266
|
}
|
|
246
267
|
}
|
|
247
268
|
exports.Failure = Failure;
|
|
248
269
|
/**
|
|
249
270
|
* Returns {@link Success | Success<T>} with the supplied result value.
|
|
250
271
|
* @param value - The successful result value to be returned
|
|
272
|
+
* @remarks
|
|
273
|
+
* A `succeeds` alias was added in release 5.0 for
|
|
274
|
+
* naming consistency with {@link fails | fails}, which was added
|
|
275
|
+
* to avoid conflicts with test frameworks and libraries.
|
|
251
276
|
* @public
|
|
252
277
|
*/
|
|
253
278
|
function succeed(value) {
|
|
254
279
|
return new Success(value);
|
|
255
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* {@inheritdoc succeed}
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
285
|
+
function succeeds(value) {
|
|
286
|
+
return new Success(value);
|
|
287
|
+
}
|
|
256
288
|
/**
|
|
257
289
|
* Returns {@link Failure | Failure<T>} with the supplied error message.
|
|
258
290
|
* @param message - Error message to be returned.
|
|
291
|
+
* @remarks
|
|
292
|
+
* A `fails` alias was added in release 5.0 due to
|
|
293
|
+
* issues with the name `fail` being used test frameworks and libraries.
|
|
259
294
|
* @public
|
|
260
295
|
*/
|
|
261
296
|
function fail(message) {
|
|
262
297
|
return new Failure(message);
|
|
263
298
|
}
|
|
264
299
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
300
|
+
* {@inheritdoc fail}
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
303
|
+
function fails(message) {
|
|
304
|
+
return new Failure(message);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* A {@link DetailedSuccess | DetailedSuccess} extends {@link Success | Success} to report optional success
|
|
308
|
+
* details in addition to the error message.
|
|
267
309
|
* @public
|
|
268
310
|
*/
|
|
269
311
|
class DetailedSuccess extends Success {
|
|
@@ -305,7 +347,7 @@ class DetailedSuccess extends Success {
|
|
|
305
347
|
* @returns The {@link DetailedResult | DetailedResult<T, TD>} returned by the success callback.
|
|
306
348
|
*/
|
|
307
349
|
onSuccess(cb) {
|
|
308
|
-
return cb(this.
|
|
350
|
+
return cb(this._value, this._detail);
|
|
309
351
|
}
|
|
310
352
|
/**
|
|
311
353
|
* Propagates this {@link DetailedSuccess}.
|
|
@@ -324,11 +366,18 @@ class DetailedSuccess extends Success {
|
|
|
324
366
|
withErrorFormat(cb) {
|
|
325
367
|
return this;
|
|
326
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Creates a {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value and
|
|
371
|
+
* optional detail.
|
|
372
|
+
*/
|
|
373
|
+
static with(value, detail) {
|
|
374
|
+
return new DetailedSuccess(value, detail);
|
|
375
|
+
}
|
|
327
376
|
}
|
|
328
377
|
exports.DetailedSuccess = DetailedSuccess;
|
|
329
378
|
/**
|
|
330
|
-
* A {@link DetailedFailure} extends {@link Failure} to report optional
|
|
331
|
-
* addition to the error message.
|
|
379
|
+
* A {@link DetailedFailure | DetailedFailure<T, TD>} extends {@link Failure | Failure<T>} to report optional
|
|
380
|
+
* failure details in addition to the error message.
|
|
332
381
|
* @public
|
|
333
382
|
*/
|
|
334
383
|
class DetailedFailure extends Failure {
|
|
@@ -370,7 +419,7 @@ class DetailedFailure extends Failure {
|
|
|
370
419
|
* the error message and detail from this one.
|
|
371
420
|
*/
|
|
372
421
|
onSuccess(__cb) {
|
|
373
|
-
return new DetailedFailure(this.
|
|
422
|
+
return new DetailedFailure(this._message, this._detail);
|
|
374
423
|
}
|
|
375
424
|
/**
|
|
376
425
|
* Invokes the supplied {@link DetailedFailureContinuation | failure callback} and propagates
|
|
@@ -379,13 +428,25 @@ class DetailedFailure extends Failure {
|
|
|
379
428
|
* @returns The {@link DetailedResult | DetailedResult<T, TD>} returned by the failure callback.
|
|
380
429
|
*/
|
|
381
430
|
onFailure(cb) {
|
|
382
|
-
return cb(this.
|
|
431
|
+
return cb(this._message, this._detail);
|
|
383
432
|
}
|
|
384
433
|
/**
|
|
385
434
|
* {@inheritdoc IResult.withErrorFormat}
|
|
386
435
|
*/
|
|
387
436
|
withErrorFormat(cb) {
|
|
388
|
-
return failWithDetail(cb(this.
|
|
437
|
+
return failWithDetail(cb(this._message, this._detail), this._detail);
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Creates a {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error message
|
|
441
|
+
* and optional detail.
|
|
442
|
+
* @param message - The error message to be returned.
|
|
443
|
+
* @param detail - The error detail to be returned.
|
|
444
|
+
* @returns The resulting {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied
|
|
445
|
+
* error message and detail.
|
|
446
|
+
* @public
|
|
447
|
+
*/
|
|
448
|
+
static with(message, detail) {
|
|
449
|
+
return new DetailedFailure(message, detail);
|
|
389
450
|
}
|
|
390
451
|
}
|
|
391
452
|
exports.DetailedFailure = DetailedFailure;
|
|
@@ -396,22 +457,43 @@ exports.DetailedFailure = DetailedFailure;
|
|
|
396
457
|
* @param detail - An optional detail of type `<TD>` to be returned.
|
|
397
458
|
* @returns A {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value
|
|
398
459
|
* and detail, if supplied.
|
|
460
|
+
* @remarks
|
|
461
|
+
* The `succeedsWithDetail` alias was added in release 5.0 for
|
|
462
|
+
* naming consistency with {@link fails | fails}, which was added to avoid conflicts
|
|
463
|
+
* with test frameworks and libraries.
|
|
399
464
|
* @public
|
|
400
465
|
*/
|
|
401
466
|
function succeedWithDetail(value, detail) {
|
|
402
467
|
return new DetailedSuccess(value, detail);
|
|
403
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* {@inheritdoc succeedWithDetail}
|
|
471
|
+
* @public
|
|
472
|
+
*/
|
|
473
|
+
function succeedsWithDetail(value, detail) {
|
|
474
|
+
return new DetailedSuccess(value, detail);
|
|
475
|
+
}
|
|
404
476
|
/**
|
|
405
477
|
* Returns {@link DetailedFailure | DetailedFailure<T, TD>} with a supplied error message and detail.
|
|
406
478
|
* @param message - The error message to be returned.
|
|
407
479
|
* @param detail - The event detail to be returned.
|
|
408
480
|
* @returns An {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error
|
|
409
481
|
* message and detail.
|
|
482
|
+
* @remarks
|
|
483
|
+
* The `failsWithDetail` alias was added in release 5.0 for naming consistency
|
|
484
|
+
* with {@link fails | fails}, which was added to avoid conflicts with test frameworks and libraries.
|
|
410
485
|
* @public
|
|
411
486
|
*/
|
|
412
487
|
function failWithDetail(message, detail) {
|
|
413
488
|
return new DetailedFailure(message, detail);
|
|
414
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* {@inheritdoc failWithDetail}
|
|
492
|
+
* @public
|
|
493
|
+
*/
|
|
494
|
+
function failsWithDetail(message, detail) {
|
|
495
|
+
return new DetailedFailure(message, detail);
|
|
496
|
+
}
|
|
415
497
|
/**
|
|
416
498
|
* Propagates a {@link Success} or {@link Failure} {@link Result}, adding supplied
|
|
417
499
|
* event details as appropriate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/packlets/base/result.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAwhBH,0BAEC;AAOD,oBAEC;AA6LD,8CAEC;AAUD,wCAEC;AAaD,kDAQC;AAWD,sCAMC;AAhhBD;;;;GAIG;AACH,MAAa,OAAO;IAgBlB;;;OAGG;IACH,YAAmB,KAAQ;QAnB3B;;WAEG;QACa,YAAO,GAAS,IAAI,CAAC;QAErC;;WAEG;QACa,YAAO,GAAc,SAAS,CAAC;QAY7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,SAAS;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,SAAS;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,QAAwB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAUM,SAAS,CAAC,IAAQ;;QACvB,OAAO,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,QAAwB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,IAAQ;;QAC/B,OAAO,MAAA,IAAI,CAAC,MAAM,mCAAI,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taining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable no-use-before-define */\n/**\n * Represents the {@link IResult | result} of some operation or sequence of operations.\n * @remarks\n * {@link Success | Success<T>} and {@link Failure | Failure<T>} share the common\n * contract {@link IResult}, enabling commingled discriminated usage.\n * @public\n */\nexport type Result<T> = Success<T> | Failure<T>;\n/**\n * Continuation callback to be called in the event that an\n * {@link Result} is successful.\n * @public\n */\nexport type SuccessContinuation<T, TN> = (value: T) => Result<TN>;\n\n/**\n * Continuation callback to be called in the event that an\n * {@link Result} fails.\n * @public\n */\nexport type FailureContinuation<T> = (message: string) => Result<T>;\n\n/**\n * Type inference to determine the result type of an {@link Result}.\n * @beta\n */\nexport type ResultValueType<T> = T extends Result<infer TV> ? TV : never;\n\n/**\n * Formats an error message.\n * @param message - The error message to be formatted.\n * @param detail - An optional detail to be included in the formatted message.\n * @public\n */\nexport type ErrorFormatter<TD = unknown> = (message: string, detail?: TD) => string;\n\n/**\n * Simple logger interface used by {@link IResult.orThrow}.\n * @public\n */\nexport interface IResultLogger {\n /**\n * Log an error message.\n * @param message - The message to be logged.\n */\n error(message: string): void;\n}\n\n/**\n * Simple error aggregator to simplify collecting all errors in\n * a flow.\n * @public\n */\nexport interface IMessageAggregator {\n /**\n * Indicates whether any messages have been aggregated.\n */\n readonly hasMessages: boolean;\n\n /**\n * The number of messages aggregated.\n */\n readonly numMessages: number;\n\n /**\n * The aggregated messages.\n */\n readonly messages: ReadonlyArray<string>;\n\n /**\n * Adds a message to the aggregator, if defined.\n * @param message - The message to add - pass `undefined`\n * or the empty string to continue without adding a message.\n */\n addMessage(message: string | undefined): this;\n\n /**\n * Adds multiple messages to the aggregator.\n * @param messages - the messages to add.\n */\n addMessages(messages: string[] | undefined): this;\n\n /**\n * Returns all messages as a single string joined\n * using the optionally-supplied `separator`, or\n * newline if no separator is specified.\n * @param separator - The optional separator used\n * to join strings.\n */\n toString(separator?: string): string;\n}\n\n/**\n * Represents the result of some operation of sequence of operations.\n * @remarks\n * This common contract enables commingled discriminated usage of {@link Success | Success<T>}\n * and {@link Failure | Failure<T>}.\n * @public\n */\nexport interface IResult<T> {\n /**\n * Indicates whether the operation was successful.\n */\n readonly success: boolean;\n\n /**\n * Value returned by a successful operation, undefined\n * for a failed operation.\n */\n readonly value: T | undefined;\n\n /**\n * Error message returned by a failed operation, undefined\n * for a successful operation.\n */\n readonly message: string | undefined;\n\n /**\n * Indicates whether this operation was successful. Functions\n * as a type guard for {@link Success | Success<T>}.\n */\n isSuccess(): this is Success<T>;\n\n /**\n * Indicates whether this operation failed. Functions\n * as a type guard for {@link Failure | Failure<T>}.\n */\n isFailure(): this is Failure<T>;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or throws the error message if the corresponding operation failed.\n *\n * Note that `getValueOrThrow` is being superseded by `orThrow` and\n * will eventually be deprecated. Please use orDefault instead.\n *\n * @param logger - An optional {@link IResultLogger | logger} to which the\n * error will also be reported.\n * @returns The return value, if the operation was successful.\n * @throws The error message if the operation failed.\n * @deprecated Use {@link IResult.orThrow | orThrow} instead.\n */\n getValueOrThrow(logger?: IResultLogger): T;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or a default value if the corresponding operation failed.\n * @param dflt - The value to be returned if the operation failed (default is\n * `undefined`).\n *\n * Note that `getValueOrDefault` is being superseded by `orDefault` and\n * will eventually be deprecated. Please use orDefault instead.\n *\n * @returns The return value, if the operation was successful. Returns\n * the supplied default value or `undefined` if no default is supplied.\n * @deprecated Use {@link IResult.(orDefault:1) | orDefault(T)} or {@link IResult.(orDefault:2) | orDefault()} instead.\n */\n getValueOrDefault(dflt?: T): T | undefined;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or throws the error message if the corresponding operation failed.\n * @param logger - An optional {@link IResultLogger | logger} to which the\n * error will also be reported.\n * @returns The return value, if the operation was successful.\n * @throws The error message if the operation failed.\n */\n orThrow(logger?: IResultLogger): T;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or a default value if the corresponding operation failed.\n * @param dflt - The value to be returned if the operation failed.\n * @returns The return value, if the operation was successful. Returns\n * the supplied default if an error occurred.\n * {@label SUPPLIED}\n */\n orDefault(dflt: T): T;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or a default value if the corresponding operation failed.\n * @returns The return value, if the operation was successful, or\n * `undefined` if an error occurs.\n * {@label MISSING}\n */\n orDefault(): T | undefined;\n\n /**\n * Calls a supplied {@link SuccessContinuation | success continuation} if\n * the operation was a success.\n * @remarks\n * The {@link SuccessContinuation | success continuation} might return a\n * different result type than {@link IResult} on which it is invoked. This\n * enables chaining of operations with heterogenous return types.\n *\n * @param cb - The {@link SuccessContinuation | success continuation} to\n * be called in the event of success.\n * @returns If this operation was successful, returns the value returned\n * by the {@link SuccessContinuation | success continuation}. If this result\n * failed, propagates the error message from this failure.\n */\n onSuccess<TN>(cb: SuccessContinuation<T, TN>): Result<TN>;\n\n /**\n * Calls a supplied {@link FailureContinuation | failed continuation} if\n * the operation failed.\n * @param cb - The {@link FailureContinuation | failure continuation} to\n * be called in the event of failure.\n * @returns If this operation failed, returns the value returned by the\n * {@link FailureContinuation | failure continuation}. If this result\n * was successful, propagates the result value from the successful event.\n */\n onFailure(cb: FailureContinuation<T>): Result<T>;\n\n /**\n * Calls a supplied {@link ErrorFormatter | error formatter} if\n * the operation failed.\n * @param cb - The {@link ErrorFormatter | error formatter} to\n * be called in the event of failure.\n * @returns If this operation failed, returns the returns {@link Failure | Failure}\n * with the message returned by the formatter. If this result\n * was successful, propagates the result value from the successful event.\n */\n withErrorFormat(cb: ErrorFormatter): Result<T>;\n\n /**\n * Converts a {@link IResult | IResult<T>} to a {@link DetailedResult | DetailedResult<T, TD>},\n * adding a supplied detail if the operation failed.\n * @param detail - The detail to be added if this operation failed.\n * @returns A new {@link DetailedResult | DetailedResult<T, TD>} with either\n * the success result or the error message from this {@link IResult}, with\n * the supplied detail (if this event failed) or detail `undefined` (if\n * this result succeeded).\n */\n withFailureDetail<TD>(detail: TD): DetailedResult<T, TD>;\n\n /**\n * Converts a {@link IResult | IResult<T>} to a {@link DetailedResult | DetailedResult<T, TD>},\n * adding supplied details.\n * @param detail - The default detail to be added to the new {@link DetailedResult}.\n * @param successDetail - An optional detail to be added if this result was successful.\n * @returns A new {@link DetailedResult | DetailedResult<T, TD>} with either\n * the success result or the error message from this {@link IResult} and the\n * appropriate added detail.\n */\n withDetail<TD>(detail: TD, successDetail?: TD): DetailedResult<T, TD>;\n\n /**\n * Propagates interior result, appending any error message to the\n * supplied errors array.\n * @param errors - {@link IMessageAggregator | Error aggregator} in which\n * errors will be aggregated.\n */\n aggregateError(errors: IMessageAggregator): this;\n}\n\n/**\n * Reports a successful {@link IResult | result} from some operation and the\n * corresponding value.\n * @public\n */\nexport class Success<T> implements IResult<T> {\n /**\n * {@inheritdoc IResult.success}\n */\n public readonly success: true = true;\n\n /**\n * For a successful operation, the error message is always `undefined`.\n */\n public readonly message: undefined = undefined;\n\n /**\n * @internal\n */\n private readonly _value: T;\n\n /**\n * Constructs a {@link Success} with the supplied value.\n * @param value - The value to be returned.\n */\n public constructor(value: T) {\n this._value = value;\n }\n\n /**\n * The result value returned by the successful operation.\n */\n public get value(): T {\n return this._value;\n }\n\n /**\n * {@inheritdoc IResult.isSuccess}\n */\n public isSuccess(): this is Success<T> {\n return true;\n }\n\n /**\n * {@inheritdoc IResult.isFailure}\n */\n public isFailure(): this is Failure<T> {\n return false;\n }\n\n /**\n * {@inheritdoc IResult.orThrow}\n */\n public orThrow(__logger?: IResultLogger): T {\n return this._value;\n }\n\n /**\n * {@inheritdoc IResult.(orDefault:1)}\n */\n public orDefault(dflt: T): T;\n /**\n * {@inheritdoc IResult.(orDefault:2)}\n */\n public orDefault(): T | undefined;\n public orDefault(dflt?: T): T | undefined {\n return this._value ?? dflt;\n }\n\n /**\n * {@inheritdoc IResult.getValueOrThrow}\n * @deprecated Use {@link Success.orThrow | orThrow} instead.\n */\n public getValueOrThrow(__logger?: IResultLogger): T {\n return this._value;\n }\n\n /**\n * {@inheritdoc IResult.getValueOrDefault}\n * @deprecated Use {@link Success.(orDefault:1) | orDefault(T)} or {@link Success.(orDefault:2) | orDefault()} instead.\n */\n public getValueOrDefault(dflt?: T): T | undefined {\n return this._value ?? dflt;\n }\n\n /**\n * {@inheritdoc IResult.onSuccess}\n */\n public onSuccess<TN>(cb: SuccessContinuation<T, TN>): Result<TN> {\n return cb(this.value);\n }\n\n /**\n * {@inheritdoc IResult.onFailure}\n */\n public onFailure(__: FailureContinuation<T>): Result<T> {\n return this;\n }\n\n /**\n * {@inheritdoc IResult.withErrorFormat}\n */\n public withErrorFormat(__cb: ErrorFormatter): Result<T> {\n return this;\n }\n\n /**\n * {@inheritdoc IResult.withFailureDetail}\n */\n public withFailureDetail<TD>(__detail: TD): DetailedResult<T, TD> {\n return succeedWithDetail(this.value);\n }\n\n /**\n * {@inheritdoc IResult.withDetail}\n */\n public withDetail<TD>(detail: TD, successDetail?: TD): DetailedResult<T, TD> {\n return succeedWithDetail(this.value, successDetail ?? detail);\n }\n\n /**\n * {@inheritdoc IResult.aggregateError}\n */\n public aggregateError(errors: IMessageAggregator): this {\n return this;\n }\n}\n\n/**\n * Reports a failed {@link IResult | result} from some operation, with an error message.\n * @public\n */\nexport class Failure<T> implements IResult<T> {\n /**\n * {@inheritdoc IResult.success}\n */\n public readonly success: false = false;\n /**\n * Failed operation always returns undefined for value.\n */\n public readonly value: undefined = undefined;\n\n /**\n * @internal\n */\n private readonly _message: string;\n\n /**\n * Constructs a {@link Failure} with the supplied message.\n * @param message - Error message to be reported.\n */\n public constructor(message: string) {\n this._message = message;\n }\n\n /**\n * Gets the error message associated with this error.\n */\n public get message(): string {\n return this._message;\n }\n\n /**\n * {@inheritdoc IResult.isSuccess}\n */\n public isSuccess(): this is Success<T> {\n return false;\n }\n\n /**\n * {@inheritdoc IResult.isFailure}\n */\n public isFailure(): this is Failure<T> {\n return true;\n }\n\n /**\n * {@inheritdoc IResult.orThrow}\n */\n public orThrow(logger?: IResultLogger): never {\n if (logger !== undefined) {\n logger.error(this._message);\n }\n throw new Error(this._message);\n }\n\n /**\n * {@inheritdoc IResult.(orDefault:1)}\n */\n public orDefault(dflt: T): T;\n /**\n * {@inheritdoc IResult.(orDefault:2)}\n */\n public orDefault(): T | undefined;\n public orDefault(dflt?: T): T | undefined {\n return dflt;\n }\n\n /**\n * {@inheritdoc IResult.getValueOrThrow}\n * @deprecated Use {@link Failure.orThrow | orThrow} instead.\n */\n public getValueOrThrow(logger?: IResultLogger): never {\n if (logger !== undefined) {\n logger.error(this._message);\n }\n throw new Error(this._message);\n }\n\n /**\n * {@inheritdoc IResult.getValueOrDefault}\n * @deprecated Use {@link Failure.(orDefault:1) | orDefault(T)} or {@link Failure.(orDefault:2) | orDefault()} instead.\n */\n public getValueOrDefault(dflt?: T): T | undefined {\n return dflt;\n }\n\n /**\n * {@inheritdoc IResult.onSuccess}\n */\n public onSuccess<TN>(__: SuccessContinuation<T, TN>): Result<TN> {\n return new Failure(this.message);\n }\n\n /**\n * {@inheritdoc IResult.onFailure}\n */\n public onFailure(cb: FailureContinuation<T>): Result<T> {\n return cb(this.message);\n }\n\n /**\n * {@inheritdoc IResult.withErrorFormat}\n */\n public withErrorFormat(cb: ErrorFormatter): Result<T> {\n return fail(cb(this.message));\n }\n\n /**\n * {@inheritdoc IResult.withFailureDetail}\n */\n public withFailureDetail<TD>(detail: TD): DetailedResult<T, TD> {\n return failWithDetail(this.message, detail);\n }\n\n /**\n * {@inheritdoc IResult.withDetail}\n */\n public withDetail<TD>(detail: TD, __successDetail?: TD): DetailedResult<T, TD> {\n return failWithDetail(this.message, detail);\n }\n\n /**\n * {@inheritdoc IResult.aggregateError}\n */\n public aggregateError(errors: IMessageAggregator): this {\n errors.addMessage(this.message);\n return this;\n }\n\n /**\n * Get a 'friendly' string representation of this object.\n * @remarks\n * The string representation of a {@link Failure} value is the error message.\n * @returns A string representing this object.\n */\n public toString(): string {\n return this.message;\n }\n}\n\n/**\n * Returns {@link Success | Success<T>} with the supplied result value.\n * @param value - The successful result value to be returned\n * @public\n */\nexport function succeed<T>(value: T): Success<T> {\n return new Success<T>(value);\n}\n\n/**\n * Returns {@link Failure | Failure<T>} with the supplied error message.\n * @param message - Error message to be returned.\n * @public\n */\nexport function fail<T>(message: string): Failure<T> {\n return new Failure<T>(message);\n}\n\n/**\n * Callback to be called when a {@link DetailedResult} encounters success.\n * @remarks\n * A success callback can return a different result type than it receives, allowing\n * success results to chain through intermediate result types.\n * @public\n */\nexport type DetailedSuccessContinuation<T, TD, TN> = (value: T, detail?: TD) => DetailedResult<TN, TD>;\n\n/**\n * Callback to be called when a {@link DetailedResult} encounters a failure.\n * @remarks\n * A failure callback can change {@link Failure} to {@link Success} (e.g. by returning a default value)\n * or it can change or embellish the error message, but it cannot change the success return type.\n * @public\n */\nexport type DetailedFailureContinuation<T, TD> = (message: string, detail: TD) => DetailedResult<T, TD>;\n\n/**\n * A {@link DetailedSuccess} extends {@link Success} to report optional success details in\n * addition to the error message.\n * @public\n */\nexport class DetailedSuccess<T, TD> extends Success<T> {\n /**\n * @internal\n */\n protected _detail?: TD;\n\n /**\n * Constructs a new {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied\n * value and detail.\n * @param value - The value to be returned.\n * @param detail - An optional successful detail to be returned. If omitted, detail\n * will be `undefined`.\n */\n public constructor(value: T, detail?: TD) {\n super(value);\n this._detail = detail;\n }\n\n /**\n * The success detail associated with this {@link DetailedSuccess}, or `undefined` if\n * no detail was supplied.\n */\n public get detail(): TD | undefined {\n return this._detail;\n }\n\n /**\n * Reports that this {@link DetailedSuccess} is a success.\n * @remarks\n * Always true for {@link DetailedSuccess} but can be used as type guard\n * to discriminate {@link DetailedSuccess} from {@link DetailedFailure} in\n * a {@link DetailedResult}.\n * @returns `true`\n */\n public isSuccess(): this is DetailedSuccess<T, TD> {\n return true;\n }\n\n /**\n * Invokes the supplied {@link DetailedSuccessContinuation | success callback} and propagates\n * its returned {@link DetailedResult | DetailedResult<TN, TD>}.\n * @remarks\n * The success callback mutates the return type from `<T>` to `<TN>`.\n * @param cb - The {@link DetailedSuccessContinuation | success callback} to be invoked.\n * @returns The {@link DetailedResult | DetailedResult<T, TD>} returned by the success callback.\n */\n public onSuccess<TN>(cb: DetailedSuccessContinuation<T, TD, TN>): DetailedResult<TN, TD> {\n return cb(this.value, this._detail);\n }\n\n /**\n * Propagates this {@link DetailedSuccess}.\n * @remarks\n * Failure does not mutate return type so we can return this event directly.\n * @param _cb - {@link DetailedFailureContinuation | Failure callback} to be called\n * on a {@link DetailedResult} in case of failure (ignored).\n * @returns `this`\n */\n public onFailure(__cb: DetailedFailureContinuation<T, TD>): DetailedResult<T, TD> {\n return this;\n }\n\n /**\n * {@inheritdoc Success.withErrorFormat}\n */\n public withErrorFormat(cb: ErrorFormatter): DetailedResult<T, TD> {\n return this;\n }\n}\n\n/**\n * A {@link DetailedFailure} extends {@link Failure} to report optional failure details in\n * addition to the error message.\n * @public\n */\nexport class DetailedFailure<T, TD> extends Failure<T> {\n /**\n * @internal\n */\n protected _detail: TD;\n\n /**\n * Constructs a new {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied\n * message and detail.\n * @param message - The message to be returned.\n * @param detail - The error detail to be returned.\n */\n public constructor(message: string, detail: TD) {\n super(message);\n this._detail = detail;\n }\n\n /**\n * The error detail associated with this {@link DetailedFailure}.\n */\n public get detail(): TD {\n return this._detail;\n }\n\n /**\n * Reports that this {@link DetailedFailure} is a failure.\n * @remarks\n * Always true for {@link DetailedFailure} but can be used as type guard\n * to discriminate {@link DetailedSuccess} from {@link DetailedFailure} in\n * a {@link DetailedResult}.\n * @returns `true`\n */\n public isFailure(): this is DetailedFailure<T, TD> {\n return true;\n }\n\n /**\n * Propagates the error message and detail from this result.\n * @remarks\n * Mutates the success type as the success callback would have, but does not\n * call the success callback.\n * @param _cb - {@link DetailedSuccessContinuation | Success callback} to be called\n * on a {@link DetailedResult} in case of success (ignored).\n * @returns A new {@link DetailedFailure | DetailedFailure<TN, TD>} which contains\n * the error message and detail from this one.\n */\n public onSuccess<TN>(__cb: DetailedSuccessContinuation<T, TD, TN>): DetailedResult<TN, TD> {\n return new DetailedFailure<TN, TD>(this.message, this._detail);\n }\n\n /**\n * Invokes the supplied {@link DetailedFailureContinuation | failure callback} and propagates\n * its returned {@link DetailedResult | DetailedResult<T, TD>}.\n * @param cb - The {@link DetailedFailureContinuation | failure callback} to be invoked.\n * @returns The {@link DetailedResult | DetailedResult<T, TD>} returned by the failure callback.\n */\n public onFailure(cb: DetailedFailureContinuation<T, TD>): DetailedResult<T, TD> {\n return cb(this.message, this._detail);\n }\n\n /**\n * {@inheritdoc IResult.withErrorFormat}\n */\n public withErrorFormat(cb: ErrorFormatter<TD>): DetailedResult<T, TD> {\n return failWithDetail(cb(this.message, this._detail), this._detail);\n }\n}\n\n/**\n * Type inference to determine the result type `T` of a {@link DetailedResult | DetailedResult<T, TD>}.\n * @beta\n */\nexport type DetailedResult<T, TD> = DetailedSuccess<T, TD> | DetailedFailure<T, TD>;\n\n/**\n * Type inference to determine the detail type `TD` of a {@link DetailedResult | DetailedResult<T, TD>}.\n * @beta\n */\nexport type ResultDetailType<T> = T extends DetailedResult<unknown, infer TD> ? TD : never;\n\n/**\n * Returns {@link DetailedSuccess | DetailedSuccess<T, TD>} with a supplied value and optional\n * detail.\n * @param value - The value of type `<T>` to be returned.\n * @param detail - An optional detail of type `<TD>` to be returned.\n * @returns A {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value\n * and detail, if supplied.\n * @public\n */\nexport function succeedWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD> {\n return new DetailedSuccess<T, TD>(value, detail);\n}\n\n/**\n * Returns {@link DetailedFailure | DetailedFailure<T, TD>} with a supplied error message and detail.\n * @param message - The error message to be returned.\n * @param detail - The event detail to be returned.\n * @returns An {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error\n * message and detail.\n * @public\n */\nexport function failWithDetail<T, TD>(message: string, detail: TD): DetailedFailure<T, TD> {\n return new DetailedFailure<T, TD>(message, detail);\n}\n\n/**\n * Propagates a {@link Success} or {@link Failure} {@link Result}, adding supplied\n * event details as appropriate.\n * @param result - The {@link Result} to be propagated.\n * @param detail - The event detail (type `<TD>`) to be added to the {@link Result | result}.\n * @param successDetail - An optional distinct event detail to be added to {@link Success} results. If `successDetail`\n * is omitted or `undefined`, then `detail` will be applied to {@link Success} results.\n * @returns A new {@link DetailedResult | DetailedResult<T, TD>} with the success value or error\n * message from the original `result` but with the specified detail added.\n * @public\n */\nexport function propagateWithDetail<T, TD>(\n result: Result<T>,\n detail: TD,\n successDetail?: TD\n): DetailedResult<T, TD> {\n return result.isSuccess()\n ? succeedWithDetail(result.value, successDetail ?? detail)\n : failWithDetail(result.message, detail);\n}\n\n/**\n * Wraps a function which might throw to convert exception results\n * to {@link Failure}.\n * @param func - The function to be captured.\n * @returns Returns {@link Success} with a value of type `<T>` on\n * success , or {@link Failure} with the thrown error message if\n * `func` throws an `Error`.\n * @public\n */\nexport function captureResult<T>(func: () => T): Result<T> {\n try {\n return succeed(func());\n } catch (err) {\n return fail((err as Error).message);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/packlets/base/result.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA+iBH,0BAEC;AAMD,4BAEC;AAUD,oBAEC;AAMD,sBAEC;AAuND,8CAEC;AAMD,gDAEC;AAaD,wCAEC;AAMD,0CAEC;AAaD,kDAQC;AAWD,sCAMC;AAvmBD;;;;GAIG;AACH,MAAa,OAAO;IAgBlB;;;OAGG;IACH,YAAmB,KAAQ;QAnB3B;;WAEG;QACa,YAAO,GAAS,IAAI,CAAC;QAErC;;WAEG;QACa,YAAO,GAAc,SAAS,CAAC;QAY7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,SAAS;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,SAAS;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,QAAwB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAUM,SAAS,CAAC,IAAQ;;QACvB,OAAO,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,QAAwB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,IAAQ;;QAC/B,OAAO,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,SAAS,CAAK,EAA8B;QACjD,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,SAAS,CAAC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H,SAAgB,cAAc,CAAQ,OAAe,EAAE,MAAW;IAChE,OAAO,IAAI,eAAe,CAAQ,OAAO,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAAQ,OAAe,EAAE,MAAW;IACjE,OAAO,IAAI,eAAe,CAAQ,OAAO,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CACjC,MAAiB,EACjB,MAAU,EACV,aAAkB;IAElB,OAAO,MAAM,CAAC,SAAS,EAAE;QACvB,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,MAAM,CAAC;QAC1D,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAAI,IAAa;IAC5C,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,IAAI,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable no-use-before-define */\n/**\n * Represents the {@link IResult | result} of some operation or sequence of operations.\n * @remarks\n * {@link Success | Success<T>} and {@link Failure | Failure<T>} share the common\n * contract {@link IResult}, enabling commingled discriminated usage.\n * @public\n */\nexport type Result<T> = Success<T> | Failure<T>;\n/**\n * Continuation callback to be called in the event that an\n * {@link Result} is successful.\n * @public\n */\nexport type SuccessContinuation<T, TN> = (value: T) => Result<TN>;\n\n/**\n * Continuation callback to be called in the event that an\n * {@link Result} fails.\n * @public\n */\nexport type FailureContinuation<T> = (message: string) => Result<T>;\n\n/**\n * Type inference to determine the result type of an {@link Result}.\n * @beta\n */\nexport type ResultValueType<T> = T extends Result<infer TV> ? TV : never;\n\n/**\n * Formats an error message.\n * @param message - The error message to be formatted.\n * @param detail - An optional detail to be included in the formatted message.\n * @public\n */\nexport type ErrorFormatter<TD = unknown> = (message: string, detail?: TD) => string;\n\n/**\n * Simple logger interface used by {@link IResult.orThrow}.\n * @public\n */\nexport interface IResultLogger {\n /**\n * Log an error message.\n * @param message - The message to be logged.\n */\n error(message: string): void;\n}\n\n/**\n * Simple error aggregator to simplify collecting all errors in\n * a flow.\n * @public\n */\nexport interface IMessageAggregator {\n /**\n * Indicates whether any messages have been aggregated.\n */\n readonly hasMessages: boolean;\n\n /**\n * The number of messages aggregated.\n */\n readonly numMessages: number;\n\n /**\n * The aggregated messages.\n */\n readonly messages: ReadonlyArray<string>;\n\n /**\n * Adds a message to the aggregator, if defined.\n * @param message - The message to add - pass `undefined`\n * or the empty string to continue without adding a message.\n */\n addMessage(message: string | undefined): this;\n\n /**\n * Adds multiple messages to the aggregator.\n * @param messages - the messages to add.\n */\n addMessages(messages: string[] | undefined): this;\n\n /**\n * Returns all messages as a single string joined\n * using the optionally-supplied `separator`, or\n * newline if no separator is specified.\n * @param separator - The optional separator used\n * to join strings.\n */\n toString(separator?: string): string;\n}\n\n/**\n * Represents the result of some operation of sequence of operations.\n * @remarks\n * This common contract enables commingled discriminated usage of {@link Success | Success<T>}\n * and {@link Failure | Failure<T>}.\n * @public\n */\nexport interface IResult<T> {\n /**\n * Indicates whether the operation was successful.\n */\n readonly success: boolean;\n\n /**\n * Value returned by a successful operation, undefined\n * for a failed operation.\n */\n readonly value: T | undefined;\n\n /**\n * Error message returned by a failed operation, undefined\n * for a successful operation.\n */\n readonly message: string | undefined;\n\n /**\n * Indicates whether this operation was successful. Functions\n * as a type guard for {@link Success | Success<T>}.\n */\n isSuccess(): this is Success<T>;\n\n /**\n * Indicates whether this operation failed. Functions\n * as a type guard for {@link Failure | Failure<T>}.\n */\n isFailure(): this is Failure<T>;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or throws the error message if the corresponding operation failed.\n *\n * Note that `getValueOrThrow` is being superseded by `orThrow` and\n * will eventually be deprecated. Please use orDefault instead.\n *\n * @param logger - An optional {@link IResultLogger | logger} to which the\n * error will also be reported.\n * @returns The return value, if the operation was successful.\n * @throws The error message if the operation failed.\n * @deprecated Use {@link IResult.orThrow | orThrow} instead.\n */\n getValueOrThrow(logger?: IResultLogger): T;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or a default value if the corresponding operation failed.\n * @param dflt - The value to be returned if the operation failed (default is\n * `undefined`).\n *\n * Note that `getValueOrDefault` is being superseded by `orDefault` and\n * will eventually be deprecated. Please use orDefault instead.\n *\n * @returns The return value, if the operation was successful. Returns\n * the supplied default value or `undefined` if no default is supplied.\n * @deprecated Use {@link IResult.(orDefault:1) | orDefault(T)} or {@link IResult.(orDefault:2) | orDefault()} instead.\n */\n getValueOrDefault(dflt?: T): T | undefined;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or throws the error message if the corresponding operation failed.\n * @param logger - An optional {@link IResultLogger | logger} to which the\n * error will also be reported.\n * @returns The return value, if the operation was successful.\n * @throws The error message if the operation failed.\n */\n orThrow(logger?: IResultLogger): T;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or a default value if the corresponding operation failed.\n * @param dflt - The value to be returned if the operation failed.\n * @returns The return value, if the operation was successful. Returns\n * the supplied default if an error occurred.\n * {@label SUPPLIED}\n */\n orDefault(dflt: T): T;\n\n /**\n * Gets the value associated with a successful {@link IResult | result},\n * or a default value if the corresponding operation failed.\n * @returns The return value, if the operation was successful, or\n * `undefined` if an error occurs.\n * {@label MISSING}\n */\n orDefault(): T | undefined;\n\n /**\n * Calls a supplied {@link SuccessContinuation | success continuation} if\n * the operation was a success.\n * @remarks\n * The {@link SuccessContinuation | success continuation} might return a\n * different result type than {@link IResult} on which it is invoked. This\n * enables chaining of operations with heterogenous return types.\n *\n * @param cb - The {@link SuccessContinuation | success continuation} to\n * be called in the event of success.\n * @returns If this operation was successful, returns the value returned\n * by the {@link SuccessContinuation | success continuation}. If this result\n * failed, propagates the error message from this failure.\n */\n onSuccess<TN>(cb: SuccessContinuation<T, TN>): Result<TN>;\n\n /**\n * Calls a supplied {@link FailureContinuation | failed continuation} if\n * the operation failed.\n * @param cb - The {@link FailureContinuation | failure continuation} to\n * be called in the event of failure.\n * @returns If this operation failed, returns the value returned by the\n * {@link FailureContinuation | failure continuation}. If this result\n * was successful, propagates the result value from the successful event.\n */\n onFailure(cb: FailureContinuation<T>): Result<T>;\n\n /**\n * Calls a supplied {@link ErrorFormatter | error formatter} if\n * the operation failed.\n * @param cb - The {@link ErrorFormatter | error formatter} to\n * be called in the event of failure.\n * @returns If this operation failed, returns the returns {@link Failure | Failure}\n * with the message returned by the formatter. If this result\n * was successful, propagates the result value from the successful event.\n */\n withErrorFormat(cb: ErrorFormatter): Result<T>;\n\n /**\n * Converts a {@link IResult | IResult<T>} to a {@link DetailedResult | DetailedResult<T, TD>},\n * adding a supplied detail if the operation failed.\n * @param detail - The detail to be added if this operation failed.\n * @returns A new {@link DetailedResult | DetailedResult<T, TD>} with either\n * the success result or the error message from this {@link IResult}, with\n * the supplied detail (if this event failed) or detail `undefined` (if\n * this result succeeded).\n */\n withFailureDetail<TD>(detail: TD): DetailedResult<T, TD>;\n\n /**\n * Converts a {@link IResult | IResult<T>} to a {@link DetailedResult | DetailedResult<T, TD>},\n * adding supplied details.\n * @param detail - The default detail to be added to the new {@link DetailedResult}.\n * @param successDetail - An optional detail to be added if this result was successful.\n * @returns A new {@link DetailedResult | DetailedResult<T, TD>} with either\n * the success result or the error message from this {@link IResult} and the\n * appropriate added detail.\n */\n withDetail<TD>(detail: TD, successDetail?: TD): DetailedResult<T, TD>;\n\n /**\n * Propagates interior result, appending any error message to the\n * supplied errors array.\n * @param errors - {@link IMessageAggregator | Error aggregator} in which\n * errors will be aggregated.\n */\n aggregateError(errors: IMessageAggregator): this;\n}\n\n/**\n * Reports a successful {@link IResult | result} from some operation and the\n * corresponding value.\n * @public\n */\nexport class Success<T> implements IResult<T> {\n /**\n * {@inheritdoc IResult.success}\n */\n public readonly success: true = true;\n\n /**\n * For a successful operation, the error message is always `undefined`.\n */\n public readonly message: undefined = undefined;\n\n /**\n * @internal\n */\n protected readonly _value: T;\n\n /**\n * Constructs a {@link Success} with the supplied value.\n * @param value - The value to be returned.\n */\n public constructor(value: T) {\n this._value = value;\n }\n\n /**\n * The result value returned by the successful operation.\n */\n public get value(): T {\n return this._value;\n }\n\n /**\n * {@inheritdoc IResult.isSuccess}\n */\n public isSuccess(): this is Success<T> {\n return true;\n }\n\n /**\n * {@inheritdoc IResult.isFailure}\n */\n public isFailure(): this is Failure<T> {\n return false;\n }\n\n /**\n * {@inheritdoc IResult.orThrow}\n */\n public orThrow(__logger?: IResultLogger): T {\n return this._value;\n }\n\n /**\n * {@inheritdoc IResult.(orDefault:1)}\n */\n public orDefault(dflt: T): T;\n /**\n * {@inheritdoc IResult.(orDefault:2)}\n */\n public orDefault(): T | undefined;\n public orDefault(dflt?: T): T | undefined {\n return this._value ?? dflt;\n }\n\n /**\n * {@inheritdoc IResult.getValueOrThrow}\n * @deprecated Use {@link Success.orThrow | orThrow} instead.\n */\n public getValueOrThrow(__logger?: IResultLogger): T {\n return this._value;\n }\n\n /**\n * {@inheritdoc IResult.getValueOrDefault}\n * @deprecated Use {@link Success.(orDefault:1) | orDefault(T)} or {@link Success.(orDefault:2) | orDefault()} instead.\n */\n public getValueOrDefault(dflt?: T): T | undefined {\n return this._value ?? dflt;\n }\n\n /**\n * {@inheritdoc IResult.onSuccess}\n */\n public onSuccess<TN>(cb: SuccessContinuation<T, TN>): Result<TN> {\n return cb(this._value);\n }\n\n /**\n * {@inheritdoc IResult.onFailure}\n */\n public onFailure(__: FailureContinuation<T>): Result<T> {\n return this;\n }\n\n /**\n * {@inheritdoc IResult.withErrorFormat}\n */\n public withErrorFormat(__cb: ErrorFormatter): Result<T> {\n return this;\n }\n\n /**\n * {@inheritdoc IResult.withFailureDetail}\n */\n public withFailureDetail<TD>(__detail: TD): DetailedResult<T, TD> {\n return succeedWithDetail(this._value);\n }\n\n /**\n * {@inheritdoc IResult.withDetail}\n */\n public withDetail<TD>(detail: TD, successDetail?: TD): DetailedResult<T, TD> {\n return succeedWithDetail(this._value, successDetail ?? detail);\n }\n\n /**\n * {@inheritdoc IResult.aggregateError}\n */\n public aggregateError(__errors: IMessageAggregator): this {\n return this;\n }\n\n /**\n * Creates a {@link Success | Success<T>} with the supplied value.\n * @param value - The value to be returned.\n * @returns The resulting {@link Success | Success<T>} with the supplied value.\n * @public\n */\n public static with<T>(value: T): Success<T> {\n return new Success<T>(value);\n }\n}\n\n/**\n * Reports a failed {@link IResult | result} from some operation, with an error message.\n * @public\n */\nexport class Failure<T> implements IResult<T> {\n /**\n * {@inheritdoc IResult.success}\n */\n public readonly success: false = false;\n /**\n * Failed operation always returns undefined for value.\n */\n public readonly value: undefined = undefined;\n\n /**\n * @internal\n */\n protected readonly _message: string;\n\n /**\n * Constructs a {@link Failure} with the supplied message.\n * @param message - Error message to be reported.\n */\n public constructor(message: string) {\n this._message = message;\n }\n\n /**\n * Gets the error message associated with this error.\n */\n public get message(): string {\n return this._message;\n }\n\n /**\n * {@inheritdoc IResult.isSuccess}\n */\n public isSuccess(): this is Success<T> {\n return false;\n }\n\n /**\n * {@inheritdoc IResult.isFailure}\n */\n public isFailure(): this is Failure<T> {\n return true;\n }\n\n /**\n * {@inheritdoc IResult.orThrow}\n */\n public orThrow(logger?: IResultLogger): never {\n if (logger !== undefined) {\n logger.error(this._message);\n }\n throw new Error(this._message);\n }\n\n /**\n * {@inheritdoc IResult.(orDefault:1)}\n */\n public orDefault(dflt: T): T;\n /**\n * {@inheritdoc IResult.(orDefault:2)}\n */\n public orDefault(): T | undefined;\n public orDefault(dflt?: T): T | undefined {\n return dflt;\n }\n\n /**\n * {@inheritdoc IResult.getValueOrThrow}\n * @deprecated Use {@link Failure.orThrow | orThrow} instead.\n */\n public getValueOrThrow(logger?: IResultLogger): never {\n if (logger !== undefined) {\n logger.error(this._message);\n }\n throw new Error(this._message);\n }\n\n /**\n * {@inheritdoc IResult.getValueOrDefault}\n * @deprecated Use {@link Failure.(orDefault:1) | orDefault(T)} or {@link Failure.(orDefault:2) | orDefault()} instead.\n */\n public getValueOrDefault(dflt?: T): T | undefined {\n return dflt;\n }\n\n /**\n * {@inheritdoc IResult.onSuccess}\n */\n public onSuccess<TN>(__: SuccessContinuation<T, TN>): Result<TN> {\n return new Failure(this._message);\n }\n\n /**\n * {@inheritdoc IResult.onFailure}\n */\n public onFailure(cb: FailureContinuation<T>): Result<T> {\n return cb(this._message);\n }\n\n /**\n * {@inheritdoc IResult.withErrorFormat}\n */\n public withErrorFormat(cb: ErrorFormatter): Result<T> {\n return fail(cb(this._message));\n }\n\n /**\n * {@inheritdoc IResult.withFailureDetail}\n */\n public withFailureDetail<TD>(detail: TD): DetailedResult<T, TD> {\n return failWithDetail(this._message, detail);\n }\n\n /**\n * {@inheritdoc IResult.withDetail}\n */\n public withDetail<TD>(detail: TD, __successDetail?: TD): DetailedResult<T, TD> {\n return failWithDetail(this._message, detail);\n }\n\n /**\n * {@inheritdoc IResult.aggregateError}\n */\n public aggregateError(errors: IMessageAggregator): this {\n errors.addMessage(this._message);\n return this;\n }\n\n /**\n * Get a 'friendly' string representation of this object.\n * @remarks\n * The string representation of a {@link Failure} value is the error message.\n * @returns A string representing this object.\n */\n public toString(): string {\n return this._message;\n }\n\n /**\n * Creates a {@link Failure | Failure<T>} with the supplied error message.\n * @param message - The error message to be returned.\n * @returns The resulting {@link Failure | Failure<T>} with the supplied error message.\n */\n public static with<T>(message: string): Failure<T> {\n return new Failure<T>(message);\n }\n}\n\n/**\n * Returns {@link Success | Success<T>} with the supplied result value.\n * @param value - The successful result value to be returned\n * @remarks\n * A `succeeds` alias was added in release 5.0 for\n * naming consistency with {@link fails | fails}, which was added\n * to avoid conflicts with test frameworks and libraries.\n * @public\n */\nexport function succeed<T>(value: T): Success<T> {\n return new Success<T>(value);\n}\n\n/**\n * {@inheritdoc succeed}\n * @public\n */\nexport function succeeds<T>(value: T): Success<T> {\n return new Success<T>(value);\n}\n\n/**\n * Returns {@link Failure | Failure<T>} with the supplied error message.\n * @param message - Error message to be returned.\n * @remarks\n * A `fails` alias was added in release 5.0 due to\n * issues with the name `fail` being used test frameworks and libraries.\n * @public\n */\nexport function fail<T>(message: string): Failure<T> {\n return new Failure<T>(message);\n}\n\n/**\n * {@inheritdoc fail}\n * @public\n */\nexport function fails<T>(message: string): Failure<T> {\n return new Failure<T>(message);\n}\n\n/**\n * Callback to be called when a {@link DetailedResult | DetailedResult} encounters success.\n * @remarks\n * A success callback can return a different result type than it receives, allowing\n * success results to chain through intermediate result types.\n * @public\n */\nexport type DetailedSuccessContinuation<T, TD, TN> = (value: T, detail?: TD) => DetailedResult<TN, TD>;\n\n/**\n * Callback to be called when a {@link DetailedResult | DetailedResult} encounters a failure.\n * @remarks\n * A failure callback can change {@link DetailedFailure | DetailedFailure<T, TD>} to\n * {@link DetailedSuccess | DetailedSuccess<T, TD>} (e.g. by returning a default value)\n * or it can change or embellish the error message, but it cannot change the success return type.\n * @public\n */\nexport type DetailedFailureContinuation<T, TD> = (message: string, detail?: TD) => DetailedResult<T, TD>;\n\n/**\n * A {@link DetailedSuccess | DetailedSuccess} extends {@link Success | Success} to report optional success\n * details in addition to the error message.\n * @public\n */\nexport class DetailedSuccess<T, TD> extends Success<T> {\n /**\n * @internal\n */\n protected _detail?: TD;\n\n /**\n * Constructs a new {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied\n * value and detail.\n * @param value - The value to be returned.\n * @param detail - An optional successful detail to be returned. If omitted, detail\n * will be `undefined`.\n */\n public constructor(value: T, detail?: TD) {\n super(value);\n this._detail = detail;\n }\n\n /**\n * The success detail associated with this {@link DetailedSuccess}, or `undefined` if\n * no detail was supplied.\n */\n public get detail(): TD | undefined {\n return this._detail;\n }\n\n /**\n * Reports that this {@link DetailedSuccess} is a success.\n * @remarks\n * Always true for {@link DetailedSuccess} but can be used as type guard\n * to discriminate {@link DetailedSuccess} from {@link DetailedFailure} in\n * a {@link DetailedResult}.\n * @returns `true`\n */\n public isSuccess(): this is DetailedSuccess<T, TD> {\n return true;\n }\n\n /**\n * Invokes the supplied {@link DetailedSuccessContinuation | success callback} and propagates\n * its returned {@link DetailedResult | DetailedResult<TN, TD>}.\n * @remarks\n * The success callback mutates the return type from `<T>` to `<TN>`.\n * @param cb - The {@link DetailedSuccessContinuation | success callback} to be invoked.\n * @returns The {@link DetailedResult | DetailedResult<T, TD>} returned by the success callback.\n */\n public onSuccess<TN>(cb: DetailedSuccessContinuation<T, TD, TN>): DetailedResult<TN, TD> {\n return cb(this._value, this._detail);\n }\n\n /**\n * Propagates this {@link DetailedSuccess}.\n * @remarks\n * Failure does not mutate return type so we can return this event directly.\n * @param _cb - {@link DetailedFailureContinuation | Failure callback} to be called\n * on a {@link DetailedResult} in case of failure (ignored).\n * @returns `this`\n */\n public onFailure(__cb: DetailedFailureContinuation<T, TD>): DetailedResult<T, TD> {\n return this;\n }\n\n /**\n * {@inheritdoc Success.withErrorFormat}\n */\n public withErrorFormat(cb: ErrorFormatter): DetailedResult<T, TD> {\n return this;\n }\n\n /**\n * Creates a {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value and\n * optional detail.\n */\n public static with<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD> {\n return new DetailedSuccess<T, TD>(value, detail);\n }\n}\n\n/**\n * A {@link DetailedFailure | DetailedFailure<T, TD>} extends {@link Failure | Failure<T>} to report optional\n * failure details in addition to the error message.\n * @public\n */\nexport class DetailedFailure<T, TD> extends Failure<T> {\n /**\n * @internal\n */\n protected _detail?: TD;\n\n /**\n * Constructs a new {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied\n * message and detail.\n * @param message - The message to be returned.\n * @param detail - The error detail to be returned.\n */\n public constructor(message: string, detail?: TD) {\n super(message);\n this._detail = detail;\n }\n\n /**\n * The error detail associated with this {@link DetailedFailure}.\n */\n public get detail(): TD | undefined {\n return this._detail;\n }\n\n /**\n * Reports that this {@link DetailedFailure} is a failure.\n * @remarks\n * Always true for {@link DetailedFailure} but can be used as type guard\n * to discriminate {@link DetailedSuccess} from {@link DetailedFailure} in\n * a {@link DetailedResult}.\n * @returns `true`\n */\n public isFailure(): this is DetailedFailure<T, TD> {\n return true;\n }\n\n /**\n * Propagates the error message and detail from this result.\n * @remarks\n * Mutates the success type as the success callback would have, but does not\n * call the success callback.\n * @param _cb - {@link DetailedSuccessContinuation | Success callback} to be called\n * on a {@link DetailedResult} in case of success (ignored).\n * @returns A new {@link DetailedFailure | DetailedFailure<TN, TD>} which contains\n * the error message and detail from this one.\n */\n public onSuccess<TN>(__cb: DetailedSuccessContinuation<T, TD, TN>): DetailedResult<TN, TD> {\n return new DetailedFailure<TN, TD>(this._message, this._detail);\n }\n\n /**\n * Invokes the supplied {@link DetailedFailureContinuation | failure callback} and propagates\n * its returned {@link DetailedResult | DetailedResult<T, TD>}.\n * @param cb - The {@link DetailedFailureContinuation | failure callback} to be invoked.\n * @returns The {@link DetailedResult | DetailedResult<T, TD>} returned by the failure callback.\n */\n public onFailure(cb: DetailedFailureContinuation<T, TD>): DetailedResult<T, TD> {\n return cb(this._message, this._detail);\n }\n\n /**\n * {@inheritdoc IResult.withErrorFormat}\n */\n public withErrorFormat(cb: ErrorFormatter<TD>): DetailedResult<T, TD> {\n return failWithDetail(cb(this._message, this._detail), this._detail);\n }\n\n /**\n * Creates a {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error message\n * and optional detail.\n * @param message - The error message to be returned.\n * @param detail - The error detail to be returned.\n * @returns The resulting {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied\n * error message and detail.\n * @public\n */\n public static with<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD> {\n return new DetailedFailure<T, TD>(message, detail);\n }\n}\n\n/**\n * Type inference to determine the result type `T` of a {@link DetailedResult | DetailedResult<T, TD>}.\n * @beta\n */\nexport type DetailedResult<T, TD> = DetailedSuccess<T, TD> | DetailedFailure<T, TD>;\n\n/**\n * Type inference to determine the detail type `TD` of a {@link DetailedResult | DetailedResult<T, TD>}.\n * @beta\n */\nexport type ResultDetailType<T> = T extends DetailedResult<unknown, infer TD> ? TD : never;\n\n/**\n * Returns {@link DetailedSuccess | DetailedSuccess<T, TD>} with a supplied value and optional\n * detail.\n * @param value - The value of type `<T>` to be returned.\n * @param detail - An optional detail of type `<TD>` to be returned.\n * @returns A {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value\n * and detail, if supplied.\n * @remarks\n * The `succeedsWithDetail` alias was added in release 5.0 for\n * naming consistency with {@link fails | fails}, which was added to avoid conflicts\n * with test frameworks and libraries.\n * @public\n */\nexport function succeedWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD> {\n return new DetailedSuccess<T, TD>(value, detail);\n}\n\n/**\n * {@inheritdoc succeedWithDetail}\n * @public\n */\nexport function succeedsWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD> {\n return new DetailedSuccess<T, TD>(value, detail);\n}\n\n/**\n * Returns {@link DetailedFailure | DetailedFailure<T, TD>} with a supplied error message and detail.\n * @param message - The error message to be returned.\n * @param detail - The event detail to be returned.\n * @returns An {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error\n * message and detail.\n * @remarks\n * The `failsWithDetail` alias was added in release 5.0 for naming consistency\n * with {@link fails | fails}, which was added to avoid conflicts with test frameworks and libraries.\n * @public\n */\nexport function failWithDetail<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD> {\n return new DetailedFailure<T, TD>(message, detail);\n}\n\n/**\n * {@inheritdoc failWithDetail}\n * @public\n */\nexport function failsWithDetail<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD> {\n return new DetailedFailure<T, TD>(message, detail);\n}\n\n/**\n * Propagates a {@link Success} or {@link Failure} {@link Result}, adding supplied\n * event details as appropriate.\n * @param result - The {@link Result} to be propagated.\n * @param detail - The event detail (type `<TD>`) to be added to the {@link Result | result}.\n * @param successDetail - An optional distinct event detail to be added to {@link Success} results. If `successDetail`\n * is omitted or `undefined`, then `detail` will be applied to {@link Success} results.\n * @returns A new {@link DetailedResult | DetailedResult<T, TD>} with the success value or error\n * message from the original `result` but with the specified detail added.\n * @public\n */\nexport function propagateWithDetail<T, TD>(\n result: Result<T>,\n detail: TD,\n successDetail?: TD\n): DetailedResult<T, TD> {\n return result.isSuccess()\n ? succeedWithDetail(result.value, successDetail ?? detail)\n : failWithDetail(result.message, detail);\n}\n\n/**\n * Wraps a function which might throw to convert exception results\n * to {@link Failure}.\n * @param func - The function to be captured.\n * @returns Returns {@link Success} with a value of type `<T>` on\n * success , or {@link Failure} with the thrown error message if\n * `func` throws an `Error`.\n * @public\n */\nexport function captureResult<T>(func: () => T): Result<T> {\n try {\n return succeed(func());\n } catch (err) {\n return fail((err as Error).message);\n }\n}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