Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to picoquery #337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 * as 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