aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/qs
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/qs')
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md5
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/bower.json1
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/component.json2
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/dist/qs.js9
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/lib/stringify.js9
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/package.json50
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/test/stringify.js24
7 files changed, 67 insertions, 33 deletions
diff --git a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md
index 2df5e9d378..5c66ea4446 100644
--- a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md
+++ b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md
@@ -1,3 +1,8 @@
+## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=34&state=closed)
+- [New] allowDots option for `stringify` (#151)
+- [Fix] "sort" option should work at a depth of 3 or more (#151)
+- [Fix] Restore `dist` directory; will be removed in v7 (#148)
+
## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
- Revert ES6 requirement and restore support for node down to v0.8.
diff --git a/deps/npm/node_modules/request/node_modules/qs/bower.json b/deps/npm/node_modules/request/node_modules/qs/bower.json
index 8b21420a64..44f050642d 100644
--- a/deps/npm/node_modules/request/node_modules/qs/bower.json
+++ b/deps/npm/node_modules/request/node_modules/qs/bower.json
@@ -1,7 +1,6 @@
{
"name": "qs",
"main": "dist/qs.js",
- "version": "5.2.0",
"homepage": "https://github.com/hapijs/qs",
"authors": [
"Nathan LaFreniere <quitlahok@gmail.com>"
diff --git a/deps/npm/node_modules/request/node_modules/qs/component.json b/deps/npm/node_modules/request/node_modules/qs/component.json
index fca856a631..cb8d93fb1f 100644
--- a/deps/npm/node_modules/request/node_modules/qs/component.json
+++ b/deps/npm/node_modules/request/node_modules/qs/component.json
@@ -2,7 +2,7 @@
"name": "qs",
"repository": "hapijs/qs",
"description": "query-string parser / stringifier with nesting support",
- "version": "5.2.0",
+ "version": "6.1.0",
"keywords": ["querystring", "query", "parser"],
"main": "lib/index.js",
"scripts": [
diff --git a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js
index 68433d45a8..bb8ea31a95 100644
--- a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js
+++ b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js
@@ -198,7 +198,7 @@ var internals = {
encode: true
};
-internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
@@ -243,9 +243,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH
}
if (Array.isArray(obj)) {
- values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
} else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
}
@@ -260,6 +260,7 @@ module.exports = function (object, opts) {
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
var sort = typeof options.sort === 'function' ? options.sort : null;
+ var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
@@ -301,7 +302,7 @@ module.exports = function (object, opts) {
continue;
}
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
return keys.join(delimiter);
diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js
index e7b669d3d5..892dad45a9 100755
--- a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js
+++ b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js
@@ -20,7 +20,7 @@ var internals = {
encode: true
};
-internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
@@ -65,9 +65,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH
}
if (Array.isArray(obj)) {
- values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
} else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
}
@@ -82,6 +82,7 @@ module.exports = function (object, opts) {
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
var sort = typeof options.sort === 'function' ? options.sort : null;
+ var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
@@ -123,7 +124,7 @@ module.exports = function (object, opts) {
continue;
}
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
return keys.join(delimiter);
diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json
index ed0815b5b7..33318a7253 100644
--- a/deps/npm/node_modules/request/node_modules/qs/package.json
+++ b/deps/npm/node_modules/request/node_modules/qs/package.json
@@ -1,16 +1,20 @@
{
"_args": [
[
- "qs@~6.0.2",
+ "qs@~6.1.0",
"/Users/rebecca/code/npm/node_modules/request"
]
],
- "_from": "qs@>=6.0.2 <6.1.0",
- "_id": "qs@6.0.2",
+ "_from": "qs@>=6.1.0 <6.2.0",
+ "_id": "qs@6.1.0",
"_inCache": true,
"_installable": true,
"_location": "/request/qs",
- "_nodeVersion": "5.4.1",
+ "_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/qs-6.1.0.tgz_1454565583082_0.44599376199766994"
+ },
"_npmUser": {
"email": "ljharb@gmail.com",
"name": "ljharb"
@@ -19,27 +23,27 @@
"_phantomChildren": {},
"_requested": {
"name": "qs",
- "raw": "qs@~6.0.2",
- "rawSpec": "~6.0.2",
+ "raw": "qs@~6.1.0",
+ "rawSpec": "~6.1.0",
"scope": null,
- "spec": ">=6.0.2 <6.1.0",
+ "spec": ">=6.1.0 <6.2.0",
"type": "range"
},
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz",
- "_shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz",
+ "_shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26",
"_shrinkwrap": null,
- "_spec": "qs@~6.0.2",
+ "_spec": "qs@~6.1.0",
"_where": "/Users/rebecca/code/npm/node_modules/request",
"bugs": {
"url": "https://github.com/ljharb/qs/issues"
},
"contributors": [
{
- "name": "Jordan Harband",
"email": "ljharb@gmail.com",
+ "name": "Jordan Harband",
"url": "http://ljharb.codes"
}
],
@@ -57,32 +61,32 @@
},
"directories": {},
"dist": {
- "shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
- "tarball": "http://registry.npmjs.org/qs/-/qs-6.0.2.tgz"
+ "shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26",
+ "tarball": "http://registry.npmjs.org/qs/-/qs-6.1.0.tgz"
},
"engines": {
"node": ">=0.6"
},
- "gitHead": "47dfbd6740b3cc1593847825701c8aa136f636e3",
+ "gitHead": "5bd79545edb33d6a43398fec7df9ecef2da005ea",
"homepage": "https://github.com/ljharb/qs",
"keywords": [
- "qs",
- "querystring"
+ "querystring",
+ "qs"
],
"license": "BSD-3-Clause",
"main": "lib/index.js",
"maintainers": [
{
- "name": "hueniverse",
- "email": "eran@hammer.io"
+ "email": "eran@hammer.io",
+ "name": "hueniverse"
},
{
- "name": "ljharb",
- "email": "ljharb@gmail.com"
+ "email": "ljharb@gmail.com",
+ "name": "ljharb"
},
{
- "name": "nlf",
- "email": "quitlahok@gmail.com"
+ "email": "quitlahok@gmail.com",
+ "name": "nlf"
}
],
"name": "qs",
@@ -101,5 +105,5 @@
"test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'",
"tests-only": "node test"
},
- "version": "6.0.2"
+ "version": "6.1.0"
}
diff --git a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js
index 88d22f25e9..508c2460b6 100755
--- a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js
+++ b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js
@@ -22,6 +22,12 @@ test('stringify()', function (t) {
st.end();
});
+ t.test('stringifies a nested object with dots notation', function (st) {
+ st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
+ st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
+ st.end();
+ });
+
t.test('stringifies an array value', function (st) {
st.equal(qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
st.end();
@@ -48,12 +54,23 @@ test('stringify()', function (t) {
st.end();
});
+ t.test('stringifies a nested array value with dots notation', function (st) {
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encode: false }), 'a.b[0]=c&a.b[1]=d');
+ st.end();
+ });
+
t.test('stringifies an object inside an array', function (st) {
st.equal(qs.stringify({ a: [{ b: 'c' }] }), 'a%5B0%5D%5Bb%5D=c');
st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }), 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
st.end();
});
+ t.test('stringifies an object inside an array with dots notation', function (st) {
+ st.equal(qs.stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), 'a[0].b=c');
+ st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), 'a[0].b.c[0]=1');
+ st.end();
+ });
+
t.test('does not omit object keys when indices = false', function (st) {
st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
st.end();
@@ -232,4 +249,11 @@ test('stringify()', function (t) {
st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
st.end();
});
+
+ t.test('can sort the keys at depth 3 or more too', function (st) {
+ var sort = function (a, b) { return a.localeCompare(b); };
+ st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: sort, encode: false }), 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb');
+ st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: null, encode: false }), 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b');
+ st.end();
+ });
});