@fgv/ts-utils 3.0.0 → 3.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ts-utils.d.ts +419 -270
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/packlets/conversion/baseConverter.d.ts +120 -0
- package/lib/packlets/conversion/baseConverter.d.ts.map +1 -0
- package/lib/packlets/conversion/baseConverter.js +233 -0
- package/lib/packlets/conversion/baseConverter.js.map +1 -0
- package/lib/packlets/conversion/converter.d.ts +27 -104
- package/lib/packlets/conversion/converter.d.ts.map +1 -1
- package/lib/packlets/conversion/converter.js +0 -215
- package/lib/packlets/conversion/converter.js.map +1 -1
- package/lib/packlets/conversion/converters.d.ts +138 -124
- package/lib/packlets/conversion/converters.d.ts.map +1 -1
- package/lib/packlets/conversion/converters.js +98 -94
- package/lib/packlets/conversion/converters.js.map +1 -1
- package/lib/packlets/conversion/defaultingConverter.d.ts +86 -0
- package/lib/packlets/conversion/defaultingConverter.d.ts.map +1 -0
- package/lib/packlets/conversion/defaultingConverter.js +146 -0
- package/lib/packlets/conversion/defaultingConverter.js.map +1 -0
- package/lib/packlets/conversion/index.d.ts +2 -0
- package/lib/packlets/conversion/index.d.ts.map +1 -1
- package/lib/packlets/conversion/index.js +2 -0
- package/lib/packlets/conversion/index.js.map +1 -1
- package/lib/packlets/conversion/objectConverter.d.ts +5 -3
- package/lib/packlets/conversion/objectConverter.d.ts.map +1 -1
- package/lib/packlets/conversion/objectConverter.js +2 -2
- package/lib/packlets/conversion/objectConverter.js.map +1 -1
- package/lib/packlets/conversion/stringConverter.d.ts +2 -1
- package/lib/packlets/conversion/stringConverter.d.ts.map +1 -1
- package/lib/packlets/conversion/stringConverter.js +2 -2
- package/lib/packlets/conversion/stringConverter.js.map +1 -1
- package/lib/packlets/validation/genericValidator.d.ts +4 -0
- package/lib/packlets/validation/genericValidator.d.ts.map +1 -1
- package/lib/packlets/validation/genericValidator.js +10 -0
- package/lib/packlets/validation/genericValidator.js.map +1 -1
- package/lib/packlets/validation/index.d.ts +1 -1
- package/lib/packlets/validation/index.d.ts.map +1 -1
- package/lib/packlets/validation/index.js +2 -2
- package/lib/packlets/validation/index.js.map +1 -1
- package/lib/packlets/validation/validator.d.ts +12 -2
- package/lib/packlets/validation/validator.d.ts.map +1 -1
- package/lib/packlets/validation/validator.js.map +1 -1
- package/package.json +13 -13
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TypeGuardWithContext, Validator } from '../validation';
|
|
2
|
-
import { Converter } from './converter';
|
|
2
|
+
import { Converter, OnError } from './converter';
|
|
3
3
|
import { FieldConverters, ObjectConverter, ObjectConverterOptions } from './objectConverter';
|
|
4
4
|
import { StringConverter } from './stringConverter';
|
|
5
5
|
/**
|
|
6
|
-
* Action to take on conversion failures.
|
|
6
|
+
* Action to take on conversion failures (deprecated - use Conversion.OnError)
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated use Conversion.OnError.
|
|
8
9
|
*/
|
|
9
|
-
export
|
|
10
|
+
export { OnError };
|
|
10
11
|
/**
|
|
11
12
|
* A converter to convert unknown to string. Values of type
|
|
12
13
|
* string succeed. Anything else fails.
|
|
@@ -20,23 +21,23 @@ export declare const string: StringConverter;
|
|
|
20
21
|
* @remarks
|
|
21
22
|
* Template conversions are applied using `mustache` syntax.
|
|
22
23
|
* @param defaultContext - Optional default context to use for template values.
|
|
23
|
-
* @returns A new {@link Converter} returning `string`.
|
|
24
|
+
* @returns A new {@link Converter | Converter} returning `string`.
|
|
24
25
|
* @public
|
|
25
26
|
*/
|
|
26
27
|
export declare function templateString(defaultContext?: unknown): StringConverter<string, unknown>;
|
|
27
28
|
/**
|
|
28
|
-
* Helper function to create a {@link Converter} which converts `unknown` to one of a set of supplied
|
|
29
|
+
* Helper function to create a {@link Converter | Converter} which converts `unknown` to one of a set of supplied
|
|
29
30
|
* enumerated values. Anything else fails.
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
33
|
* Allowed enumerated values can also be supplied as context at conversion time.
|
|
33
34
|
* @param values - Array of allowed values.
|
|
34
|
-
* @returns A new {@link Converter} returning `<T>`.
|
|
35
|
+
* @returns A new {@link Converter | Converter} returning `<T>`.
|
|
35
36
|
* @public
|
|
36
37
|
*/
|
|
37
38
|
export declare function enumeratedValue<T>(values: T[]): Converter<T, T[]>;
|
|
38
39
|
/**
|
|
39
|
-
* Helper function to create a {@link Converter} which converts `unknown` to one of a set of supplied enumerated
|
|
40
|
+
* Helper function to create a {@link Converter | Converter} which converts `unknown` to one of a set of supplied enumerated
|
|
40
41
|
* values, mapping any of multiple supplied values to the enumeration.
|
|
41
42
|
* @remarks
|
|
42
43
|
* Enables mapping of multiple input values to a consistent internal representation (so e.g. `'y'`, `'yes'`,
|
|
@@ -45,15 +46,15 @@ export declare function enumeratedValue<T>(values: T[]): Converter<T, T[]>;
|
|
|
45
46
|
* value, the second is the set of values that map to the result. Tuples are evaluated in the order
|
|
46
47
|
* supplied and are not checked for duplicates.
|
|
47
48
|
* @param message - An optional error message.
|
|
48
|
-
* @returns A {@link Converter} which applies the mapping and yields `<T>` on success.
|
|
49
|
+
* @returns A {@link Converter | Converter} which applies the mapping and yields `<T>` on success.
|
|
49
50
|
* @public
|
|
50
51
|
*/
|
|
51
52
|
export declare function mappedEnumeratedValue<T>(map: [T, unknown[]][], message?: string): Converter<T, undefined>;
|
|
52
53
|
/**
|
|
53
|
-
* Helper function to create a {@link Converter} which converts `unknown` to some supplied literal value. Succeeds with
|
|
54
|
+
* Helper function to create a {@link Converter | Converter} which converts `unknown` to some supplied literal value. Succeeds with
|
|
54
55
|
* the supplied value if an identity comparison succeeds, fails otherwise.
|
|
55
56
|
* @param value - The value to be compared.
|
|
56
|
-
* @returns A {@link Converter} which returns the supplied value on success.
|
|
57
|
+
* @returns A {@link Converter | Converter} which returns the supplied value on success.
|
|
57
58
|
* @public
|
|
58
59
|
*/
|
|
59
60
|
export declare function literal<T>(value: T): Converter<T, unknown>;
|
|
@@ -65,14 +66,14 @@ export declare function literal<T>(value: T): Converter<T, unknown>;
|
|
|
65
66
|
*/
|
|
66
67
|
export declare const value: typeof literal;
|
|
67
68
|
/**
|
|
68
|
-
* A {@link Converter} which converts `unknown` to a `number`.
|
|
69
|
+
* A {@link Converter | Converter} which converts `unknown` to a `number`.
|
|
69
70
|
* @remarks
|
|
70
71
|
* Numbers and strings with a numeric format succeed. Anything else fails.
|
|
71
72
|
* @public
|
|
72
73
|
*/
|
|
73
74
|
export declare const number: Converter<number, undefined>;
|
|
74
75
|
/**
|
|
75
|
-
* A {@link Converter} which converts `unknown` to `boolean`.
|
|
76
|
+
* A {@link Converter | Converter} which converts `unknown` to `boolean`.
|
|
76
77
|
* @remarks
|
|
77
78
|
* Boolean values or the case-insensitive strings `'true'` and `'false'` succeed.
|
|
78
79
|
* Anything else fails.
|
|
@@ -80,93 +81,96 @@ export declare const number: Converter<number, undefined>;
|
|
|
80
81
|
*/
|
|
81
82
|
export declare const boolean: Converter<boolean, undefined>;
|
|
82
83
|
/**
|
|
83
|
-
* A {@link Converter} which converts an optional `string` value. Values of type
|
|
84
|
-
* `string` are returned. Anything else returns {@link Success} with value `undefined`.
|
|
84
|
+
* A {@link Converter | Converter} which converts an optional `string` value. Values of type
|
|
85
|
+
* `string` are returned. Anything else returns {@link Success | Success} with value `undefined`.
|
|
85
86
|
* @public
|
|
86
87
|
*/
|
|
87
88
|
export declare const optionalString: Converter<string | undefined, unknown>;
|
|
88
89
|
/**
|
|
89
|
-
* Helper function to create a {@link Converter} which converts any `string` into an
|
|
90
|
+
* Helper function to create a {@link Converter | Converter} which converts any `string` into an
|
|
90
91
|
* array of `string`, by separating at a supplied delimiter.
|
|
91
92
|
* @remarks
|
|
92
93
|
* Delimiter may also be supplied as context at conversion time.
|
|
93
94
|
* @param delimiter - The delimiter at which to split.
|
|
94
|
-
* @returns A new {@link Converter} returning `string[]`.
|
|
95
|
+
* @returns A new {@link Converter | Converter} returning `string[]`.
|
|
95
96
|
* @public
|
|
96
97
|
*/
|
|
97
98
|
export declare function delimitedString(delimiter: string, options?: 'filtered' | 'all'): Converter<string[], string>;
|
|
98
99
|
/**
|
|
99
|
-
* A {@link Converter} which converts an iso formatted string, a number or a `Date` object to
|
|
100
|
+
* A {@link Converter | Converter} which converts an iso formatted string, a number or a `Date` object to
|
|
100
101
|
* a `Date` object.
|
|
101
102
|
* @public
|
|
102
103
|
*/
|
|
103
104
|
export declare const isoDate: Converter<Date, unknown>;
|
|
104
105
|
/**
|
|
105
|
-
* Helper function to create a {@link Converter} from any {@link Validation.Validator}
|
|
106
|
+
* Helper function to create a {@link Converter | Converter} from any {@link Validation.Validator}
|
|
106
107
|
* @param validator - the validator to be wrapped
|
|
107
|
-
* @returns A {@link Converter} which uses the supplied validator.
|
|
108
|
+
* @returns A {@link Converter | Converter} which uses the supplied validator.
|
|
108
109
|
* @public
|
|
109
110
|
*/
|
|
110
111
|
export declare function validated<T, TC = unknown>(validator: Validator<T, TC>): Converter<T, TC>;
|
|
111
112
|
/**
|
|
112
|
-
* Helper function to create a {@link Converter} from a supplied type guard function.
|
|
113
|
+
* Helper function to create a {@link Converter | Converter} from a supplied type guard function.
|
|
113
114
|
* @param description - a description of the thing to be validated for use in error messages
|
|
114
115
|
* @param guard - a {@link Validation.TypeGuardWithContext} which performs the validation.
|
|
115
|
-
* @returns A new {@link Converter} which validates the values using the supplied type guard
|
|
116
|
+
* @returns A new {@link Converter | Converter} which validates the values using the supplied type guard
|
|
116
117
|
* and returns them in place.
|
|
117
118
|
* @public
|
|
118
119
|
*/
|
|
119
120
|
export declare function isA<T, TC = unknown>(description: string, guard: TypeGuardWithContext<T, TC>): Converter<T, TC>;
|
|
120
121
|
/**
|
|
121
|
-
* A {@link Converter} which converts an optional `number` value.
|
|
122
|
+
* A {@link Converter | Converter} which converts an optional `number` value.
|
|
122
123
|
* @remarks
|
|
123
124
|
* Values of type `number` or numeric strings are converted and returned.
|
|
124
|
-
* Anything else returns {@link Success} with value `undefined`.
|
|
125
|
+
* Anything else returns {@link Success | Success} with value `undefined`.
|
|
125
126
|
* @public
|
|
126
127
|
*/
|
|
127
128
|
export declare const optionalNumber: Converter<number | undefined>;
|
|
128
129
|
/**
|
|
129
|
-
* A {@link Converter} to convert an optional `boolean` value.
|
|
130
|
+
* A {@link Converter | Converter} to convert an optional `boolean` value.
|
|
130
131
|
* @remarks
|
|
131
132
|
* Values of type `boolean` or strings that match (case-insensitive) `'true'`
|
|
132
|
-
* or `'false'` are converted and returned. Anything else returns {@link Success}
|
|
133
|
+
* or `'false'` are converted and returned. Anything else returns {@link Success | Success}
|
|
133
134
|
* with value `undefined`.
|
|
134
135
|
* @public
|
|
135
136
|
*/
|
|
136
137
|
export declare const optionalBoolean: Converter<boolean | undefined>;
|
|
137
138
|
/**
|
|
138
|
-
* A helper function to create a {@link Converter} for polymorphic values.
|
|
139
|
-
* converter which
|
|
140
|
-
* result. Returns an error if none of the supplied converters can
|
|
139
|
+
* A helper function to create a {@link Converter | Converter} for polymorphic values.
|
|
140
|
+
* Returns a converter which invokes the wrapped converters in sequence, returning the
|
|
141
|
+
* first successful result. Returns an error if none of the supplied converters can
|
|
142
|
+
* convert the value.
|
|
141
143
|
* @remarks
|
|
142
144
|
* If `onError` is `ignoreErrors` (default), then errors from any of the
|
|
143
145
|
* converters are ignored provided that some converter succeeds. If
|
|
144
146
|
* onError is `failOnError`, then an error from any converter fails the entire
|
|
145
147
|
* conversion.
|
|
146
148
|
*
|
|
147
|
-
* @param converters - An ordered list of {@link Converter | converters}
|
|
149
|
+
* @param converters - An ordered list of {@link Converter | converters} or {@link Validator | validators}
|
|
150
|
+
* to be considered.
|
|
148
151
|
* @param onError - Specifies treatment of unconvertible elements.
|
|
149
|
-
* @returns A new {@link Converter} which yields a value from the union of the types returned
|
|
152
|
+
* @returns A new {@link Converter | Converter} which yields a value from the union of the types returned
|
|
150
153
|
* by the wrapped converters.
|
|
151
154
|
* @public
|
|
152
155
|
*/
|
|
153
|
-
export declare function oneOf<T, TC = unknown>(converters: Array<Converter<T, TC>>, onError?: OnError): Converter<T, TC>;
|
|
156
|
+
export declare function oneOf<T, TC = unknown>(converters: Array<Converter<T, TC> | Validator<T, TC>>, onError?: OnError): Converter<T, TC>;
|
|
154
157
|
/**
|
|
155
|
-
* A helper function to create a {@link Converter} which converts `unknown` to an array of `<T>`.
|
|
158
|
+
* A helper function to create a {@link Converter | Converter} which converts `unknown` to an array of `<T>`.
|
|
156
159
|
* @remarks
|
|
157
160
|
* If `onError` is `'failOnError'` (default), then the entire conversion fails if any element cannot
|
|
158
161
|
* be converted. If `onError` is `'ignoreErrors'`, then failing elements are silently ignored.
|
|
159
|
-
* @param converter - {@link Converter} used to convert each
|
|
162
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} used to convert each
|
|
163
|
+
* item in the array.
|
|
160
164
|
* @param ignoreErrors - Specifies treatment of unconvertible elements.
|
|
161
|
-
* @returns A {@link Converter} which returns an array of `<T>`.
|
|
165
|
+
* @returns A {@link Converter | Converter} which returns an array of `<T>`.
|
|
162
166
|
* @public
|
|
163
167
|
*/
|
|
164
|
-
export declare function arrayOf<T, TC = undefined>(converter: Converter<T, TC>, onError?: OnError): Converter<T[], TC>;
|
|
168
|
+
export declare function arrayOf<T, TC = undefined>(converter: Converter<T, TC> | Validator<T, TC>, onError?: OnError): Converter<T[], TC>;
|
|
165
169
|
/**
|
|
166
|
-
* {@link Converter} to convert an `unknown` to an array of `string`.
|
|
170
|
+
* {@link Converter | Converter} to convert an `unknown` to an array of `string`.
|
|
167
171
|
* @remarks
|
|
168
|
-
* Returns {@link Success} with the the supplied value if it as an array
|
|
169
|
-
* of strings, returns {@link Failure} with an error message otherwise.
|
|
172
|
+
* Returns {@link Success | Success} with the the supplied value if it as an array
|
|
173
|
+
* of strings, returns {@link Failure | Failure} with an error message otherwise.
|
|
170
174
|
* @public
|
|
171
175
|
*/
|
|
172
176
|
export declare const stringArray: Converter<string[]>;
|
|
@@ -196,90 +200,99 @@ export interface KeyedConverterOptions<T extends string = string, TC = undefined
|
|
|
196
200
|
* @remarks
|
|
197
201
|
* Can be used to coerce key names to supported values and/or strong types.
|
|
198
202
|
*/
|
|
199
|
-
keyConverter?: Converter<T, TC>;
|
|
203
|
+
keyConverter?: Converter<T, TC> | Validator<T, TC>;
|
|
200
204
|
}
|
|
201
205
|
/**
|
|
202
|
-
* A helper function to create a {@link Converter} which converts the `string`-keyed
|
|
203
|
-
* using a supplied {@link Converter | Converter<T>}
|
|
206
|
+
* A helper function to create a {@link Converter | Converter} which converts the `string`-keyed
|
|
207
|
+
* properties using a supplied {@link Converter | Converter<T>} or {@link Validator | Validator<T>} to
|
|
208
|
+
* produce a `Record<string, T>`.
|
|
204
209
|
* @remarks
|
|
205
210
|
* The resulting converter fails conversion if any element cannot be converted.
|
|
206
|
-
* @param converter - {@link Converter}
|
|
207
|
-
*
|
|
211
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} used for each
|
|
212
|
+
* item in the source object.
|
|
213
|
+
* @returns A {@link Converter | Converter} which returns `Record<string, T>`.
|
|
208
214
|
* {@label WITH_DEFAULT}
|
|
209
215
|
* @public
|
|
210
216
|
*/
|
|
211
|
-
export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>): Converter<Record<TK, T>, TC>;
|
|
217
|
+
export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC> | Validator<T, TC>): Converter<Record<TK, T>, TC>;
|
|
212
218
|
/**
|
|
213
|
-
* A helper function to create a {@link Converter} which converts the `string`-keyed properties
|
|
214
|
-
* using a supplied {@link Converter | Converter<T>}
|
|
215
|
-
* specified handling of elements that cannot be converted.
|
|
219
|
+
* A helper function to create a {@link Converter | Converter} which converts the `string`-keyed properties
|
|
220
|
+
* using a supplied {@link Converter | Converter<T>} or {@link Validator | Validator<T>} to produce a
|
|
221
|
+
* `Record<string, T>` and optionally specified handling of elements that cannot be converted.
|
|
216
222
|
* @remarks
|
|
217
223
|
* if `onError` is `'fail'` (default), then the entire conversion fails if any key or element
|
|
218
224
|
* cannot be converted. If `onError` is `'ignore'`, failing elements are silently ignored.
|
|
219
|
-
* @param converter - {@link Converter}
|
|
220
|
-
*
|
|
225
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} for each item in
|
|
226
|
+
* the source object.
|
|
227
|
+
* @returns A {@link Converter | Converter} which returns `Record<string, T>`.
|
|
221
228
|
* {@label WITH_ON_ERROR}
|
|
222
229
|
* @public
|
|
223
230
|
*/
|
|
224
|
-
export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, onError: 'fail' | 'ignore'): Converter<Record<TK, T>, TC>;
|
|
231
|
+
export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC> | Validator<T, TC>, onError: 'fail' | 'ignore'): Converter<Record<TK, T>, TC>;
|
|
225
232
|
/**
|
|
226
|
-
* A helper function to create a {@link Converter} which converts the `string`-keyed properties
|
|
227
|
-
* using a supplied {@link Converter | Converter<T>} to produce a
|
|
233
|
+
* A helper function to create a {@link Converter | Converter} or which converts the `string`-keyed properties
|
|
234
|
+
* using a supplied {@link Converter | Converter<T>} or {@link Validator | Validator<T>} to produce a
|
|
235
|
+
* `Record<TK, T>`.
|
|
228
236
|
* @remarks
|
|
229
237
|
* If present, the supplied {@link Converters.KeyedConverterOptions | options} can provide a strongly-typed
|
|
230
238
|
* converter for keys and/or control the handling of elements that fail conversion.
|
|
231
|
-
* @param converter - {@link Converter} used
|
|
239
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} used for each item in the source object.
|
|
232
240
|
* @param options - Optional {@link Converters.KeyedConverterOptions | KeyedConverterOptions<TK, TC>} which
|
|
233
241
|
* supplies a key converter and/or error-handling options.
|
|
234
|
-
* @returns A {@link Converter} which returns `Record<TK, T>`.
|
|
242
|
+
* @returns A {@link Converter | Converter} which returns `Record<TK, T>`.
|
|
235
243
|
* {@label WITH_OPTIONS}
|
|
236
244
|
* @public
|
|
237
245
|
*/
|
|
238
|
-
export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, options: KeyedConverterOptions<TK, TC>): Converter<Record<TK, T>, TC>;
|
|
246
|
+
export declare function recordOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC> | Validator<T, TC>, options: KeyedConverterOptions<TK, TC>): Converter<Record<TK, T>, TC>;
|
|
239
247
|
/**
|
|
240
|
-
* A helper function to create a {@link Converter} which converts the `string`-keyed properties
|
|
241
|
-
* using a supplied {@link Converter | Converter<T>} to produce a
|
|
248
|
+
* A helper function to create a {@link Converter | Converter} which converts the `string`-keyed properties
|
|
249
|
+
* using a supplied {@link Converter | Converter<T>} or {@link Validator | Validator<T>} to produce a
|
|
250
|
+
* `Map<string, T>`.
|
|
242
251
|
* @remarks
|
|
243
252
|
* The resulting converter fails conversion if any element cannot be converted.
|
|
244
|
-
* @param converter - {@link Converter} used
|
|
245
|
-
*
|
|
253
|
+
* @param converter - {@link Converter | Converter} | {@link Validator | Validator} used for each item in
|
|
254
|
+
* the source object.
|
|
255
|
+
* @returns A {@link Converter | Converter} which returns `Map<string, T>`.
|
|
246
256
|
* {@label WITH_DEFAULT}
|
|
247
257
|
* @public
|
|
248
258
|
*/
|
|
249
|
-
export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>): Converter<Map<TK, T>, TC>;
|
|
259
|
+
export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC> | Validator<T, TC>): Converter<Map<TK, T>, TC>;
|
|
250
260
|
/**
|
|
251
|
-
* A helper function to create a {@link Converter} which converts the `string`-keyed properties
|
|
252
|
-
* using a supplied {@link Converter | Converter<T>}
|
|
253
|
-
* specified handling of elements that cannot be converted.
|
|
261
|
+
* A helper function to create a {@link Converter | Converter} which converts the `string`-keyed properties
|
|
262
|
+
* using a supplied {@link Converter | Converter<T>} or {@link Validator | Validator<T>} to produce a
|
|
263
|
+
* `Map<string, T>` and specified handling of elements that cannot be converted.
|
|
254
264
|
* @remarks
|
|
255
265
|
* if `onError` is `'fail'` (default), then the entire conversion fails if any key or element
|
|
256
266
|
* cannot be converted. If `onError` is `'ignore'`, failing elements are silently ignored.
|
|
257
|
-
* @param converter - {@link Converter
|
|
258
|
-
*
|
|
267
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} used for
|
|
268
|
+
* each item in the source object.
|
|
269
|
+
* @returns A {@link Converter | Converter} which returns `Map<string, T>`.
|
|
259
270
|
* {@label WITH_ON_ERROR}
|
|
260
271
|
* @public
|
|
261
272
|
*/
|
|
262
|
-
export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, onError: 'fail' | 'ignore'): Converter<Map<TK, T>, TC>;
|
|
273
|
+
export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC> | Validator<T, TC>, onError: 'fail' | 'ignore'): Converter<Map<TK, T>, TC>;
|
|
263
274
|
/**
|
|
264
|
-
* A helper function to create a {@link Converter} which converts the `string`-keyed properties
|
|
265
|
-
* using a supplied {@link Converter | Converter<T>}
|
|
275
|
+
* A helper function to create a {@link Converter | Converter} which converts the `string`-keyed properties
|
|
276
|
+
* using a supplied {@link Converter | Converter<T>} or {@link Validator | Validator<T>} to produce
|
|
277
|
+
* a `Map<TK,T>`.
|
|
266
278
|
* @remarks
|
|
267
279
|
* If present, the supplied {@link Converters.KeyedConverterOptions | options} can provide a strongly-typed
|
|
268
280
|
* converter for keys and/or control the handling of elements that fail conversion.
|
|
269
|
-
* @param converter - {@link Converter}
|
|
281
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} used for each item
|
|
282
|
+
* in the source object.
|
|
270
283
|
* @param options - Optional {@link Converters.KeyedConverterOptions | KeyedConverterOptions<TK, TC>} which
|
|
271
284
|
* supplies a key converter and/or error-handling options.
|
|
272
|
-
* @returns A {@link Converter} which returns `Map<TK,
|
|
285
|
+
* @returns A {@link Converter | Converter} which returns `Map<TK,T>`.
|
|
273
286
|
* {@label WITH_OPTIONS}
|
|
274
287
|
* @public
|
|
275
288
|
*/
|
|
276
|
-
export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC>, options: KeyedConverterOptions<TK, TC>): Converter<Map<TK, T>, TC>;
|
|
289
|
+
export declare function mapOf<T, TC = undefined, TK extends string = string>(converter: Converter<T, TC> | Validator<T, TC>, options: KeyedConverterOptions<TK, TC>): Converter<Map<TK, T>, TC>;
|
|
277
290
|
/**
|
|
278
|
-
* Helper function to create a {@link Converter} which validates that a supplied value is
|
|
291
|
+
* Helper function to create a {@link Converter | Converter} which validates that a supplied value is
|
|
279
292
|
* of a type validated by a supplied validator function and returns it.
|
|
280
293
|
* @remarks
|
|
281
|
-
* If `validator` succeeds, this {@link Converter} returns {@link Success} with the supplied
|
|
282
|
-
* value of `from` coerced to type `<T>`. Returns a {@link Failure} with additional
|
|
294
|
+
* If `validator` succeeds, this {@link Converter | Converter} returns {@link Success | Success} with the supplied
|
|
295
|
+
* value of `from` coerced to type `<T>`. Returns a {@link Failure | Failure} with additional
|
|
283
296
|
* information otherwise.
|
|
284
297
|
* @param validator - A validator function to determine if the converted value is valid.
|
|
285
298
|
* @param description - A description of the validated type for use in error messages.
|
|
@@ -288,62 +301,63 @@ export declare function mapOf<T, TC = undefined, TK extends string = string>(con
|
|
|
288
301
|
*/
|
|
289
302
|
export declare function validateWith<T, TC = undefined>(validator: (from: unknown) => from is T, description?: string): Converter<T, TC>;
|
|
290
303
|
/**
|
|
291
|
-
* A helper function to create a {@link Converter} which extracts and converts an element from an array.
|
|
304
|
+
* A helper function to create a {@link Converter | Converter} which extracts and converts an element from an array.
|
|
292
305
|
* @remarks
|
|
293
|
-
* The returned {@link Converter} returns {@link Success} with the converted value if the element exists
|
|
294
|
-
* in the supplied array and can be converted. Returns {@link Failure} with an error message otherwise.
|
|
306
|
+
* The returned {@link Converter | Converter} returns {@link Success | Success} with the converted value if the element exists
|
|
307
|
+
* in the supplied array and can be converted. Returns {@link Failure | Failure} with an error message otherwise.
|
|
295
308
|
* @param index - The index of the element to be extracted.
|
|
296
|
-
* @param converter - A {@link Converter}
|
|
309
|
+
* @param converter - A {@link Converter | Converter} or {@link Validator | Validator} for the extracted element.
|
|
297
310
|
* @returns A {@link Converter | Converter<T>} which extracts the specified element from an array.
|
|
298
311
|
* @public
|
|
299
312
|
*/
|
|
300
|
-
export declare function element<T, TC = undefined>(index: number, converter: Converter<T, TC>): Converter<T, TC>;
|
|
313
|
+
export declare function element<T, TC = undefined>(index: number, converter: Converter<T, TC> | Validator<T, TC>): Converter<T, TC>;
|
|
301
314
|
/**
|
|
302
|
-
* A helper function to create a {@link Converter} which extracts and converts an optional element from an array.
|
|
315
|
+
* A helper function to create a {@link Converter | Converter} which extracts and converts an optional element from an array.
|
|
303
316
|
* @remarks
|
|
304
|
-
* The resulting {@link Converter} returns {@link Success} with the converted value if the element exists
|
|
305
|
-
* in the supplied array and can be converted. Returns {@link Success} with value `undefined` if the parameter
|
|
306
|
-
* is an array but the index is out of range. Returns {@link Failure} with a message if the supplied parameter
|
|
317
|
+
* The resulting {@link Converter | Converter} returns {@link Success | Success} with the converted value if the element exists
|
|
318
|
+
* in the supplied array and can be converted. Returns {@link Success | Success} with value `undefined` if the parameter
|
|
319
|
+
* is an array but the index is out of range. Returns {@link Failure | Failure} with a message if the supplied parameter
|
|
307
320
|
* is not an array, if the requested index is negative, or if the element cannot be converted.
|
|
308
321
|
* @param index - The index of the element to be extracted.
|
|
309
|
-
* @param converter - A {@link Converter} used
|
|
322
|
+
* @param converter - A {@link Converter | Converter} or {@link Validator | Validator} used for the extracted element.
|
|
310
323
|
* @returns A {@link Converter | Converter<T>} which extracts the specified element from an array.
|
|
311
324
|
* @public
|
|
312
325
|
*/
|
|
313
|
-
export declare function optionalElement<T, TC = undefined>(index: number, converter: Converter<T, TC>): Converter<T | undefined, TC>;
|
|
326
|
+
export declare function optionalElement<T, TC = undefined>(index: number, converter: Converter<T, TC> | Validator<T, TC>): Converter<T | undefined, TC>;
|
|
314
327
|
/**
|
|
315
|
-
* A helper function to create a {@link Converter} which extracts and convert a property specified
|
|
328
|
+
* A helper function to create a {@link Converter | Converter} which extracts and convert a property specified
|
|
316
329
|
* by name from an object.
|
|
317
330
|
* @remarks
|
|
318
|
-
* The resulting {@link Converter} returns {@link Success} with the converted value of the corresponding
|
|
319
|
-
* object property if the field exists and can be converted. Returns {@link Failure} with an error message
|
|
331
|
+
* The resulting {@link Converter | Converter} returns {@link Success | Success} with the converted value of the corresponding
|
|
332
|
+
* object property if the field exists and can be converted. Returns {@link Failure | Failure} with an error message
|
|
320
333
|
* otherwise.
|
|
321
334
|
* @param name - The name of the field to be extracted.
|
|
322
|
-
* @param converter - {@link Converter}
|
|
335
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} to use for the extracted
|
|
336
|
+
* field.
|
|
323
337
|
* @public
|
|
324
338
|
*/
|
|
325
|
-
export declare function field<T, TC = undefined>(name: string, converter: Converter<T, TC>): Converter<T, TC>;
|
|
339
|
+
export declare function field<T, TC = undefined>(name: string, converter: Converter<T, TC> | Validator<T, TC>): Converter<T, TC>;
|
|
326
340
|
/**
|
|
327
|
-
* A helper function to create a {@link Converter} which extracts and convert a property specified
|
|
341
|
+
* A helper function to create a {@link Converter | Converter} which extracts and convert a property specified
|
|
328
342
|
* by name from an object.
|
|
329
343
|
* @remarks
|
|
330
|
-
* The resulting {@link Converter} returns {@link Success} with the converted value of
|
|
331
|
-
* object property if the field exists and can be converted. Returns {@link Success
|
|
332
|
-
* if the supplied parameter is an object but the named field is not present.
|
|
333
|
-
* an error message otherwise.
|
|
344
|
+
* The resulting {@link Converter | Converter} returns {@link Success | Success} with the converted value of
|
|
345
|
+
* the corresponding object property if the field exists and can be converted. Returns {@link Success | Success}
|
|
346
|
+
* with `undefined` if the supplied parameter is an object but the named field is not present.
|
|
347
|
+
* Returns {@link Failure | Failure} with an error message otherwise.
|
|
334
348
|
* @param name - The name of the field to be extracted.
|
|
335
|
-
* @param converter - {@link Converter}
|
|
349
|
+
* @param converter - {@link Converter | Converter} or {@link Validator | Validator} to use for the extracted field.
|
|
336
350
|
* @public
|
|
337
351
|
*/
|
|
338
|
-
export declare function optionalField<T, TC = undefined>(name: string, converter: Converter<T, TC>): Converter<T | undefined, TC>;
|
|
352
|
+
export declare function optionalField<T, TC = undefined>(name: string, converter: Converter<T, TC> | Validator<T, TC>): Converter<T | undefined, TC>;
|
|
339
353
|
/**
|
|
340
354
|
* Helper function to create a {@link Conversion.ObjectConverter | ObjectConverter<T>} which converts an object
|
|
341
355
|
* without changing shape, given a {@link Conversion.FieldConverters | FieldConverters<T>} and an optional
|
|
342
356
|
* {@link Conversion.ObjectConverterOptions | ObjectConverterOptions<T>} to further refine conversion behavior.
|
|
343
357
|
* @remarks
|
|
344
|
-
* By default, if all of the requested fields exist and can be converted, returns {@link Success}
|
|
358
|
+
* By default, if all of the requested fields exist and can be converted, returns {@link Success | Success}
|
|
345
359
|
* with a new object that contains the converted values under the original key names. If any required properties
|
|
346
|
-
* do not exist or cannot be converted, the entire conversion fails, returning {@link Failure} with additional
|
|
360
|
+
* do not exist or cannot be converted, the entire conversion fails, returning {@link Failure | Failure} with additional
|
|
347
361
|
* error information.
|
|
348
362
|
*
|
|
349
363
|
* Fields that succeed but convert to undefined are omitted from the result object but do not
|
|
@@ -362,9 +376,9 @@ export declare function object<T>(properties: FieldConverters<T>, options?: Obje
|
|
|
362
376
|
* without changing shape, given a {@link Conversion.FieldConverters | FieldConverters<T>} and a set of
|
|
363
377
|
* optional properties.
|
|
364
378
|
* @remarks
|
|
365
|
-
* By default, if all of the requested fields exist and can be converted, returns {@link Success}
|
|
379
|
+
* By default, if all of the requested fields exist and can be converted, returns {@link Success | Success}
|
|
366
380
|
* with a new object that contains the converted values under the original key names. If any required properties
|
|
367
|
-
* do not exist or cannot be converted, the entire conversion fails, returning {@link Failure} with additional
|
|
381
|
+
* do not exist or cannot be converted, the entire conversion fails, returning {@link Failure | Failure} with additional
|
|
368
382
|
* error information.
|
|
369
383
|
*
|
|
370
384
|
* Fields that succeed but convert to undefined are omitted from the result object but do not
|
|
@@ -423,36 +437,36 @@ export declare function strictObject<T>(properties: FieldConverters<T>, options?
|
|
|
423
437
|
*/
|
|
424
438
|
export declare function strictObject<T>(properties: FieldConverters<T>, optional: (keyof T)[]): ObjectConverter<T>;
|
|
425
439
|
/**
|
|
426
|
-
* A string-keyed `Record<string, Converter>` which maps specific {@link Converter | converters}
|
|
427
|
-
* value of a discriminator property.
|
|
440
|
+
* A string-keyed `Record<string, Converter>` which maps specific {@link Converter | converters} or
|
|
441
|
+
* {@link Validator | Validators} to the value of a discriminator property.
|
|
428
442
|
* @public
|
|
429
443
|
*/
|
|
430
|
-
export type DiscriminatedObjectConverters<T, TD extends string = string, TC = unknown> = Record<TD, Converter<T, TC>>;
|
|
444
|
+
export type DiscriminatedObjectConverters<T, TD extends string = string, TC = unknown> = Record<TD, Converter<T, TC> | Validator<T, TC>>;
|
|
431
445
|
/**
|
|
432
|
-
* Helper to create a {@link Converter} which converts a discriminated object without changing shape.
|
|
446
|
+
* Helper to create a {@link Converter | Converter} which converts a discriminated object without changing shape.
|
|
433
447
|
* @remarks
|
|
434
448
|
* Takes the name of the discriminator property and a
|
|
435
|
-
* {@link Converters.DiscriminatedObjectConverters | string-keyed Record of converters}. During conversion,
|
|
436
|
-
* the resulting {@link Converter} invokes the converter from `converters` that corresponds to the value of
|
|
449
|
+
* {@link Converters.DiscriminatedObjectConverters | string-keyed Record of converters and validators}. During conversion,
|
|
450
|
+
* the resulting {@link Converter | Converter} invokes the converter from `converters` that corresponds to the value of
|
|
437
451
|
* the discriminator property in the source object.
|
|
438
452
|
*
|
|
439
453
|
* If the source is not an object, the discriminator property is missing, or the discriminator has
|
|
440
|
-
* a value not present in the converters, conversion fails and returns {@link Failure} with more information.
|
|
454
|
+
* a value not present in the converters, conversion fails and returns {@link Failure | Failure} with more information.
|
|
441
455
|
* @param discriminatorProp - Name of the property used to discriminate types.
|
|
442
|
-
* @param converters - {@link Converters.DiscriminatedObjectConverters | String-keyed record of converters}
|
|
443
|
-
* invoke, where each key corresponds to a value of the discriminator property.
|
|
444
|
-
* @returns A {@link Converter} which converts the corresponding discriminated object.
|
|
456
|
+
* @param converters - {@link Converters.DiscriminatedObjectConverters | String-keyed record of converters and validators}
|
|
457
|
+
* to invoke, where each key corresponds to a value of the discriminator property.
|
|
458
|
+
* @returns A {@link Converter | Converter} which converts the corresponding discriminated object.
|
|
445
459
|
* @public
|
|
446
460
|
*/
|
|
447
461
|
export declare function discriminatedObject<T, TD extends string = string, TC = unknown>(discriminatorProp: string, converters: DiscriminatedObjectConverters<T, TD>): Converter<T, TC>;
|
|
448
462
|
/**
|
|
449
|
-
* Helper to create a {@link Converter} which converts a source object to a new object with a
|
|
463
|
+
* Helper to create a {@link Converter | Converter} which converts a source object to a new object with a
|
|
450
464
|
* different shape.
|
|
451
465
|
*
|
|
452
466
|
* @remarks
|
|
453
|
-
* On successful conversion, the resulting {@link Converter} returns {@link Success} with a new
|
|
467
|
+
* On successful conversion, the resulting {@link Converter | Converter} returns {@link Success | Success} with a new
|
|
454
468
|
* object, which contains the converted values under the key names specified at initialization time.
|
|
455
|
-
* It returns {@link Failure} with an error message if any fields to be extracted do not exist
|
|
469
|
+
* It returns {@link Failure | Failure} with an error message if any fields to be extracted do not exist
|
|
456
470
|
* or cannot be converted.
|
|
457
471
|
*
|
|
458
472
|
* Fields that succeed but convert to undefined are omitted from the result object but do not
|
|
@@ -461,7 +475,7 @@ export declare function discriminatedObject<T, TD extends string = string, TC =
|
|
|
461
475
|
* @param properties - An object with key names that correspond to the target object and an
|
|
462
476
|
* appropriate {@link Conversion.FieldConverters | FieldConverter} which extracts and converts
|
|
463
477
|
* a single filed from the source object.
|
|
464
|
-
* @returns A {@link Converter} with the specified conversion behavior.
|
|
478
|
+
* @returns A {@link Converter | Converter} with the specified conversion behavior.
|
|
465
479
|
* @public
|
|
466
480
|
*/
|
|
467
481
|
export declare function transform<T, TC = unknown>(properties: FieldConverters<T, TC>): Converter<T, TC>;
|
|
@@ -473,13 +487,13 @@ export declare function transform<T, TC = unknown>(properties: FieldConverters<T
|
|
|
473
487
|
export type FieldTransformers<TSRC, TDEST, TC = unknown> = {
|
|
474
488
|
[key in keyof TDEST]: {
|
|
475
489
|
/**
|
|
476
|
-
* The name of the property in the source object to be
|
|
490
|
+
* The name of the property in the source object to be converted.
|
|
477
491
|
*/
|
|
478
492
|
from: keyof TSRC;
|
|
479
493
|
/**
|
|
480
|
-
* The converter used to convert the property.
|
|
494
|
+
* The converter or validator used to convert the property.
|
|
481
495
|
*/
|
|
482
|
-
converter: Converter<TDEST[key], TC>;
|
|
496
|
+
converter: Converter<TDEST[key], TC> | Validator<TDEST[key], TC>;
|
|
483
497
|
/**
|
|
484
498
|
* If `true` then a missing source property is ignored. If `false` or omitted
|
|
485
499
|
* then a missing source property causes an error.
|
|
@@ -508,23 +522,23 @@ export interface TransformObjectOptions<TSRC> {
|
|
|
508
522
|
description?: string;
|
|
509
523
|
}
|
|
510
524
|
/**
|
|
511
|
-
* Helper to create a strongly-typed {@link Converter} which converts a source object to a
|
|
525
|
+
* Helper to create a strongly-typed {@link Converter | Converter} which converts a source object to a
|
|
512
526
|
* new object with a different shape.
|
|
513
527
|
*
|
|
514
528
|
* @remarks
|
|
515
|
-
* On successful conversion, the resulting {@link Converter} returns {@link Success} with a new
|
|
529
|
+
* On successful conversion, the resulting {@link Converter | Converter} returns {@link Success | Success} with a new
|
|
516
530
|
* object, which contains the converted values under the key names specified at initialization time.
|
|
517
531
|
*
|
|
518
|
-
* It returns {@link Failure} with an error message if any fields to be extracted do not exist
|
|
532
|
+
* It returns {@link Failure | Failure} with an error message if any fields to be extracted do not exist
|
|
519
533
|
* or cannot be converted.
|
|
520
534
|
*
|
|
521
535
|
* @param destinationFields - An object with key names that correspond to the target object and an
|
|
522
536
|
* appropriate {@link Converters.FieldTransformers | FieldTransformers} which specifies the name
|
|
523
|
-
* of the corresponding property in the source object, the converter used
|
|
524
|
-
* property and any configuration to guide the conversion.
|
|
537
|
+
* of the corresponding property in the source object, the converter or validator used for each source
|
|
538
|
+
* property and any other configuration to guide the conversion.
|
|
525
539
|
* @param options - Options which affect the transformation.
|
|
526
540
|
*
|
|
527
|
-
* @returns A {@link Converter} with the specified conversion behavior.
|
|
541
|
+
* @returns A {@link Converter | Converter} with the specified conversion behavior.
|
|
528
542
|
* @public
|
|
529
543
|
*/
|
|
530
544
|
export declare function transformObject<TSRC, TDEST, TC = unknown>(destinationFields: FieldTransformers<TSRC, TDEST, TC>, options?: TransformObjectOptions<TSRC>): Converter<TDEST, TC>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/packlets/conversion/converters.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/packlets/conversion/converters.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,eAAuC,CAAC;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzF;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,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