Package Exports
- shitty-qs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shitty-qs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Shitty query strings parser
Did you ever meet URIError: URI malformed
? Nice.
Dedicated to do not fail when decodeURIComponent
fails (just return undecoded val).
(and fast)
It uses try {} catch (e) {}
while decoding tokens.
Usage
var qs = require('shitty-qs');
var q = qs('sid1=t728%F590&sid2=8518224&sid3=LA&sid4=188.19');
// ->
{
sid1: 't728%F590',
sid2: '8518224',
sid3: 'LA',
sid4: '188.19'
}
Performance
Performance is roughly the same as without try-catch for valid query string
➜ node perf-test.js
shitty-qs normalStuff: 683ms
shitty-qs shittyStuff: 1782ms
qs normalStuff: 1244ms
qs shittyStuff: 2455ms
query-string normalStuff: 742ms
query-string shittyStuff: URIError: URI malformed
FAQ
Q: Is it ready for production?
A: YES!!!
License
MIT