Skip to content

fix: coerce whitespace strings correctly - #2297

Open
vwong wants to merge 3 commits into
ajv-validator:masterfrom
vwong:fix/coerce-whitespace-strings
Open

vwong wants to merge 3 commits into
ajv-validator:masterfrom
vwong:fix/coerce-whitespace-strings

Conversation

@vwong

@vwong vwong commented Jun 27, 2023

Copy link
Copy Markdown

What issue does this pull request resolve?

Number/Integer strings with only whitespace gets coerced to 0, when it should be undefined

What changes did you make?

The code already skips coercion on empty zero-length strings, I refined this to skip coercion on strings that are empty after .trim().

Is there anything that requires more attention while reviewing?

No

@vwong

vwong commented Jun 28, 2023

Copy link
Copy Markdown
Author

The CI is broken, but I'm not sure what I would've done to cause it to break. Help?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant