Skip to content

Commit

Permalink
types(vest): add safeguard around shouldUseErrorAsMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Nov 10, 2021
1 parent c214a12 commit 4cb2c6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 0 additions & 7 deletions packages/vest/parser/package.json

This file was deleted.

5 changes: 3 additions & 2 deletions packages/vest/src/core/test/lib/shouldUseErrorAsMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { isUndefined } from 'isUndefined';

export default function shouldUseErrorAsMessage(
message: string | void,
error: any
): boolean {
error: unknown
): error is string {
// kind of cheating with this safe guard, but it does the job
return isUndefined(message) && isStringValue(error);
}

0 comments on commit 4cb2c6c

Please sign in to comment.