Skip to content

Function: isNeuroimError() ​

ts
function isNeuroimError(error, code?): error is NeuroimError;

Defined in: src/errors.ts:100

True when error is a NeuroimError, optionally with a given code.

Besides instanceof, this accepts errors that carry the library's cross-realm brand and a known code, so it also recognises errors created by a second copy of the library (e.g. the CJS and ESM builds loaded together).

Parameters ​

error ​

unknown

code? ​

NeuroimErrorCode

Returns ​

error is NeuroimError

Released under the MIT License.