-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix the problem of null judgment error #21
Conversation
CI failed |
6e41828
to
e2533d5
Compare
@self-transition fixed |
IsNil adds an extra check for I'm also wondering if the previous |
e2533d5
to
6375971
Compare
@self-transition Thank you very much. I have adjusted the judgment logic based on your response. Checks if path is a direct property of object before judge conditions, and added the relevant unit tests. PTAL |
return fieldValue === null; | ||
case 'nnull': | ||
return fieldValue !== null; | ||
case 'null': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to put this judgment at the beginning of the function, so that when path is not a direct property of object, it doesn't do anything and returns the original value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right! I think it should return false when path isn't direct property of object, because it mean that data is not valid.
6375971
to
d5bebae
Compare
d5bebae
to
cc109a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
In the current null and nnull judgments, undefined will be erroneously judged to be true.
Adjusted the judgment logic, the judgment rules of null and nnull return true or false according to whether the value is nil.
And complements the logic of recursive judgment.