Skip to content

Commit 2226405

Browse files
committed
feat: migrate to picoquery
Migrates from qs to picoquery, a much faster library.
1 parent aa205ee commit 2226405

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

lib/http.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ import net from 'net';
1818
import url from 'url';
1919
import Cookie from 'cookiejar';
2020
import charset from 'charset';
21-
import qs from 'qs';
21+
import pq from 'picoquery';
2222
import * as _request from './request.js';
2323

24+
const PQ_OPTIONS = {
25+
nesting: true,
26+
nestingSyntax: 'index'
27+
};
28+
2429
/**
2530
*
2631
* @param {ChaiStatic} chai
@@ -384,7 +389,7 @@ export default function (chai, _) {
384389
Assertion.addMethod('param', function () {
385390
const assertion = new Assertion();
386391
_.transferFlags(this, assertion);
387-
assertion._obj = qs.parse(url.parse(this._obj.url).query);
392+
assertion._obj = pq.parse(url.parse(this._obj.url).query, PQ_OPTIONS);
388393
assertion.property.apply(assertion, arguments);
389394
});
390395

package-lock.json

+14-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,14 @@
4848
"browser": {
4949
"http": false,
5050
"https": false,
51-
"net": "./lib/net.js",
52-
"querystring": "qs"
51+
"net": "./lib/net.js"
5352
},
5453
"dependencies": {
5554
"charset": "^1.0.1",
5655
"cookiejar": "^2.1.4",
5756
"is-ip": "^5.0.1",
5857
"methods": "^1.1.2",
59-
"qs": "^6.12.1",
58+
"picoquery": "^1.4.0",
6059
"superagent": "^9"
6160
},
6261
"devDependencies": {

0 commit comments

Comments
 (0)