0.1.6 • Published 6 years ago

qrystr-parse-170615 v0.1.6

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

qrystr-parse-170615

Reduced version of qrystr: Takes the minimalism further for cases where you only need decoding of very simple QS.

  • "very simple QS" includes treating …&flag&… the same as …&flag=&…, i.e. as an empty string value. If you want true instead, use the qrystr module.

Still too large a library? You might not need any at all: URLSearchParams are now widely supported.

Usage

from test/all.js:

var refQSmod = require('querystring'),
  pqs = require('qrystr-parse-170615'),
  slim = require('qrystr-parse-170615/slim');

function verify(qs) {
  var ex = ((typeof qs === 'string') && refQSmod.parse(qs));
  if (!ex) {
    ex = qs;
    qs = refQSmod.stringify(ex);
  }
  eq(pqs(qs), ex);
  eq(slim(qs), ex);
}

verify({ hello: 'world', '23': '42', 'úmlæütè': 'µ¶§°¹²³±' });

Known issues

  • Needs more/better tests and docs.

 

License

ISC

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago