Gozala / querystring

Node's querystring module for all engines.
MIT License
287 stars 72 forks source link

Fix issue (#15) with empty arrays not stringify-ing consistently with node #24

Closed lennym closed 6 years ago

lennym commented 7 years ago

Previously stringify was encoding empty arrays inconsistently with node's querytring module.

For example stringify({ foo:'', bar:[], baz: '' }) => 'foo=&&baz=' - note the extra &.

By adding a filter call to the fragments of the querystring before join-ing then these empty strings are removed, and the query string is encoded correctly.

Fixes #15