From 0fa2bb4386379d6e9d8c95db08662ec0529964f9 Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 1 Jul 2019 17:32:47 -0700 Subject: [PATCH] query-string@6.8.1 --- node_modules/query-string/index.d.ts | 267 ++++++++++++++--------- node_modules/query-string/index.js | 39 +++- node_modules/query-string/package.json | 29 +-- node_modules/query-string/readme.md | 87 +++++--- node_modules/split-on-first/index.d.ts | 29 +++ node_modules/split-on-first/index.js | 22 ++ node_modules/split-on-first/license | 9 + node_modules/split-on-first/package.json | 68 ++++++ node_modules/split-on-first/readme.md | 58 +++++ package-lock.json | 12 +- package.json | 2 +- 11 files changed, 467 insertions(+), 155 deletions(-) create mode 100644 node_modules/split-on-first/index.d.ts create mode 100644 node_modules/split-on-first/index.js create mode 100644 node_modules/split-on-first/license create mode 100644 node_modules/split-on-first/package.json create mode 100644 node_modules/split-on-first/readme.md diff --git a/node_modules/query-string/index.d.ts b/node_modules/query-string/index.d.ts index 90b3658aee108..a5bd661c2991d 100644 --- a/node_modules/query-string/index.d.ts +++ b/node_modules/query-string/index.d.ts @@ -1,52 +1,108 @@ export interface ParseOptions { /** - * Decode the keys and values. URI components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component). - * - * @default true - */ + Decode the keys and values. URI components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component). + + @default true + */ readonly decode?: boolean; /** - * @default 'none' - * - * - `bracket`: Parse arrays with bracket representation: - * - * - * queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); - * //=> foo: [1, 2, 3] - * - * - `index`: Parse arrays with index representation: - * - * - * queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); - * //=> foo: [1, 2, 3] - * - * - `comma`: Parse arrays with elements separated by comma: - * - * - * queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); - * //=> foo: [1, 2, 3] - * - * - `none`: Parse arrays with elements using duplicate keys: - * - * - * queryString.parse('foo=1&foo=2&foo=3'); - * //=> foo: [1, 2, 3] - */ + @default 'none' + + - `bracket`: Parse arrays with bracket representation: + + ``` + queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); + //=> {foo: ['1', '2', '3']} + ``` + + - `index`: Parse arrays with index representation: + + ``` + queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); + //=> {foo: ['1', '2', '3']} + ``` + + - `comma`: Parse arrays with elements separated by comma: + + ``` + queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); + //=> {foo: ['1', '2', '3']} + ``` + + - `none`: Parse arrays with elements using duplicate keys: + + ``` + queryString.parse('foo=1&foo=2&foo=3'); + //=> {foo: ['1', '2', '3']} + ``` + */ readonly arrayFormat?: 'bracket' | 'index' | 'comma' | 'none'; + + /** + Supports both `Function` as a custom sorting function or `false` to disable sorting. + + If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. + + @default true + + @example + ``` + const order = ['c', 'a', 'b']; + + queryString.parse('?a=one&b=two&c=three', { + sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) + }); + // => {c: 'three', a: 'one', b: 'two'} + ``` + + queryString.parse('?a=one&c=three&b=two', {sort: false}); + // => {a: 'one', c: 'three', b: 'two'} + ``` + */ + readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; + + /** + Parse the value as a number type instead of string type if it's a number. + + @default false + + @example + ```js + queryString.parse('foo=1', {parseNumbers: true}); + //=> {foo: 1} + ``` + */ + readonly parseNumbers?: boolean; + + /** + Parse the value as a boolean type instead of string type if it's a boolean. + + @default false + + @example + ``` + queryString.parse('foo=true', {parseBooleans: true}); + //=> {foo: true} + ``` + */ + readonly parseBooleans?: boolean; } -export interface ParsedQuery { - readonly [key: string]: string | string[] | null | undefined; +export interface ParsedQuery { + [key: string]: T | T[] | null | undefined; } /** - * Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. - * - * The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. - * - * @param query - The query string to parse. - */ +Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. + +The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. + +@param query - The query string to parse. +*/ +export function parse(query: string, options: {parseBooleans: true, parseNumbers: true} & ParseOptions): ParsedQuery; +export function parse(query: string, options: {parseBooleans: true} & ParseOptions): ParsedQuery; +export function parse(query: string, options: {parseNumbers: true} & ParseOptions): ParsedQuery; export function parse(query: string, options?: ParseOptions): ParsedQuery; export interface ParsedUrl { @@ -55,89 +111,98 @@ export interface ParsedUrl { } /** - * Extract the URL and the query string as an object. - * - * @param url - The URL to parse. - * - * @example - * - * queryString.parseUrl('https://foo.bar?foo=bar'); - * //=> {url: 'https://foo.bar', query: {foo: 'bar'}} - */ +Extract the URL and the query string as an object. + +@param url - The URL to parse. + +@example +``` +queryString.parseUrl('https://foo.bar?foo=bar'); +//=> {url: 'https://foo.bar', query: {foo: 'bar'}} +``` +*/ export function parseUrl(url: string, options?: ParseOptions): ParsedUrl; export interface StringifyOptions { /** - * Strictly encode URI components with [`strict-uri-encode`](https://github.com/kevva/strict-uri-encode). It uses [`encodeURIComponent`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to `false`. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. - * - * @default true - */ + Strictly encode URI components with [`strict-uri-encode`](https://github.com/kevva/strict-uri-encode). It uses [`encodeURIComponent`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to `false`. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. + + @default true + */ readonly strict?: boolean; /** - * [URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. - * - * @default true - */ + [URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. + + @default true + */ readonly encode?: boolean; /** - * @default 'none' - * - * - `bracket`: Serialize arrays using bracket representation: - * - * - * queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); - * //=> 'foo[]=1&foo[]=2&foo[]=3' - * - * - `index`: Serialize arrays using index representation: - * - * - * queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); - * //=> 'foo[0]=1&foo[1]=2&foo[3]=3' - * - * - `comma`: Serialize arrays by separating elements with comma: - * - * - * queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); - * //=> 'foo=1,2,3' - * - * - `none`: Serialize arrays by using duplicate keys: - * - * - * queryString.stringify({foo: [1, 2, 3]}); - * //=> 'foo=1&foo=2&foo=3' - */ + @default 'none' + + - `bracket`: Serialize arrays using bracket representation: + + ``` + queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); + //=> 'foo[]=1&foo[]=2&foo[]=3' + ``` + + - `index`: Serialize arrays using index representation: + + ``` + queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); + //=> 'foo[0]=1&foo[1]=2&foo[2]=3' + ``` + + - `comma`: Serialize arrays by separating elements with comma: + + ``` + queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); + //=> 'foo=1,2,3' + ``` + + - `none`: Serialize arrays by using duplicate keys: + + ``` + queryString.stringify({foo: [1, 2, 3]}); + //=> 'foo=1&foo=2&foo=3' + ``` + */ readonly arrayFormat?: 'bracket' | 'index' | 'comma' | 'none'; /** - * Supports both `Function` as a custom sorting function or `false` to disable sorting. - * - * If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. - * - * @example - * - * const order = ['c', 'a', 'b']; - * queryString.stringify({a: 1, b: 2, c: 3}, { - * sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) - * }); - * // => 'c=3&a=1&b=2' - * - * queryString.stringify({b: 1, c: 2, a: 3}, {sort: false}); - * // => 'b=1&c=2&a=3' - */ + Supports both `Function` as a custom sorting function or `false` to disable sorting. + + If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. + + @default true + + @example + ``` + const order = ['c', 'a', 'b']; + + queryString.stringify({a: 1, b: 2, c: 3}, { + sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) + }); + // => 'c=3&a=1&b=2' + + queryString.stringify({b: 1, c: 2, a: 3}, {sort: false}); + // => 'b=1&c=2&a=3' + ``` + */ readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; } /** - * Stringify an object into a query string and sorting the keys. - */ +Stringify an object into a query string and sort the keys. +*/ export function stringify( - object: {[key: string]: unknown}, + object: {[key: string]: any}, options?: StringifyOptions ): string; /** - * Extract a query string from a URL that can be passed into `.parse()`. - */ +Extract a query string from a URL that can be passed into `.parse()`. +*/ export function extract(url: string): string; diff --git a/node_modules/query-string/index.js b/node_modules/query-string/index.js index 3cb1adf8d3045..da459c9404d0b 100644 --- a/node_modules/query-string/index.js +++ b/node_modules/query-string/index.js @@ -1,6 +1,7 @@ 'use strict'; const strictUriEncode = require('strict-uri-encode'); const decodeComponent = require('decode-uri-component'); +const splitOnFirst = require('split-on-first'); function encoderForArrayFormat(options) { switch (options.arrayFormat) { @@ -36,7 +37,7 @@ function encoderForArrayFormat(options) { case 'comma': return key => (result, value, index) => { - if (!value) { + if (value === null || value === undefined || value.length === 0) { return result; } @@ -151,7 +152,17 @@ function keysSorter(input) { return input; } +function removeHash(input) { + const hashStart = input.indexOf('#'); + if (hashStart !== -1) { + input = input.slice(0, hashStart); + } + + return input; +} + function extract(input) { + input = removeHash(input); const queryStart = input.indexOf('?'); if (queryStart === -1) { return ''; @@ -163,7 +174,10 @@ function extract(input) { function parse(input, options) { options = Object.assign({ decode: true, - arrayFormat: 'none' + sort: true, + arrayFormat: 'none', + parseNumbers: false, + parseBooleans: false }, options); const formatter = parserForArrayFormat(options); @@ -182,16 +196,26 @@ function parse(input, options) { } for (const param of input.split('&')) { - let [key, value] = param.replace(/\+/g, ' ').split('='); + let [key, value] = splitOnFirst(param.replace(/\+/g, ' '), '='); // Missing `=` should be `null`: // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters value = value === undefined ? null : decode(value, options); + if (options.parseNumbers && !Number.isNaN(Number(value))) { + value = Number(value); + } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) { + value = value.toLowerCase() === 'true'; + } + formatter(decode(key, options), value, ret); } - return Object.keys(ret).sort().reduce((result, key) => { + if (options.sort === false) { + return ret; + } + + return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => { const value = ret[key]; if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) { // Sort object keys, not values @@ -247,13 +271,8 @@ exports.stringify = (object, options) => { }; exports.parseUrl = (input, options) => { - const hashStart = input.indexOf('#'); - if (hashStart !== -1) { - input = input.slice(0, hashStart); - } - return { - url: input.split('?')[0] || '', + url: removeHash(input).split('?')[0] || '', query: parse(extract(input), options) }; }; diff --git a/node_modules/query-string/package.json b/node_modules/query-string/package.json index cd62b3cf54fba..916b3fe5a1714 100644 --- a/node_modules/query-string/package.json +++ b/node_modules/query-string/package.json @@ -1,28 +1,28 @@ { - "_from": "query-string@6.4.0", - "_id": "query-string@6.4.0", + "_from": "query-string@6.8.1", + "_id": "query-string@6.8.1", "_inBundle": false, - "_integrity": "sha512-Werid2I41/tJTqOGPJ3cC3vwrIh/8ZupBQbp7BSsqXzr+pTin3aMJ/EZb8UEuk7ZO3VqQFvq2qck/ihc6wqIdw==", + "_integrity": "sha512-g6y0Lbq10a5pPQpjlFuojfMfV1Pd2Jw9h75ypiYPPia3Gcq2rgkKiIwbkS6JxH7c5f5u/B/sB+d13PU+g1eu4Q==", "_location": "/query-string", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "query-string@6.4.0", + "raw": "query-string@6.8.1", "name": "query-string", "escapedName": "query-string", - "rawSpec": "6.4.0", + "rawSpec": "6.8.1", "saveSpec": null, - "fetchSpec": "6.4.0" + "fetchSpec": "6.8.1" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/query-string/-/query-string-6.4.0.tgz", - "_shasum": "1566c0cec3a2da2d82c222ed3f9e2a921dba5e6a", - "_spec": "query-string@6.4.0", - "_where": "/Users/aeschright/code/cli", + "_resolved": "https://registry.npmjs.org/query-string/-/query-string-6.8.1.tgz", + "_shasum": "62c54a7ef37d01b538c8fd56f95740c81d438a26", + "_spec": "query-string@6.8.1", + "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -34,15 +34,16 @@ "bundleDependencies": false, "dependencies": { "decode-uri-component": "^0.2.0", + "split-on-first": "^1.0.0", "strict-uri-encode": "^2.0.0" }, "deprecated": false, "description": "Parse and stringify URL query strings", "devDependencies": { - "ava": "^1.3.1", + "ava": "^1.4.1", "deep-equal": "^1.0.1", "fast-check": "^1.5.0", - "tsd-check": "^0.3.0", + "tsd": "^0.7.3", "xo": "^0.24.0" }, "engines": { @@ -75,7 +76,7 @@ "url": "git+https://github.com/sindresorhus/query-string.git" }, "scripts": { - "test": "xo && ava && tsd-check" + "test": "xo && ava && tsd" }, - "version": "6.4.0" + "version": "6.8.1" } diff --git a/node_modules/query-string/readme.md b/node_modules/query-string/readme.md index fda9323cdecf9..297a47d5a00e9 100644 --- a/node_modules/query-string/readme.md +++ b/node_modules/query-string/readme.md @@ -11,10 +11,6 @@ $ 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, or, [if your project is using create-react-app v1](https://github.com/sindresorhus/query-string/pull/148#issuecomment-399656020), use version 5: `npm install query-string@5`. - - - - ## Usage @@ -50,7 +46,7 @@ console.log(location.search); ## API -### .parse(string, [options]) +### .parse(string, options?) Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. @@ -58,7 +54,7 @@ The returned object is created with [`Object.create(null)`](https://developer.mo #### options -Type: `Object` +Type: `object` ##### decode @@ -70,43 +66,74 @@ Decode the keys and values. URL components are decoded with [`decode-uri-compone ##### arrayFormat Type: `string`
-Default: `none` +Default: `'none'` -- `bracket`: Parse arrays with bracket representation: +- `'bracket'`: Parse arrays with bracket representation: ```js queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); -//=> foo: [1, 2, 3] +//=> {foo: ['1', '2', '3']} ``` -- `index`: Parse arrays with index representation: +- `'index'`: Parse arrays with index representation: ```js queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); -//=> foo: [1, 2, 3] +//=> {foo: ['1', '2', '3']} ``` -- `comma`: Parse arrays with elements separated by comma: +- `'comma'`: Parse arrays with elements separated by comma: ```js queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); -//=> foo: [1, 2, 3] +//=> {foo: ['1', '2', '3']} ``` -- `none`: Parse arrays with elements using duplicate keys: +- `'none'`: Parse arrays with elements using duplicate keys: ```js queryString.parse('foo=1&foo=2&foo=3'); -//=> foo: [1, 2, 3] +//=> {foo: ['1', '2', '3']} ``` +##### sort + +Type: `Function | boolean`
+Default: `true` + +Supports both `Function` as a custom sorting function or `false` to disable sorting. + +##### parseNumbers + +Type: `boolean`
+Default: `false` + +```js +queryString.parse('foo=1', {parseNumbers: true}); +//=> {foo: 1} +``` + +Parse the value as a number type instead of string type if it's a number. + +##### parseBooleans + +Type: `boolean`
+Default: `false` + +```js +queryString.parse('foo=true', {parseBooleans: true}); +//=> {foo: true} +``` + +Parse the value as a boolean type instead of string type if it's a boolean. + ### .stringify(object, [options]) Stringify an object into a query string and sorting the keys. #### options -Type: `Object` +Type: `object` ##### strict @@ -125,30 +152,30 @@ Default: `true` ##### arrayFormat Type: `string`
-Default: `none` +Default: `'none'` -- `bracket`: Serialize arrays using bracket representation: +- `'bracket'`: Serialize arrays using bracket representation: ```js queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); //=> 'foo[]=1&foo[]=2&foo[]=3' ``` -- `index`: Serialize arrays using index representation: +- `'index'`: Serialize arrays using index representation: ```js queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); -//=> 'foo[0]=1&foo[1]=2&foo[3]=3' +//=> 'foo[0]=1&foo[1]=2&foo[2]=3' ``` -- `comma`: Serialize arrays by separating elements with comma: +- `'comma'`: Serialize arrays by separating elements with comma: ```js queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); //=> 'foo=1,2,3' ``` -- `none`: Serialize arrays by using duplicate keys: +- `'none'`: Serialize arrays by using duplicate keys: ```js queryString.stringify({foo: [1, 2, 3]}); @@ -181,7 +208,7 @@ If omitted, keys are sorted using `Array#sort()`, which means, converting them t Extract a query string from a URL that can be passed into `.parse()`. -### .parseUrl(string, [options]) +### .parseUrl(string, options?) Extract the URL and the query string as an object. @@ -218,7 +245,7 @@ queryString.parse('likes=cake&name=bob&likes=icecream'); //=> {likes: ['cake', 'icecream'], name: 'bob'} queryString.stringify({color: ['taupe', 'chartreuse'], id: '515'}); -//=> 'color=chartreuse&color=taupe&id=515' +//=> 'color=taupe&color=chartreuse&id=515' ``` @@ -238,6 +265,14 @@ queryString.stringify({foo: undefined}); ``` -## License +--- -MIT © [Sindre Sorhus](https://sindresorhus.com) +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/split-on-first/index.d.ts b/node_modules/split-on-first/index.d.ts new file mode 100644 index 0000000000000..6123bef9126ab --- /dev/null +++ b/node_modules/split-on-first/index.d.ts @@ -0,0 +1,29 @@ +/** +Split a string on the first occurrence of a given separator. + +@param string - The string to split. +@param separator - The separator to split on. + +@example +``` +import splitOnFirst = require('split-on-first'); + +splitOnFirst('a-b-c', '-'); +//=> ['a', 'b-c'] + +splitOnFirst('key:value:value2', ':'); +//=> ['key', 'value:value2'] + +splitOnFirst('a---b---c', '---'); +//=> ['a', 'b---c'] + +splitOnFirst('a-b-c', '+'); +//=> ['a-b-c'] +``` +*/ +declare function splitOnFirst( + string: string, + separator: string +): [string, string?]; + +export = splitOnFirst; diff --git a/node_modules/split-on-first/index.js b/node_modules/split-on-first/index.js new file mode 100644 index 0000000000000..d9140706dd05b --- /dev/null +++ b/node_modules/split-on-first/index.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = (string, separator) => { + if (!(typeof string === 'string' && typeof separator === 'string')) { + throw new TypeError('Expected the arguments to be of type `string`'); + } + + if (separator === '') { + return [string]; + } + + const separatorIndex = string.indexOf(separator); + + if (separatorIndex === -1) { + return [string]; + } + + return [ + string.slice(0, separatorIndex), + string.slice(separatorIndex + separator.length) + ]; +}; diff --git a/node_modules/split-on-first/license b/node_modules/split-on-first/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/split-on-first/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/split-on-first/package.json b/node_modules/split-on-first/package.json new file mode 100644 index 0000000000000..d6f46a9016382 --- /dev/null +++ b/node_modules/split-on-first/package.json @@ -0,0 +1,68 @@ +{ + "_from": "split-on-first@^1.0.0", + "_id": "split-on-first@1.1.0", + "_inBundle": false, + "_integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "_location": "/split-on-first", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "split-on-first@^1.0.0", + "name": "split-on-first", + "escapedName": "split-on-first", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/query-string" + ], + "_resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "_shasum": "f610afeee3b12bce1d0c30425e76398b78249a5f", + "_spec": "split-on-first@^1.0.0", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/query-string", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/split-on-first/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Split a string on the first occurance of a given separator", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/split-on-first#readme", + "keywords": [ + "split", + "string", + "first", + "occurrence", + "separator", + "delimiter", + "text" + ], + "license": "MIT", + "name": "split-on-first", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/split-on-first.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "1.1.0" +} diff --git a/node_modules/split-on-first/readme.md b/node_modules/split-on-first/readme.md new file mode 100644 index 0000000000000..2463cf1cce467 --- /dev/null +++ b/node_modules/split-on-first/readme.md @@ -0,0 +1,58 @@ +# split-on-first [![Build Status](https://travis-ci.com/sindresorhus/split-on-first.svg?branch=master)](https://travis-ci.com/sindresorhus/split-on-first) + +> Split a string on the first occurrence of a given separator + +This is similar to [`String#split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), but that one splits on all the occurrences, not just the first one. + + +## Install + +``` +$ npm install split-on-first +``` + + +## Usage + +```js +const splitOnFirst = require('split-on-first'); + +splitOnFirst('a-b-c', '-'); +//=> ['a', 'b-c'] + +splitOnFirst('key:value:value2', ':'); +//=> ['key', 'value:value2'] + +splitOnFirst('a---b---c', '---'); +//=> ['a', 'b---c'] + +splitOnFirst('a-b-c', '+'); +//=> ['a-b-c'] +``` + + +## API + +### splitOnFirst(string, separator) + +#### string + +Type: `string` + +The string to split. + +#### separator + +Type: `string` + +The separator to split on. + + +## Related + +- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/package-lock.json b/package-lock.json index 06a095a159fe7..d3b31a51178c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4802,11 +4802,12 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "query-string": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.4.0.tgz", - "integrity": "sha512-Werid2I41/tJTqOGPJ3cC3vwrIh/8ZupBQbp7BSsqXzr+pTin3aMJ/EZb8UEuk7ZO3VqQFvq2qck/ihc6wqIdw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.8.1.tgz", + "integrity": "sha512-g6y0Lbq10a5pPQpjlFuojfMfV1Pd2Jw9h75ypiYPPia3Gcq2rgkKiIwbkS6JxH7c5f5u/B/sB+d13PU+g1eu4Q==", "requires": { "decode-uri-component": "^0.2.0", + "split-on-first": "^1.0.0", "strict-uri-encode": "^2.0.0" } }, @@ -5369,6 +5370,11 @@ "spdx-ranges": "^2.0.0" } }, + "split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==" + }, "sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", diff --git a/package.json b/package.json index 5ccc6d35cad8a..dfae7acbf83fa 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "path-is-inside": "~1.0.2", "promise-inflight": "~1.0.1", "qrcode-terminal": "^0.12.0", - "query-string": "^6.4.0", + "query-string": "^6.8.1", "qw": "~1.0.1", "read": "~1.0.7", "read-cmd-shim": "~1.0.1",