Skip to content
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

Add a flag to configure whether we check attributes against the schema #48

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

nlam-atlassian
Copy link
Collaborator

@nlam-atlassian nlam-atlassian commented Oct 22, 2024

Not sure why checkAttrs was added to Node.toJSON in the original TS code, especially since Node.toJSON doesn't check if the node structure is correct anyway.

Since we want to be able to parse JSON and render it, even if it doesn't conform to the schema, I've added a flag to toggle whether we should call checkAttrs or not.

Context: checkAttrs throws a RangeException if it sees an attribute that it isn't expecting based on the schema.

@nlam-atlassian nlam-atlassian merged commit 443f529 into main Oct 23, 2024
2 checks passed
@nlam-atlassian nlam-atlassian deleted the nlam/check-attr branch October 23, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants