Name of the parameter, for the error
Value of the parameter
The URI-encoded segment
contracts/common.md#principled-implementation encodeURIComponent produces a single segment for well-formed Unicode text and throws URIError for unpaired surrogates; nullish input becomes the text null. The encoded text . or .. is refused because the WHATWG URL parser treats it and its percent-encoded spelling as a dot segment.
contracts/common.md#clear-and-simple-design One conversion and one guard, with the reason for the guard stated in the comment.
The parameter's value as one URL path segment: its text URI-encoded, or
"null"when the value is nullish..and..are refused.encodeURIComponentleaves them as they are, and the URL parser thatfetchandnew URL()share resolves them as dot segments, so the request would reach the parent path instead of the route, with the value gone. Their percent-encoded form is a dot segment by the same standard, so no spelling carries them.