tj / node-querystring

querystring parser for node and the browser - supporting nesting (used by Express, Connect, etc)
MIT License
455 stars 66 forks source link

Parse null values #102

Closed Oleg2tor closed 10 years ago

Oleg2tor commented 10 years ago
console.log(qs.stringify({ foo: null }));
=> foo=

console.log(qs.parse('foo='));
=> { foo: '' }
console.log(qs.parse('foo=null'));
=> { foo: 'null' }

But, how can I get "clear" null (not as string)?

jonathanong commented 10 years ago

impossible without being too opinionated.

rlidwka commented 10 years ago

crazy idea: parse values using YAML spec

qs could add a reviver for that (like one in JSON.parse)