Closed T-PWK closed 2 years ago
The arrayFormat parameter seems to be ignored when using a single-element array. Example:
arrayFormat
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' })
will return a=b,c (a=b%2Cc), however, when there is a single array element like in the following example:
a=b,c
a=b%2Cc
qs.stringify({ a: ['b'] }, { arrayFormat: 'comma' })
the library returns a[]=b (a%5B%5D=b)
a[]=b
a%5B%5D=b
This issue started appearing in the latest version 6.10.5. Version 6.10.3 works as expected.
It’s not a bug; it’s intentional. However, it will be put behind an option; duplicate of #442.
The
arrayFormat
parameter seems to be ignored when using a single-element array. Example:will return
a=b,c
(a=b%2Cc
), however, when there is a single array element like in the following example:the library returns
a[]=b
(a%5B%5D=b
)This issue started appearing in the latest version 6.10.5. Version 6.10.3 works as expected.