Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove debug info
  • Loading branch information
Luncher committed May 16, 2022
commit e5afe2ac4ba190baf4b0458cd311581f7e7c2e6e
1 change: 0 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export function normalizeError(rawError: ValidationRawError): ValidationError {
export function isErrorObject(err: any): err is ValidationErrorObject {
if (err != null && typeof err === 'object' && 'message' in err) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是最好再加个 typeof err.message === 'string'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P.S. 如果加了 typeof err.message === 'string',好像 'message' in err 也可以省了

if (!err.message) {
console.log(err)
throw new Error('ValidationErrorObject message property cannot be empty')
Copy link
Collaborator

@nighca nighca May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这(isErrorObject)抛错不合理吧..放到 setError 去抛可能会好一点,甚至 normalizeError 也比这里好

}
return true
Expand Down