Skip to content

Commit

Permalink
Change implementation to be more TypeScripty
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweininger committed Apr 7, 2023
1 parent ffa273c commit 18593af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export class UserCancelledError extends Error {
}

export function isUserCancelledError(error: unknown): error is UserCancelledError {
return !!error && typeof error === 'object' && (error as UserCancelledError)._isUserCancelledError;
return !!error &&
typeof error === 'object' &&
'_isUserCancelledError' in error &&
error._isUserCancelledError === true;
}

export class GoBackError extends Error {
Expand Down

0 comments on commit 18593af

Please sign in to comment.