#525·qs

`allowEmptyArrays` option disrespects `arrayFormat`

Author: cdpark0530Created Jun 19, 2025Updated Mar 14, 2026
Labelsquestion

allowEmptyArrays option was intruduced in version 6.12.0

Without this option

qs.stringify({ foo: [], bar: baz })
// 'bar=baz'

With this option

qs.stringify({ foo: [], bar: baz }, { allowEmptyArrays: true })
// 'foo[]&bar=baz'

However, I believe that with arrayFormat: 'comma' option, it should result like this:

qs.stringify({ foo: [], bar: baz }, { allowEmptyArrays: true, arrayFormat: 'comma' })
// 'foo=&bar=baz'