Walk the supplied search params, validate each one against its requirement (if any), and produce
a record suitable for both URL building (client) and request validation (server).
The form of each output value matches its requirement:
Shape whose runtimeType is a single string: output is a single string.
Shape whose runtimeType is string[]: output is an array of strings.
Shape with a union runtime type: output preserves the form that satisfies the shape.
RegExp: output is a single string.
RegExp[]: output is an array of strings. Each value must match at least one of the supplied
regexes.
No requirement: output preserves the supplied form (single or array), stringified.
Non-string primitives are coerced with String(...) so that URL builders can accept numbers and
booleans even when the shape is string-typed.
Walk the supplied search params, validate each one against its requirement (if any), and produce a record suitable for both URL building (client) and request validation (server).
The form of each output value matches its requirement:
ShapewhoseruntimeTypeis a single string: output is a single string.ShapewhoseruntimeTypeisstring[]: output is an array of strings.Shapewith a union runtime type: output preserves the form that satisfies the shape.RegExp: output is a single string.RegExp[]: output is an array of strings. Each value must match at least one of the supplied regexes.Non-string primitives are coerced with
String(...)so that URL builders can accept numbers and booleans even when the shape isstring-typed.