Skip to content

Commit

Permalink
feat: migrate to picoquery
Browse files Browse the repository at this point in the history
Migrates from qs to picoquery, a much faster library.
  • Loading branch information
43081j committed Jul 28, 2024
1 parent aa205ee commit 2226405
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
9 changes: 7 additions & 2 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ import net from 'net';
import url from 'url';
import Cookie from 'cookiejar';
import charset from 'charset';
import qs from 'qs';
import pq from 'picoquery';
import * as _request from './request.js';

const PQ_OPTIONS = {
nesting: true,
nestingSyntax: 'index'
};

/**
*
* @param {ChaiStatic} chai
Expand Down Expand Up @@ -384,7 +389,7 @@ export default function (chai, _) {
Assertion.addMethod('param', function () {
const assertion = new Assertion();
_.transferFlags(this, assertion);
assertion._obj = qs.parse(url.parse(this._obj.url).query);
assertion._obj = pq.parse(url.parse(this._obj.url).query, PQ_OPTIONS);
assertion.property.apply(assertion, arguments);
});

Expand Down
15 changes: 14 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@
"browser": {
"http": false,
"https": false,
"net": "./lib/net.js",
"querystring": "qs"
"net": "./lib/net.js"
},
"dependencies": {
"charset": "^1.0.1",
"cookiejar": "^2.1.4",
"is-ip": "^5.0.1",
"methods": "^1.1.2",
"qs": "^6.12.1",
"picoquery": "^1.4.0",
"superagent": "^9"
},
"devDependencies": {
Expand Down

0 comments on commit 2226405

Please sign in to comment.