summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/query-string
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/query-string')
-rw-r--r--deps/npm/node_modules/query-string/index.js27
-rw-r--r--deps/npm/node_modules/query-string/package.json36
-rw-r--r--deps/npm/node_modules/query-string/readme.md2
3 files changed, 36 insertions, 29 deletions
diff --git a/deps/npm/node_modules/query-string/index.js b/deps/npm/node_modules/query-string/index.js
index 523c87fdfb..6a1b3c2a30 100644
--- a/deps/npm/node_modules/query-string/index.js
+++ b/deps/npm/node_modules/query-string/index.js
@@ -123,6 +123,7 @@ function extract(input) {
if (queryStart === -1) {
return '';
}
+
return input.slice(queryStart + 1);
}
@@ -171,21 +172,24 @@ exports.extract = extract;
exports.parse = parse;
exports.stringify = (obj, options) => {
- const defaults = {
+ if (!obj) {
+ return '';
+ }
+
+ options = Object.assign({
encode: true,
strict: true,
arrayFormat: 'none'
- };
+ }, options);
- options = Object.assign(defaults, options);
+ const formatter = encoderForArrayFormat(options);
+ const keys = Object.keys(obj);
- if (options.sort === false) {
- options.sort = () => {};
+ if (options.sort !== false) {
+ keys.sort(options.sort);
}
- const formatter = encoderForArrayFormat(options);
-
- return obj ? Object.keys(obj).sort(options.sort).map(key => {
+ return keys.map(key => {
const value = obj[key];
if (value === undefined) {
@@ -211,10 +215,15 @@ exports.stringify = (obj, options) => {
}
return encode(key, options) + '=' + encode(value, options);
- }).filter(x => x.length > 0).join('&') : '';
+ }).filter(x => x.length > 0).join('&');
};
exports.parseUrl = (input, options) => {
+ const hashStart = input.indexOf('#');
+ if (hashStart !== -1) {
+ input = input.slice(0, hashStart);
+ }
+
return {
url: input.split('?')[0] || '',
query: parse(extract(input), options)
diff --git a/deps/npm/node_modules/query-string/package.json b/deps/npm/node_modules/query-string/package.json
index d29777ef1c..8f9b91b4fb 100644
--- a/deps/npm/node_modules/query-string/package.json
+++ b/deps/npm/node_modules/query-string/package.json
@@ -1,32 +1,28 @@
{
- "_args": [
- [
- "query-string@6.1.0",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "query-string@6.1.0",
- "_id": "query-string@6.1.0",
+ "_from": "query-string@6.2.0",
+ "_id": "query-string@6.2.0",
"_inBundle": false,
- "_integrity": "sha512-pNB/Gr8SA8ff8KpUFM36o/WFAlthgaThka5bV19AD9PNTH20Pwq5Zxodif2YyHwrctp6SkL4GqlOot0qR/wGaw==",
+ "_integrity": "sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA==",
"_location": "/query-string",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "query-string@6.1.0",
+ "raw": "query-string@6.2.0",
"name": "query-string",
"escapedName": "query-string",
- "rawSpec": "6.1.0",
+ "rawSpec": "6.2.0",
"saveSpec": null,
- "fetchSpec": "6.1.0"
+ "fetchSpec": "6.2.0"
},
"_requiredBy": [
+ "#USER",
"/"
],
- "_resolved": "https://registry.npmjs.org/query-string/-/query-string-6.1.0.tgz",
- "_spec": "6.1.0",
- "_where": "/Users/rebecca/code/npm",
+ "_resolved": "https://registry.npmjs.org/query-string/-/query-string-6.2.0.tgz",
+ "_shasum": "468edeb542b7e0538f9f9b1aeb26f034f19c86e1",
+ "_spec": "query-string@6.2.0",
+ "_where": "/Users/aeschright/code/cli",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -35,16 +31,18 @@
"bugs": {
"url": "https://github.com/sindresorhus/query-string/issues"
},
+ "bundleDependencies": false,
"dependencies": {
"decode-uri-component": "^0.2.0",
"strict-uri-encode": "^2.0.0"
},
+ "deprecated": false,
"description": "Parse and stringify URL query strings",
"devDependencies": {
- "ava": "*",
+ "ava": "^0.25.0",
"deep-equal": "^1.0.1",
- "fast-check": "^1.0.1",
- "xo": "*"
+ "fast-check": "^1.5.0",
+ "xo": "^0.23.0"
},
"engines": {
"node": ">=6"
@@ -77,5 +75,5 @@
"scripts": {
"test": "xo && ava"
},
- "version": "6.1.0"
+ "version": "6.2.0"
}
diff --git a/deps/npm/node_modules/query-string/readme.md b/deps/npm/node_modules/query-string/readme.md
index f81bd6aea2..5fa1cfbde4 100644
--- a/deps/npm/node_modules/query-string/readme.md
+++ b/deps/npm/node_modules/query-string/readme.md
@@ -15,7 +15,7 @@
$ npm install query-string
```
-This module targets Node.js 6 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, use version 5: `npm install query-string@5`.
+This module targets Node.js 6 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, or, [if your project is using create-react-app](https://github.com/sindresorhus/query-string/pull/148#issuecomment-399656020), use version 5: `npm install query-string@5`.
<a href="https://www.patreon.com/sindresorhus">
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">