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

BREAKING: Improve JSON validation #85

Merged
merged 3 commits into from
Feb 20, 2023
Merged

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Feb 20, 2023

Closes MetaMask/MetaMask-planning#327.

This fixes edge cases in our JSON validation logic.

Breaking changes

  • The previous function used for JSON validation, validateJsonAndGetSize was removed.
    • The isValidJson function now uses the new JSON validation logic.
    • To get the size of a JSON value, you can use the getJsonSize function.

@Mrtenz Mrtenz changed the title Improve JSON validation Breaking: Improve JSON validation Feb 20, 2023
@Mrtenz Mrtenz force-pushed the mrtenz/safe-json-validation branch from 9a59ebc to 9fcd98a Compare February 20, 2023 14:41
@Mrtenz Mrtenz marked this pull request as ready for review February 20, 2023 14:41
@Mrtenz Mrtenz requested a review from a team as a code owner February 20, 2023 14:41
@Mrtenz Mrtenz changed the title Breaking: Improve JSON validation BREAKING: Improve JSON validation Feb 20, 2023
src/json.ts Show resolved Hide resolved
src/json.ts Show resolved Hide resolved
src/json.ts Show resolved Hide resolved
src/__fixtures__/json.ts Show resolved Hide resolved
@Mrtenz Mrtenz merged commit 389ee06 into main Feb 20, 2023
@Mrtenz Mrtenz deleted the mrtenz/safe-json-validation branch February 20, 2023 15:09
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