Skip to content

Allow qs parser to receive options #427

Closed
@iwaduarte

Description

@iwaduarte

My case is very trivial but it seems unsupported. I want to be able to separate between null and empty values.

What I would expect:

// qs library - https://github.com/ljharb/qs

var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });

// results in :
assert.deepEqual(parsedStrictNull, { a: null, b: '' });

_// bodyParser (what would seem practical to implement) _
bodyParser.urlencoded({extended: true, {strictNullHandling: true }})

What do I have: Nothing likely is currently implemented.

I was digging through the library and I found several attempts to make the parser more configurable. Maybe it is time to have a flexible way of exploring your default (extended) parser ?

#46
#55

I could also provide a pull request. It seems to me that it is a straight-forward feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions