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

fix(deserialize): unescape JSON strings #3414

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

Conaclos
Copy link
Member

Summary

Previously, the biome_deserialize didn't unescape JSON strings.
To fix this issue. I had to change the representation of biome_deserialize::Text.
If the string has no escape sequence, then we still don't allocate a string.
Conversely, if a string contains at least one escape sequence, then we allocate a string.
biome_deserialize::Text is analog to std::borrow::Cow.

Test Plan

I added a test.
I also added a test for #3412.

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Jul 11, 2024
@Conaclos Conaclos requested a review from a team July 11, 2024 15:32
crates/biome_deserialize/src/json.rs Outdated Show resolved Hide resolved
crates/biome_deserialize/src/json.rs Outdated Show resolved Hide resolved
@Conaclos Conaclos merged commit 6163e58 into main Jul 11, 2024
11 checks passed
@Conaclos Conaclos deleted the conaclos/deserialize-unescape-json-strings branch July 11, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants