Skip to content

isURIError ​

The isURIError function checks if a value is an instance of URIError.

Syntax ​

typescript
isURIError(value: any): value is URIError;

Parameters ​

NameTypeDescription
valueanyThe value to check

Returns ​

TypeDescription
booleantrue if the value is an instance of URIError, false otherwise

Examples ​

typescript
isURIError(new URIError("Invalid URI"));
// => true

isURIError(new Error());
// => false

isURIError({});
// => false

Notes ​

  • Useful for identifying errors related to URIs in JavaScript operations.

References ​

Released under the MIT License.