Check undefined instead of using typeof

This commit is contained in:
Robert
2023-03-16 10:54:29 +00:00
parent 3fe069975a
commit 64531f5a6f

View File

@@ -79,7 +79,7 @@ export interface ErrorLike {
function isErrorLike(error: any): error is ErrorLike {
if (
typeof error.message === "string" &&
(typeof error.stack === "undefined" || typeof error.stack === "string")
(error.stack === undefined || typeof error.stack === "string")
) {
return true;
}