isBaseURL()function

isBaseURL(value: PossibleURL): value is BaseURL
ParamType
valuePossibleURL
Value to test. required
Return
value is BaseURL
true if value is a BaseURL (a URL with a trailing-slash pathname), otherwise false.

Is an unknown value a valid Base URL?

  • Must be a true URL whose pathname ends in a trailing slash.

Examples

isBaseURL(new URL("http://x.com/a/")); // `true`