You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The character used to separate array elements when using `{arrayFormat: 'separator'}`.
@@ -169,6 +176,108 @@ export type ParseOptions = {
169
176
```
170
177
*/
171
178
readonlyparseFragmentIdentifier?: boolean;
179
+
180
+
/**
181
+
Specify a pre-defined schema to be used when parsing values. The types specified will take precedence over options such as: `parseNumber`, `parseBooleans`, and `arrayFormat`.
182
+
183
+
Use this feature to override the type of a value. This can be useful when the type is ambiguous such as a phone number (see example 1 and 2).
184
+
185
+
It is possible to provide a custom function as the parameter type. The parameter's value will equal the function's return value (see example 4).
186
+
187
+
NOTE: Array types (`string[]` and `number[]`) will have no effect if `arrayFormat` is set to `none` (see example 5).
188
+
189
+
@default {}
190
+
191
+
@example
192
+
Parse `phoneNumber` as a string, overriding the `parseNumber` option:
Parse the value as a boolean type instead of string type if it's a boolean.
226
226
227
+
##### types
228
+
229
+
Type: `object`\
230
+
Default: `{}`
231
+
232
+
Specify a pre-defined schema to be used when parsing values. The types specified will take precedence over options such as: `parseNumber`, `parseBooleans`, and `arrayFormat`.
233
+
234
+
Use this feature to override the type of a value. This can be useful when the type is ambiguous such as a phone number.
235
+
236
+
It is possible to provide a custom function as the parameter type. The parameter's value will equal the function's return value.
237
+
238
+
Supported Types:
239
+
240
+
-`'string'`: Parse `phoneNumber` as a string (overriding the `parseNumber` option):
0 commit comments