ljharb / qs

A querystring parser with nesting support
BSD 3-Clause "New" or "Revised" License
8.5k stars 729 forks source link

ArrayFormat comma parsing doesn't not work when the comma is encoded #443

Closed jerrylian-db closed 2 years ago

jerrylian-db commented 2 years ago

This test case fails:

st.deepEqual(qs.parse('foo=bar%2Ctee', { comma: true }), { foo: ['bar', 'tee'] });

Instead, qs.parse('foo=bar%2Ctee', { comma: true }) equals {foo: 'bar,tee'}

In other words, when a user stringifies an array with encoding, the decoding doesn't work.

jerrylian-db commented 2 years ago

Nevermind, this issue was resolved by using encodeValueOnly=true when stringifying.