QS Kit
A query string manipulation toolbox.
Early alpha.
Full BDD spec generated by Mocha:
TOC
Parse
Scalar usage.
expect( qs.parse( "k=v" ) ).to.eql( { k: "v" } ) ;
expect( qs.parse( "key=value" ) ).to.eql( { key: "value" } ) ;
expect( qs.parse( "a=1" ) ).to.eql( { a: 1 } ) ;
expect( qs.parse( "key=value&a=1" ) ).to.eql( { key: "value" , a: 1 } ) ;
expect( qs.parse( "key=value&a=1&b=2&c=string" ) ).to.eql( { key: "value" , a: 1 , b: 2 , c: "string" } ) ;
String encoded.
expect( qs.parse( "key=some%20value" ) ).to.eql( { key: "some value" } ) ;
Stringify
Historical bugs
Bad query string: =one=two.
expect( function() { qs.parse( "=one=two" ) ; } ).to.throwException() ;