query-string icon indicating copy to clipboard operation
query-string copied to clipboard

Add option to omit empty arrays with arrayFormat: 'bracket-separator'

Open nik-webdevelop opened this issue 10 months ago • 0 comments

It would be really nice if there would be an option to omit empty arrays with { arrayFormat: 'bracket-separator' }

current behavior:

const query = queryString.stringify({ foo: [] }, { arrayFormat: 'bracket-separator' });
// query: 'foo[]'

expected behavior:

const query = queryString.stringify({ foo: [] }, { arrayFormat: 'bracket-separator', omitEmptyArrays: true });
// query: ''

nik-webdevelop avatar Mar 18 '25 18:03 nik-webdevelop