Skip to content

allowEmptyArrays option disrespects arrayFormat #525

@cdpark0530

Description

@cdpark0530

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions