@w5s/errorFunctionsisErrorisError CallableisError(anyValue: unknown): anyValue is ErrorCheck if the provided value is an Error object.@exampleisError(new Error('Test Error')); // trueisError(new TypeError('Test Error')); // trueisError(undefined); // falseisError({ name: 'Error' }); // false
Check if the provided value is an Error object.