fix(cli): prevent crash on non-string YAML properties (Issue #75)#79
Merged
Conversation
Contributor
Author
|
Hi team! I've resolved the non-string YAML properties crash for Issue #75 and signed the CLA. Could a maintainer please approve the pending workflow scans so the checks can run? Thank you! |
LealLara
approved these changes
May 22, 2026
Collaborator
|
Hey @SyedaQurratAI! Apologies on the delay here, it's been a busy few weeks. Thank you so much for taking the time to contribute. I'm getting to this review today. |
LealLara
approved these changes
May 26, 2026
davideast
approved these changes
Jun 2, 2026
Collaborator
davideast
left a comment
There was a problem hiding this comment.
Thank you so much @SyedaQurratAI.
davideast
added a commit
that referenced
this pull request
Jun 2, 2026
…sue #75 tests (#94) The component property loop only checked for typeof 'number' before passing values to string-only helpers (isTokenReference, isValidColor, isParseableDimension). Boolean YAML values (e.g. visible: true) fell through to those helpers and only survived by accident due to the typeof guards added in PR #79. This change handles booleans explicitly alongside numbers so the intent is clear. Adds three tests covering the exact reproducer from Issue #75 (opacity: 0.9), boolean properties (visible: true), and a mixed case with numbers, booleans, and strings in the same component.
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.
Fixed the "raw.match is not a function" crash (Issue #75) by adding type guards for non-string YAML properties.
Changes:
Added typeof checks in parseDimensionParts and parseCssColor.
Updated ModelHandler to handle numeric/boolean values gracefully.