Skip to content

fix(parse): throw on unbalanced bracket groups#560

Open
pupuking723 wants to merge 1 commit into
ljharb:mainfrom
pupuking723:fix/unbalanced-bracket-parse-error
Open

fix(parse): throw on unbalanced bracket groups#560
pupuking723 wants to merge 1 commit into
ljharb:mainfrom
pupuking723:fix/unbalanced-bracket-parse-error

Conversation

@pupuking723

@pupuking723 pupuking723 commented Jun 9, 2026

Copy link
Copy Markdown

Closes #558.

This changes parser behavior for malformed nested keys that start a bracket group after a parent key but never close it. Instead of treating the rest of the key as a literal segment, qs.parse now throws a RangeError, which matches the maintainer direction in the issue discussion.

Existing behavior is preserved for bracket-prefixed keys and for keys with unterminated inner bracket groups that are already handled as literal segments.

Verification:

  • npx tape test/parse.js
  • npm run tests-only
  • npm run lint
  • npm test

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.

6.15.2 parse behavioral change breaks nested bracket query string parsing

1 participant