-
-
Notifications
You must be signed in to change notification settings - Fork 354
Closed
Closed
Copy link
Labels
Status: AcceptedIt's clear what the subject of the issue is about, and what the resolution should be.It's clear what the subject of the issue is about, and what the resolution should be.Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.🐛 BugIndicates that the issue is a bug or defect.Indicates that the issue is a bug or defect.
Description
Describe the bug
The getPartsOfArrayContent function in lib/getPartsOfJson.ts incorrectly counts brackets ({, }, [, ]) when they appear inside strings. This results in parsing errors where brackets inside strings are treated as part of the JSON structure.
Steps To Reproduce
Steps to reproduce the behavior:
- Provide a JSON array like:
[ "{key:value}", "[nested]", "\"String with {brackets}\"", "true", 123, null ]
- Pass it to the
getPartsOfArrayContentfunction. - Observe the incorrect parsing results where brackets inside strings are not ignored.
There is a TODO comment above this function mentioning the need to filter brackets inside strings. However, after reviewing the commit history of the file, it appears this task was never addressed. I am creating this issue as a reminder in case it was overlooked.
Expected Behavior
The function should ignore brackets inside strings and correctly parse the array values.
Screenshots
No response
Device Information [optional]
- OS:Ubuntu 24.04.1 LTS
- Browser:Firefox
- version:LTS
Are you working on this issue?
I would love to solve this if approved. Thanks!
Metadata
Metadata
Assignees
Labels
Status: AcceptedIt's clear what the subject of the issue is about, and what the resolution should be.It's clear what the subject of the issue is about, and what the resolution should be.Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.🐛 BugIndicates that the issue is a bug or defect.Indicates that the issue is a bug or defect.