Open
Conversation
Fix NaN validation
|
Will be solved in v2.5.3 of @cantoo/pdf-lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This PR fixes a bug on utility validators where any parameters validated with
assertIswould fail asserting Arrays because of unguardedisNaNcall.Why?
I don't really know how this is working at all for anyone, since I don't know how
isNaNcould return false for anything but a number.How?
globalThis.isNaNsince it is meant to check values of ANY type. UseNumber.isNaNinstead. This alone should do the trick anyway.Testing?
I'm pretty confidente that the this PR won't break anything. What I don't know is how is working anywhere, haha
New Dependencies?
Screenshots
Suggested Reading?
https://stackoverflow.com/questions/33164725/confusion-between-isnan-and-number-isnan-in-javascript
Anything Else?
Checklist