@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
package/dist/ts-utils.d.ts
CHANGED
|
@@ -1029,26 +1029,26 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1029
1029
|
declare function delimitedString(delimiter: string, options?: 'filtered' | 'all'): Converter<string[], string>;
|
|
1030
1030
|
|
|
1031
1031
|
/**
|
|
1032
|
-
* A {@link DetailedFailure} extends {@link Failure} to report optional
|
|
1033
|
-
* addition to the error message.
|
|
1032
|
+
* A {@link DetailedFailure | DetailedFailure<T, TD>} extends {@link Failure | Failure<T>} to report optional
|
|
1033
|
+
* failure details in addition to the error message.
|
|
1034
1034
|
* @public
|
|
1035
1035
|
*/
|
|
1036
1036
|
export declare class DetailedFailure<T, TD> extends Failure<T> {
|
|
1037
1037
|
/**
|
|
1038
1038
|
* @internal
|
|
1039
1039
|
*/
|
|
1040
|
-
protected _detail
|
|
1040
|
+
protected _detail?: TD;
|
|
1041
1041
|
/**
|
|
1042
1042
|
* Constructs a new {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied
|
|
1043
1043
|
* message and detail.
|
|
1044
1044
|
* @param message - The message to be returned.
|
|
1045
1045
|
* @param detail - The error detail to be returned.
|
|
1046
1046
|
*/
|
|
1047
|
-
constructor(message: string, detail
|
|
1047
|
+
constructor(message: string, detail?: TD);
|
|
1048
1048
|
/**
|
|
1049
1049
|
* The error detail associated with this {@link DetailedFailure}.
|
|
1050
1050
|
*/
|
|
1051
|
-
get detail(): TD;
|
|
1051
|
+
get detail(): TD | undefined;
|
|
1052
1052
|
/**
|
|
1053
1053
|
* Reports that this {@link DetailedFailure} is a failure.
|
|
1054
1054
|
* @remarks
|
|
@@ -1080,16 +1080,27 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1080
1080
|
* {@inheritdoc IResult.withErrorFormat}
|
|
1081
1081
|
*/
|
|
1082
1082
|
withErrorFormat(cb: ErrorFormatter<TD>): DetailedResult<T, TD>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Creates a {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error message
|
|
1085
|
+
* and optional detail.
|
|
1086
|
+
* @param message - The error message to be returned.
|
|
1087
|
+
* @param detail - The error detail to be returned.
|
|
1088
|
+
* @returns The resulting {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied
|
|
1089
|
+
* error message and detail.
|
|
1090
|
+
* @public
|
|
1091
|
+
*/
|
|
1092
|
+
static with<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD>;
|
|
1083
1093
|
}
|
|
1084
1094
|
|
|
1085
1095
|
/**
|
|
1086
|
-
* Callback to be called when a {@link DetailedResult} encounters a failure.
|
|
1096
|
+
* Callback to be called when a {@link DetailedResult | DetailedResult} encounters a failure.
|
|
1087
1097
|
* @remarks
|
|
1088
|
-
* A failure callback can change {@link
|
|
1098
|
+
* A failure callback can change {@link DetailedFailure | DetailedFailure<T, TD>} to
|
|
1099
|
+
* {@link DetailedSuccess | DetailedSuccess<T, TD>} (e.g. by returning a default value)
|
|
1089
1100
|
* or it can change or embellish the error message, but it cannot change the success return type.
|
|
1090
1101
|
* @public
|
|
1091
1102
|
*/
|
|
1092
|
-
export declare type DetailedFailureContinuation<T, TD> = (message: string, detail
|
|
1103
|
+
export declare type DetailedFailureContinuation<T, TD> = (message: string, detail?: TD) => DetailedResult<T, TD>;
|
|
1093
1104
|
|
|
1094
1105
|
/**
|
|
1095
1106
|
* Type inference to determine the result type `T` of a {@link DetailedResult | DetailedResult<T, TD>}.
|
|
@@ -1098,8 +1109,8 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1098
1109
|
export declare type DetailedResult<T, TD> = DetailedSuccess<T, TD> | DetailedFailure<T, TD>;
|
|
1099
1110
|
|
|
1100
1111
|
/**
|
|
1101
|
-
* A {@link DetailedSuccess} extends {@link Success} to report optional success
|
|
1102
|
-
* addition to the error message.
|
|
1112
|
+
* A {@link DetailedSuccess | DetailedSuccess} extends {@link Success | Success} to report optional success
|
|
1113
|
+
* details in addition to the error message.
|
|
1103
1114
|
* @public
|
|
1104
1115
|
*/
|
|
1105
1116
|
export declare class DetailedSuccess<T, TD> extends Success<T> {
|
|
@@ -1151,10 +1162,15 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1151
1162
|
* {@inheritdoc Success.withErrorFormat}
|
|
1152
1163
|
*/
|
|
1153
1164
|
withErrorFormat(cb: ErrorFormatter): DetailedResult<T, TD>;
|
|
1165
|
+
/**
|
|
1166
|
+
* Creates a {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value and
|
|
1167
|
+
* optional detail.
|
|
1168
|
+
*/
|
|
1169
|
+
static with<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD>;
|
|
1154
1170
|
}
|
|
1155
1171
|
|
|
1156
1172
|
/**
|
|
1157
|
-
* Callback to be called when a {@link DetailedResult} encounters success.
|
|
1173
|
+
* Callback to be called when a {@link DetailedResult | DetailedResult} encounters success.
|
|
1158
1174
|
* @remarks
|
|
1159
1175
|
* A success callback can return a different result type than it receives, allowing
|
|
1160
1176
|
* success results to chain through intermediate result types.
|
|
@@ -1279,11 +1295,26 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1279
1295
|
/**
|
|
1280
1296
|
* Returns {@link Failure | Failure<T>} with the supplied error message.
|
|
1281
1297
|
* @param message - Error message to be returned.
|
|
1298
|
+
* @remarks
|
|
1299
|
+
* A `fails` alias was added in release 5.0 due to
|
|
1300
|
+
* issues with the name `fail` being used test frameworks and libraries.
|
|
1282
1301
|
* @public
|
|
1283
1302
|
*/
|
|
1284
1303
|
declare function fail_2<T>(message: string): Failure<T>;
|
|
1285
1304
|
export { fail_2 as fail }
|
|
1286
1305
|
|
|
1306
|
+
/**
|
|
1307
|
+
* {@inheritdoc fail}
|
|
1308
|
+
* @public
|
|
1309
|
+
*/
|
|
1310
|
+
export declare function fails<T>(message: string): Failure<T>;
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* {@inheritdoc failWithDetail}
|
|
1314
|
+
* @public
|
|
1315
|
+
*/
|
|
1316
|
+
export declare function failsWithDetail<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD>;
|
|
1317
|
+
|
|
1287
1318
|
/**
|
|
1288
1319
|
* Reports a failed {@link IResult | result} from some operation, with an error message.
|
|
1289
1320
|
* @public
|
|
@@ -1300,7 +1331,7 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1300
1331
|
/**
|
|
1301
1332
|
* @internal
|
|
1302
1333
|
*/
|
|
1303
|
-
|
|
1334
|
+
protected readonly _message: string;
|
|
1304
1335
|
/**
|
|
1305
1336
|
* Constructs a {@link Failure} with the supplied message.
|
|
1306
1337
|
* @param message - Error message to be reported.
|
|
@@ -1371,6 +1402,12 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1371
1402
|
* @returns A string representing this object.
|
|
1372
1403
|
*/
|
|
1373
1404
|
toString(): string;
|
|
1405
|
+
/**
|
|
1406
|
+
* Creates a {@link Failure | Failure<T>} with the supplied error message.
|
|
1407
|
+
* @param message - The error message to be returned.
|
|
1408
|
+
* @returns The resulting {@link Failure | Failure<T>} with the supplied error message.
|
|
1409
|
+
*/
|
|
1410
|
+
static with<T>(message: string): Failure<T>;
|
|
1374
1411
|
}
|
|
1375
1412
|
|
|
1376
1413
|
/**
|
|
@@ -1386,9 +1423,12 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
1386
1423
|
* @param detail - The event detail to be returned.
|
|
1387
1424
|
* @returns An {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error
|
|
1388
1425
|
* message and detail.
|
|
1426
|
+
* @remarks
|
|
1427
|
+
* The `failsWithDetail` alias was added in release 5.0 for naming consistency
|
|
1428
|
+
* with {@link fails | fails}, which was added to avoid conflicts with test frameworks and libraries.
|
|
1389
1429
|
* @public
|
|
1390
1430
|
*/
|
|
1391
|
-
export declare function failWithDetail<T, TD>(message: string, detail
|
|
1431
|
+
export declare function failWithDetail<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD>;
|
|
1392
1432
|
|
|
1393
1433
|
/**
|
|
1394
1434
|
* A helper function to create a {@link Converter | Converter} which extracts and convert a property specified
|
|
@@ -3147,7 +3187,7 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
3147
3187
|
declare function object_2<T, TC = unknown>(fields: FieldValidators<T, TC>, params?: Omit<ObjectValidatorConstructorParams<T, TC>, 'fields'>): ObjectValidator<T, TC>;
|
|
3148
3188
|
|
|
3149
3189
|
/**
|
|
3150
|
-
* A {@link Converter} which converts an object of type `<T>` without changing shape, given
|
|
3190
|
+
* A {@link Converter | Converter} which converts an object of type `<T>` without changing shape, given
|
|
3151
3191
|
* a {@link Conversion.FieldConverters | FieldConverters<T>} for the fields in the object.
|
|
3152
3192
|
* @remarks
|
|
3153
3193
|
* By default, if all of the required fields exist and can be converted, returns a new object with
|
|
@@ -3181,8 +3221,33 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
3181
3221
|
* a {@link Converter} for each field.
|
|
3182
3222
|
* @param optional - An array of `keyof T` listing fields that are not required.
|
|
3183
3223
|
* {@label WITH_KEYS}
|
|
3224
|
+
* @deprecated Use {@link Conversion.Converter.optional | .optional()} on the individual
|
|
3225
|
+
* fields, or pass {@link Conversion.ObjectConverterOptions | ObjectConverterOptions<T>} to the constructor.
|
|
3184
3226
|
*/
|
|
3185
3227
|
constructor(fields: FieldConverters<T, TC>, optional?: (keyof T)[]);
|
|
3228
|
+
/**
|
|
3229
|
+
* Converts the supplied object using the {@link Conversion.ObjectConverter | ObjectConverter}
|
|
3230
|
+
* with all fields optional.
|
|
3231
|
+
* @param from - The object to be converted.
|
|
3232
|
+
* @param context - An optional context object passed to the field converters.
|
|
3233
|
+
* @returns A {@link Result} containing the converted object or an error message.
|
|
3234
|
+
*/
|
|
3235
|
+
convertPartial(from: unknown, context?: TC): Result<Partial<T>>;
|
|
3236
|
+
/**
|
|
3237
|
+
* Converts the supplied object using the {@link Conversion.ObjectConverter | ObjectConverter}
|
|
3238
|
+
* with all fields required.
|
|
3239
|
+
* @param from - The object to be converted.
|
|
3240
|
+
* @param context - An optional context object passed to the field converters.
|
|
3241
|
+
* @returns A {@link Result} containing the converted object or an error message.
|
|
3242
|
+
*/
|
|
3243
|
+
convertRequired(from: unknown, context?: TC): Result<Required<T>>;
|
|
3244
|
+
/**
|
|
3245
|
+
* Creates a new {@link Conversion.ObjectConverter | ObjectConverter} derived from this one but with
|
|
3246
|
+
* all properties optional.
|
|
3247
|
+
* @returns A new {@link Conversion.ObjectConverter | ObjectConverter} with the additional optional source properties.
|
|
3248
|
+
* {@label WITHOUT_OPTIONS}
|
|
3249
|
+
*/
|
|
3250
|
+
partial(): ObjectConverter<Partial<T>, TC>;
|
|
3186
3251
|
/**
|
|
3187
3252
|
* Creates a new {@link Conversion.ObjectConverter | ObjectConverter} derived from this one but with
|
|
3188
3253
|
* new optional properties as specified by a supplied {@link Conversion.ObjectConverterOptions | ObjectConverterOptions<T>}.
|
|
@@ -3190,6 +3255,7 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
3190
3255
|
* converter.
|
|
3191
3256
|
* @returns A new {@link Conversion.ObjectConverter | ObjectConverter} with the additional optional source properties.
|
|
3192
3257
|
* {@label WITH_OPTIONS}
|
|
3258
|
+
* @deprecated Pass just the keys to be made optional.
|
|
3193
3259
|
*/
|
|
3194
3260
|
partial(options: ObjectConverterOptions<T>): ObjectConverter<Partial<T>, TC>;
|
|
3195
3261
|
/**
|
|
@@ -3200,7 +3266,7 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
3200
3266
|
* properties.
|
|
3201
3267
|
* {@label WITH_KEYS}
|
|
3202
3268
|
*/
|
|
3203
|
-
partial(optional
|
|
3269
|
+
partial(optional: (keyof T)[]): ObjectConverter<Partial<T>, TC>;
|
|
3204
3270
|
/**
|
|
3205
3271
|
* Creates a new {@link Conversion.ObjectConverter | ObjectConverter} derived from this one but with
|
|
3206
3272
|
* new optional properties as specified by a supplied array of `keyof T`.
|
|
@@ -3209,6 +3275,13 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
3209
3275
|
* properties.
|
|
3210
3276
|
*/
|
|
3211
3277
|
addPartial(addOptionalProperties: (keyof T)[]): ObjectConverter<Partial<T>, TC>;
|
|
3278
|
+
/**
|
|
3279
|
+
* Creates a new {@link Conversion.ObjectConverter | ObjectConverter} derived from this one but with
|
|
3280
|
+
* all properties required.
|
|
3281
|
+
* @returns A new {@link Conversion.ObjectConverter | ObjectConverter} with the additional required source properties.
|
|
3282
|
+
*/
|
|
3283
|
+
required(): ObjectConverter<Required<T>, TC>;
|
|
3284
|
+
private static _convert;
|
|
3212
3285
|
}
|
|
3213
3286
|
|
|
3214
3287
|
/**
|
|
@@ -3229,6 +3302,10 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
3229
3302
|
* Optional description to be included in error messages.
|
|
3230
3303
|
*/
|
|
3231
3304
|
description?: string;
|
|
3305
|
+
/**
|
|
3306
|
+
* Optional modifier to apply to the converter.
|
|
3307
|
+
*/
|
|
3308
|
+
modifier?: 'partial' | 'required';
|
|
3232
3309
|
}
|
|
3233
3310
|
|
|
3234
3311
|
/**
|
|
@@ -4082,10 +4159,26 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
4082
4159
|
/**
|
|
4083
4160
|
* Returns {@link Success | Success<T>} with the supplied result value.
|
|
4084
4161
|
* @param value - The successful result value to be returned
|
|
4162
|
+
* @remarks
|
|
4163
|
+
* A `succeeds` alias was added in release 5.0 for
|
|
4164
|
+
* naming consistency with {@link fails | fails}, which was added
|
|
4165
|
+
* to avoid conflicts with test frameworks and libraries.
|
|
4085
4166
|
* @public
|
|
4086
4167
|
*/
|
|
4087
4168
|
export declare function succeed<T>(value: T): Success<T>;
|
|
4088
4169
|
|
|
4170
|
+
/**
|
|
4171
|
+
* {@inheritdoc succeed}
|
|
4172
|
+
* @public
|
|
4173
|
+
*/
|
|
4174
|
+
export declare function succeeds<T>(value: T): Success<T>;
|
|
4175
|
+
|
|
4176
|
+
/**
|
|
4177
|
+
* {@inheritdoc succeedWithDetail}
|
|
4178
|
+
* @public
|
|
4179
|
+
*/
|
|
4180
|
+
export declare function succeedsWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD>;
|
|
4181
|
+
|
|
4089
4182
|
/**
|
|
4090
4183
|
* Returns {@link DetailedSuccess | DetailedSuccess<T, TD>} with a supplied value and optional
|
|
4091
4184
|
* detail.
|
|
@@ -4093,6 +4186,10 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
4093
4186
|
* @param detail - An optional detail of type `<TD>` to be returned.
|
|
4094
4187
|
* @returns A {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value
|
|
4095
4188
|
* and detail, if supplied.
|
|
4189
|
+
* @remarks
|
|
4190
|
+
* The `succeedsWithDetail` alias was added in release 5.0 for
|
|
4191
|
+
* naming consistency with {@link fails | fails}, which was added to avoid conflicts
|
|
4192
|
+
* with test frameworks and libraries.
|
|
4096
4193
|
* @public
|
|
4097
4194
|
*/
|
|
4098
4195
|
export declare function succeedWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD>;
|
|
@@ -4114,7 +4211,7 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
4114
4211
|
/**
|
|
4115
4212
|
* @internal
|
|
4116
4213
|
*/
|
|
4117
|
-
|
|
4214
|
+
protected readonly _value: T;
|
|
4118
4215
|
/**
|
|
4119
4216
|
* Constructs a {@link Success} with the supplied value.
|
|
4120
4217
|
* @param value - The value to be returned.
|
|
@@ -4177,7 +4274,14 @@ declare class Collectible<TKEY extends string = string, TINDEX extends number =
|
|
|
4177
4274
|
/**
|
|
4178
4275
|
* {@inheritdoc IResult.aggregateError}
|
|
4179
4276
|
*/
|
|
4180
|
-
aggregateError(
|
|
4277
|
+
aggregateError(__errors: IMessageAggregator): this;
|
|
4278
|
+
/**
|
|
4279
|
+
* Creates a {@link Success | Success<T>} with the supplied value.
|
|
4280
|
+
* @param value - The value to be returned.
|
|
4281
|
+
* @returns The resulting {@link Success | Success<T>} with the supplied value.
|
|
4282
|
+
* @public
|
|
4283
|
+
*/
|
|
4284
|
+
static with<T>(value: T): Success<T>;
|
|
4181
4285
|
}
|
|
4182
4286
|
|
|
4183
4287
|
/**
|
|
@@ -75,7 +75,7 @@ function mapDetailedResults(results, ignore, aggregatedErrors) {
|
|
|
75
75
|
if (result.isSuccess()) {
|
|
76
76
|
elements.push(result.value);
|
|
77
77
|
}
|
|
78
|
-
else if (!ignore.includes(result.detail)) {
|
|
78
|
+
else if (result.detail && !ignore.includes(result.detail)) {
|
|
79
79
|
errors.push(result.message);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapResults.js","sourceRoot":"","sources":["../../../src/packlets/base/mapResults.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAcH,gCAoBC;AAeD,gDAqBC;AAaD,gCAoBC;A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BAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,IAAA,aAAI,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,IAAA,gBAAO,EAAC,KAAU,CAAC,CAAC;AAC7B,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\nimport { DetailedResult, IMessageAggregator, Result, fail, succeed } from './result';\n\n/**\n * Aggregates successful result values from a collection of {@link Result | Result<T>}.\n * @param results - The collection of {@link Result | Result<T>} to be mapped.\n * @param aggregatedErrors - Optional string array to which any error messages will be\n * appended. Each error is appended as an individual string.\n * @returns If all {@link Result | results} are successful, returns {@link Success} with an\n * array containing all returned values. If any {@link Result | results} failed, returns\n * {@link Failure} with a concatenated summary of all error messages.\n * @public\n */\nexport function mapResults<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else {\n errors.push(result.message);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates successful results from a collection of {@link DetailedResult | DetailedResult<T, TD>},\n * optionally ignoring certain error details.\n * @param results - The collection of {@link DetailedResult | DetailedResult<T, TD>} to be mapped.\n * @param ignore - An array of error detail values (of type `<TD>`) that should be ignored.\n * @param aggregatedErrors - Optional string array to which any non-ignorable error messages will be\n * appended. Each error is appended as an individual string.\n * @returns {@link Success} with an array containing all successful results if all results either\n * succeeded or returned error details listed in `ignore`. If any results failed with details\n * that cannot be ignored, returns {@link Failure} with an concatenated summary of all non-ignorable\n * error messages.\n * @public\n */\nexport function mapDetailedResults<T, TD>(\n results: Iterable<DetailedResult<T, TD>>,\n ignore: TD[],\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else if (!ignore.includes(result.detail)) {\n errors.push(result.message);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates successful results from a a collection of {@link Result | Result<T>}.\n * @param results - An `Iterable` of {@link Result | Result<T>} from which success\n * results are to be aggregated.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns {@link Success} with an array of `<T>` if any results were successful. If\n * all {@link Result | results} failed, returns {@link Failure} with a concatenated\n * summary of all error messages.\n * @public\n */\nexport function mapSuccess<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else {\n errors.push(result.message);\n }\n }\n\n if (elements.length === 0 && errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates error messages from a collection of {@link Result | Result<T>}.\n * @param results - An iterable collection of {@link Result | Result<T>} for which\n * error messages are aggregated.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns An array of strings consisting of all error messages returned by\n * {@link Result | results} in the source collection. Ignores {@link Success}\n * results and returns an empty array if there were no errors.\n * @public\n */\nexport function mapFailures<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): string[] {\n const errors: string[] = [];\n for (const result of results) {\n if (result.isFailure()) {\n errors.push(result.message);\n aggregatedErrors?.addMessage(result.message);\n }\n }\n return errors;\n}\n\n/**\n * Determines if an iterable collection of {@link Result | Result<T>} were all successful.\n * @param results - The collection of {@link Result | Result<T>} to be tested.\n * @param successValue - The value to be returned if results are successful.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns Returns {@link Success} with `successValue` if all {@link Result | results} are successful.\n * If any are unsuccessful, returns {@link Failure} with a concatenated summary of the error\n * messages from all failed elements.\n * @public\n */\nexport function allSucceed<T>(\n results: Iterable<Result<unknown>>,\n successValue: T,\n aggregatedErrors?: IMessageAggregator\n): Result<T> {\n const errors: string[] = [];\n\n if (results !== undefined) {\n for (const result of results) {\n if (result.isFailure()) {\n errors.push(result.message);\n }\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(successValue);\n}\n\n/**\n * String-keyed record of initialization functions to be passed to {@link (populateObject:1)}\n * or {@link (populateObject:2)}.\n * @public\n */\nexport type FieldInitializers<T> = { [key in keyof T]: (state: Partial<T>) => Result<T[key]> };\n\n/**\n * Options for the {@link (populateObject:1)} function.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface PopulateObjectOptions<T> {\n /**\n * If present, specifies the order in which property values should\n * be evaluated. Any keys not listed are evaluated after all listed\n * keys in indeterminate order. If 'order' is not present, keys\n * are evaluated in indeterminate order.\n */\n order?: (keyof T)[];\n\n /**\n * Specify handling of `undefined` values. By default, successful\n * `undefined` results are written to the result object. If this value\n * is `true` then `undefined` results are suppressed for all properties.\n * If this value is an array of property keys then `undefined` results\n * are suppressed for those properties only.\n */\n suppressUndefined?: boolean | (keyof T)[];\n}\n\n/**\n * Populates an an object based on a prototype full of field initializers that return {@link Result | Result<T[key]>}.\n * Returns {@link Success} with the populated object if all initializers succeed, or {@link Failure} with a\n * concatenated list of all error messages.\n * @param initializers - An object with the shape of the target but with initializer functions for\n * each property.\n * @param options - An optional {@link PopulateObjectOptions | set of options} which\n * modify the behavior of this call.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * {@label WITH_OPTIONS}\n * @public\n */\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n options?: PopulateObjectOptions<T>,\n aggregatedErrors?: IMessageAggregator\n): Result<T>;\n\n/**\n * Populates an an object based on a prototype full of field initializers that return {@link Result | Result<T[key]>}.\n * Returns {@link Success} with the populated object if all initializers succeed, or {@link Failure} with a\n * concatenated list of all error messages.\n * @param initializers - An object with the shape of the target but with initializer functions for\n * each property.\n * @param order - Optional order in which keys should be written.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @public\n * {@label WITH_ORDER}\n * @deprecated Pass {@link PopulateObjectOptions} instead.\n */\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n order: (keyof T)[] | undefined,\n aggregatedErrors?: IMessageAggregator\n): Result<T>;\n\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n optionsOrOrder?: PopulateObjectOptions<T> | (keyof T)[],\n aggregatedErrors?: IMessageAggregator\n): Result<T> {\n const options: PopulateObjectOptions<T> = optionsOrOrder\n ? Array.isArray(optionsOrOrder)\n ? { order: optionsOrOrder }\n : optionsOrOrder\n : {};\n const state = {} as { [key in keyof T]: T[key] };\n const errors: string[] = [];\n const keys: (keyof T)[] = Array.from(options.order ?? []);\n const foundKeys = new Set<keyof T>(options.order);\n\n // start with the supplied order then append anything else we find\n for (const key in initializers) {\n if (!foundKeys.has(key)) {\n keys.push(key);\n foundKeys.add(key);\n }\n }\n\n for (const key of keys) {\n if (initializers[key]) {\n const result = initializers[key](state);\n if (result.isSuccess()) {\n if (result.value === undefined) {\n if (\n options.suppressUndefined === true ||\n (Array.isArray(options.suppressUndefined) && options.suppressUndefined.includes(key))\n ) {\n continue;\n }\n }\n state[key] = result.value;\n } else {\n errors.push(result.message);\n }\n } else {\n errors.push(`populateObject: Key ${String(key)} is present but has no initializer`);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(state as T);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mapResults.js","sourceRoot":"","sources":["../../../src/packlets/base/mapResults.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAcH,gCAoBC;AAeD,gDAqBC;AAaD,gCAoBC;AAaD,kCAYC;AAaD,gCAoBC;AAuED,wCAiDC;AAvRD,qCAAqF;AAErF;;;;;;;;;GASG;AACH,SAAgB,UAAU,CACxB,OAA4B,EAC5B,gBAAqC;IAErC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAQ,EAAE,CAAC;IAEzB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9B,CAA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E,CAAC;QACvB,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YACxC,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;gBACvB,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBAC/B,IACE,OAAO,CAAC,iBAAiB,KAAK,IAAI;wBAClC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EACrF,CAAC;wBACD,SAAS;oBACX,CAAC;gBACH,CAAC;gBACD,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,IAAA,aAAI,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,IAAA,gBAAO,EAAC,KAAU,CAAC,CAAC;AAC7B,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\nimport { DetailedResult, IMessageAggregator, Result, fail, succeed } from './result';\n\n/**\n * Aggregates successful result values from a collection of {@link Result | Result<T>}.\n * @param results - The collection of {@link Result | Result<T>} to be mapped.\n * @param aggregatedErrors - Optional string array to which any error messages will be\n * appended. Each error is appended as an individual string.\n * @returns If all {@link Result | results} are successful, returns {@link Success} with an\n * array containing all returned values. If any {@link Result | results} failed, returns\n * {@link Failure} with a concatenated summary of all error messages.\n * @public\n */\nexport function mapResults<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else {\n errors.push(result.message);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates successful results from a collection of {@link DetailedResult | DetailedResult<T, TD>},\n * optionally ignoring certain error details.\n * @param results - The collection of {@link DetailedResult | DetailedResult<T, TD>} to be mapped.\n * @param ignore - An array of error detail values (of type `<TD>`) that should be ignored.\n * @param aggregatedErrors - Optional string array to which any non-ignorable error messages will be\n * appended. Each error is appended as an individual string.\n * @returns {@link Success} with an array containing all successful results if all results either\n * succeeded or returned error details listed in `ignore`. If any results failed with details\n * that cannot be ignored, returns {@link Failure} with an concatenated summary of all non-ignorable\n * error messages.\n * @public\n */\nexport function mapDetailedResults<T, TD>(\n results: Iterable<DetailedResult<T, TD>>,\n ignore: TD[],\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else if (result.detail && !ignore.includes(result.detail)) {\n errors.push(result.message);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates successful results from a a collection of {@link Result | Result<T>}.\n * @param results - An `Iterable` of {@link Result | Result<T>} from which success\n * results are to be aggregated.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns {@link Success} with an array of `<T>` if any results were successful. If\n * all {@link Result | results} failed, returns {@link Failure} with a concatenated\n * summary of all error messages.\n * @public\n */\nexport function mapSuccess<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else {\n errors.push(result.message);\n }\n }\n\n if (elements.length === 0 && errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates error messages from a collection of {@link Result | Result<T>}.\n * @param results - An iterable collection of {@link Result | Result<T>} for which\n * error messages are aggregated.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns An array of strings consisting of all error messages returned by\n * {@link Result | results} in the source collection. Ignores {@link Success}\n * results and returns an empty array if there were no errors.\n * @public\n */\nexport function mapFailures<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): string[] {\n const errors: string[] = [];\n for (const result of results) {\n if (result.isFailure()) {\n errors.push(result.message);\n aggregatedErrors?.addMessage(result.message);\n }\n }\n return errors;\n}\n\n/**\n * Determines if an iterable collection of {@link Result | Result<T>} were all successful.\n * @param results - The collection of {@link Result | Result<T>} to be tested.\n * @param successValue - The value to be returned if results are successful.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns Returns {@link Success} with `successValue` if all {@link Result | results} are successful.\n * If any are unsuccessful, returns {@link Failure} with a concatenated summary of the error\n * messages from all failed elements.\n * @public\n */\nexport function allSucceed<T>(\n results: Iterable<Result<unknown>>,\n successValue: T,\n aggregatedErrors?: IMessageAggregator\n): Result<T> {\n const errors: string[] = [];\n\n if (results !== undefined) {\n for (const result of results) {\n if (result.isFailure()) {\n errors.push(result.message);\n }\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(successValue);\n}\n\n/**\n * String-keyed record of initialization functions to be passed to {@link (populateObject:1)}\n * or {@link (populateObject:2)}.\n * @public\n */\nexport type FieldInitializers<T> = { [key in keyof T]: (state: Partial<T>) => Result<T[key]> };\n\n/**\n * Options for the {@link (populateObject:1)} function.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface PopulateObjectOptions<T> {\n /**\n * If present, specifies the order in which property values should\n * be evaluated. Any keys not listed are evaluated after all listed\n * keys in indeterminate order. If 'order' is not present, keys\n * are evaluated in indeterminate order.\n */\n order?: (keyof T)[];\n\n /**\n * Specify handling of `undefined` values. By default, successful\n * `undefined` results are written to the result object. If this value\n * is `true` then `undefined` results are suppressed for all properties.\n * If this value is an array of property keys then `undefined` results\n * are suppressed for those properties only.\n */\n suppressUndefined?: boolean | (keyof T)[];\n}\n\n/**\n * Populates an an object based on a prototype full of field initializers that return {@link Result | Result<T[key]>}.\n * Returns {@link Success} with the populated object if all initializers succeed, or {@link Failure} with a\n * concatenated list of all error messages.\n * @param initializers - An object with the shape of the target but with initializer functions for\n * each property.\n * @param options - An optional {@link PopulateObjectOptions | set of options} which\n * modify the behavior of this call.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * {@label WITH_OPTIONS}\n * @public\n */\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n options?: PopulateObjectOptions<T>,\n aggregatedErrors?: IMessageAggregator\n): Result<T>;\n\n/**\n * Populates an an object based on a prototype full of field initializers that return {@link Result | Result<T[key]>}.\n * Returns {@link Success} with the populated object if all initializers succeed, or {@link Failure} with a\n * concatenated list of all error messages.\n * @param initializers - An object with the shape of the target but with initializer functions for\n * each property.\n * @param order - Optional order in which keys should be written.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @public\n * {@label WITH_ORDER}\n * @deprecated Pass {@link PopulateObjectOptions} instead.\n */\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n order: (keyof T)[] | undefined,\n aggregatedErrors?: IMessageAggregator\n): Result<T>;\n\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n optionsOrOrder?: PopulateObjectOptions<T> | (keyof T)[],\n aggregatedErrors?: IMessageAggregator\n): Result<T> {\n const options: PopulateObjectOptions<T> = optionsOrOrder\n ? Array.isArray(optionsOrOrder)\n ? { order: optionsOrOrder }\n : optionsOrOrder\n : {};\n const state = {} as { [key in keyof T]: T[key] };\n const errors: string[] = [];\n const keys: (keyof T)[] = Array.from(options.order ?? []);\n const foundKeys = new Set<keyof T>(options.order);\n\n // start with the supplied order then append anything else we find\n for (const key in initializers) {\n if (!foundKeys.has(key)) {\n keys.push(key);\n foundKeys.add(key);\n }\n }\n\n for (const key of keys) {\n if (initializers[key]) {\n const result = initializers[key](state);\n if (result.isSuccess()) {\n if (result.value === undefined) {\n if (\n options.suppressUndefined === true ||\n (Array.isArray(options.suppressUndefined) && options.suppressUndefined.includes(key))\n ) {\n continue;\n }\n }\n state[key] = result.value;\n } else {\n errors.push(result.message);\n }\n } else {\n errors.push(`populateObject: Key ${String(key)} is present but has no initializer`);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(state as T);\n}\n"]}
|
|
@@ -245,7 +245,7 @@ export declare class Success<T> implements IResult<T> {
|
|
|
245
245
|
/**
|
|
246
246
|
* @internal
|
|
247
247
|
*/
|
|
248
|
-
|
|
248
|
+
protected readonly _value: T;
|
|
249
249
|
/**
|
|
250
250
|
* Constructs a {@link Success} with the supplied value.
|
|
251
251
|
* @param value - The value to be returned.
|
|
@@ -308,7 +308,14 @@ export declare class Success<T> implements IResult<T> {
|
|
|
308
308
|
/**
|
|
309
309
|
* {@inheritdoc IResult.aggregateError}
|
|
310
310
|
*/
|
|
311
|
-
aggregateError(
|
|
311
|
+
aggregateError(__errors: IMessageAggregator): this;
|
|
312
|
+
/**
|
|
313
|
+
* Creates a {@link Success | Success<T>} with the supplied value.
|
|
314
|
+
* @param value - The value to be returned.
|
|
315
|
+
* @returns The resulting {@link Success | Success<T>} with the supplied value.
|
|
316
|
+
* @public
|
|
317
|
+
*/
|
|
318
|
+
static with<T>(value: T): Success<T>;
|
|
312
319
|
}
|
|
313
320
|
/**
|
|
314
321
|
* Reports a failed {@link IResult | result} from some operation, with an error message.
|
|
@@ -326,7 +333,7 @@ export declare class Failure<T> implements IResult<T> {
|
|
|
326
333
|
/**
|
|
327
334
|
* @internal
|
|
328
335
|
*/
|
|
329
|
-
|
|
336
|
+
protected readonly _message: string;
|
|
330
337
|
/**
|
|
331
338
|
* Constructs a {@link Failure} with the supplied message.
|
|
332
339
|
* @param message - Error message to be reported.
|
|
@@ -397,21 +404,44 @@ export declare class Failure<T> implements IResult<T> {
|
|
|
397
404
|
* @returns A string representing this object.
|
|
398
405
|
*/
|
|
399
406
|
toString(): string;
|
|
407
|
+
/**
|
|
408
|
+
* Creates a {@link Failure | Failure<T>} with the supplied error message.
|
|
409
|
+
* @param message - The error message to be returned.
|
|
410
|
+
* @returns The resulting {@link Failure | Failure<T>} with the supplied error message.
|
|
411
|
+
*/
|
|
412
|
+
static with<T>(message: string): Failure<T>;
|
|
400
413
|
}
|
|
401
414
|
/**
|
|
402
415
|
* Returns {@link Success | Success<T>} with the supplied result value.
|
|
403
416
|
* @param value - The successful result value to be returned
|
|
417
|
+
* @remarks
|
|
418
|
+
* A `succeeds` alias was added in release 5.0 for
|
|
419
|
+
* naming consistency with {@link fails | fails}, which was added
|
|
420
|
+
* to avoid conflicts with test frameworks and libraries.
|
|
404
421
|
* @public
|
|
405
422
|
*/
|
|
406
423
|
export declare function succeed<T>(value: T): Success<T>;
|
|
424
|
+
/**
|
|
425
|
+
* {@inheritdoc succeed}
|
|
426
|
+
* @public
|
|
427
|
+
*/
|
|
428
|
+
export declare function succeeds<T>(value: T): Success<T>;
|
|
407
429
|
/**
|
|
408
430
|
* Returns {@link Failure | Failure<T>} with the supplied error message.
|
|
409
431
|
* @param message - Error message to be returned.
|
|
432
|
+
* @remarks
|
|
433
|
+
* A `fails` alias was added in release 5.0 due to
|
|
434
|
+
* issues with the name `fail` being used test frameworks and libraries.
|
|
410
435
|
* @public
|
|
411
436
|
*/
|
|
412
437
|
export declare function fail<T>(message: string): Failure<T>;
|
|
413
438
|
/**
|
|
414
|
-
*
|
|
439
|
+
* {@inheritdoc fail}
|
|
440
|
+
* @public
|
|
441
|
+
*/
|
|
442
|
+
export declare function fails<T>(message: string): Failure<T>;
|
|
443
|
+
/**
|
|
444
|
+
* Callback to be called when a {@link DetailedResult | DetailedResult} encounters success.
|
|
415
445
|
* @remarks
|
|
416
446
|
* A success callback can return a different result type than it receives, allowing
|
|
417
447
|
* success results to chain through intermediate result types.
|
|
@@ -419,16 +449,17 @@ export declare function fail<T>(message: string): Failure<T>;
|
|
|
419
449
|
*/
|
|
420
450
|
export type DetailedSuccessContinuation<T, TD, TN> = (value: T, detail?: TD) => DetailedResult<TN, TD>;
|
|
421
451
|
/**
|
|
422
|
-
* Callback to be called when a {@link DetailedResult} encounters a failure.
|
|
452
|
+
* Callback to be called when a {@link DetailedResult | DetailedResult} encounters a failure.
|
|
423
453
|
* @remarks
|
|
424
|
-
* A failure callback can change {@link
|
|
454
|
+
* A failure callback can change {@link DetailedFailure | DetailedFailure<T, TD>} to
|
|
455
|
+
* {@link DetailedSuccess | DetailedSuccess<T, TD>} (e.g. by returning a default value)
|
|
425
456
|
* or it can change or embellish the error message, but it cannot change the success return type.
|
|
426
457
|
* @public
|
|
427
458
|
*/
|
|
428
|
-
export type DetailedFailureContinuation<T, TD> = (message: string, detail
|
|
459
|
+
export type DetailedFailureContinuation<T, TD> = (message: string, detail?: TD) => DetailedResult<T, TD>;
|
|
429
460
|
/**
|
|
430
|
-
* A {@link DetailedSuccess} extends {@link Success} to report optional success
|
|
431
|
-
* addition to the error message.
|
|
461
|
+
* A {@link DetailedSuccess | DetailedSuccess} extends {@link Success | Success} to report optional success
|
|
462
|
+
* details in addition to the error message.
|
|
432
463
|
* @public
|
|
433
464
|
*/
|
|
434
465
|
export declare class DetailedSuccess<T, TD> extends Success<T> {
|
|
@@ -480,28 +511,33 @@ export declare class DetailedSuccess<T, TD> extends Success<T> {
|
|
|
480
511
|
* {@inheritdoc Success.withErrorFormat}
|
|
481
512
|
*/
|
|
482
513
|
withErrorFormat(cb: ErrorFormatter): DetailedResult<T, TD>;
|
|
514
|
+
/**
|
|
515
|
+
* Creates a {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value and
|
|
516
|
+
* optional detail.
|
|
517
|
+
*/
|
|
518
|
+
static with<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD>;
|
|
483
519
|
}
|
|
484
520
|
/**
|
|
485
|
-
* A {@link DetailedFailure} extends {@link Failure} to report optional
|
|
486
|
-
* addition to the error message.
|
|
521
|
+
* A {@link DetailedFailure | DetailedFailure<T, TD>} extends {@link Failure | Failure<T>} to report optional
|
|
522
|
+
* failure details in addition to the error message.
|
|
487
523
|
* @public
|
|
488
524
|
*/
|
|
489
525
|
export declare class DetailedFailure<T, TD> extends Failure<T> {
|
|
490
526
|
/**
|
|
491
527
|
* @internal
|
|
492
528
|
*/
|
|
493
|
-
protected _detail
|
|
529
|
+
protected _detail?: TD;
|
|
494
530
|
/**
|
|
495
531
|
* Constructs a new {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied
|
|
496
532
|
* message and detail.
|
|
497
533
|
* @param message - The message to be returned.
|
|
498
534
|
* @param detail - The error detail to be returned.
|
|
499
535
|
*/
|
|
500
|
-
constructor(message: string, detail
|
|
536
|
+
constructor(message: string, detail?: TD);
|
|
501
537
|
/**
|
|
502
538
|
* The error detail associated with this {@link DetailedFailure}.
|
|
503
539
|
*/
|
|
504
|
-
get detail(): TD;
|
|
540
|
+
get detail(): TD | undefined;
|
|
505
541
|
/**
|
|
506
542
|
* Reports that this {@link DetailedFailure} is a failure.
|
|
507
543
|
* @remarks
|
|
@@ -533,6 +569,16 @@ export declare class DetailedFailure<T, TD> extends Failure<T> {
|
|
|
533
569
|
* {@inheritdoc IResult.withErrorFormat}
|
|
534
570
|
*/
|
|
535
571
|
withErrorFormat(cb: ErrorFormatter<TD>): DetailedResult<T, TD>;
|
|
572
|
+
/**
|
|
573
|
+
* Creates a {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error message
|
|
574
|
+
* and optional detail.
|
|
575
|
+
* @param message - The error message to be returned.
|
|
576
|
+
* @param detail - The error detail to be returned.
|
|
577
|
+
* @returns The resulting {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied
|
|
578
|
+
* error message and detail.
|
|
579
|
+
* @public
|
|
580
|
+
*/
|
|
581
|
+
static with<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD>;
|
|
536
582
|
}
|
|
537
583
|
/**
|
|
538
584
|
* Type inference to determine the result type `T` of a {@link DetailedResult | DetailedResult<T, TD>}.
|
|
@@ -551,18 +597,35 @@ export type ResultDetailType<T> = T extends DetailedResult<unknown, infer TD> ?
|
|
|
551
597
|
* @param detail - An optional detail of type `<TD>` to be returned.
|
|
552
598
|
* @returns A {@link DetailedSuccess | DetailedSuccess<T, TD>} with the supplied value
|
|
553
599
|
* and detail, if supplied.
|
|
600
|
+
* @remarks
|
|
601
|
+
* The `succeedsWithDetail` alias was added in release 5.0 for
|
|
602
|
+
* naming consistency with {@link fails | fails}, which was added to avoid conflicts
|
|
603
|
+
* with test frameworks and libraries.
|
|
554
604
|
* @public
|
|
555
605
|
*/
|
|
556
606
|
export declare function succeedWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD>;
|
|
607
|
+
/**
|
|
608
|
+
* {@inheritdoc succeedWithDetail}
|
|
609
|
+
* @public
|
|
610
|
+
*/
|
|
611
|
+
export declare function succeedsWithDetail<T, TD>(value: T, detail?: TD): DetailedSuccess<T, TD>;
|
|
557
612
|
/**
|
|
558
613
|
* Returns {@link DetailedFailure | DetailedFailure<T, TD>} with a supplied error message and detail.
|
|
559
614
|
* @param message - The error message to be returned.
|
|
560
615
|
* @param detail - The event detail to be returned.
|
|
561
616
|
* @returns An {@link DetailedFailure | DetailedFailure<T, TD>} with the supplied error
|
|
562
617
|
* message and detail.
|
|
618
|
+
* @remarks
|
|
619
|
+
* The `failsWithDetail` alias was added in release 5.0 for naming consistency
|
|
620
|
+
* with {@link fails | fails}, which was added to avoid conflicts with test frameworks and libraries.
|
|
621
|
+
* @public
|
|
622
|
+
*/
|
|
623
|
+
export declare function failWithDetail<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD>;
|
|
624
|
+
/**
|
|
625
|
+
* {@inheritdoc failWithDetail}
|
|
563
626
|
* @public
|
|
564
627
|
*/
|
|
565
|
-
export declare function
|
|
628
|
+
export declare function failsWithDetail<T, TD>(message: string, detail?: TD): DetailedFailure<T, TD>;
|
|
566
629
|
/**
|
|
567
630
|
* Propagates a {@link Success} or {@link Failure} {@link Result}, adding supplied
|
|
568
631
|
* event details as appropriate.
|
|
@@ -1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