Skip to content

New types added in 6.13.4 exclude possibility of null in arrays #280

Closed
@pbeshai

Description

@pbeshai

The new types added in #279 are too restrictive as they eliminate the possibility of nulls being in the arrays.

Consider the following acceptable use of parse and stringify:

> const qs = require('query-string')
undefined

> qs.parse('?foo&foo=1&foo&foo=test&foo=&foo')
[Object: null prototype] { foo: [ null, '1', null, 'test', '', null ] }

> qs.stringify({ foo: [null, '1', null, 'test', '', null] })
'foo&foo=1&foo&foo=test&foo=&foo'

While [null, '1', null, 'test', '', null] is a valid value, it does not meet the definition of Stringifiable[] which is (string | boolean | number)[]

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