requireBaseURL()function

requireBaseURL(value: PossibleURL, caller: AnyCaller): BaseURL
ParamType
valuePossibleURL
URL string, URL object, or path to normalise. required
callerAnyCaller
Function to attribute a thrown error to. required
Return
BaseURL
BaseURL with a trailing-slash pathname.
Throws
unknown
RequiredError If value cannot be resolved to a true URL.

Require a Base URL — a true URL whose pathname is normalised to end in a trailing slash.

Examples

requireBaseURL("http://x.com/a", requireBaseURL); // `http://x.com/a/`