From 40c17e12c5a734c37b88692e36221ac974c0c63d Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 12:06:53 -0400 Subject: [PATCH 01/39] cli-table3@0.6.0 --- node_modules/cli-table3/CHANGELOG.md | 25 +++++ node_modules/cli-table3/README.md | 8 +- node_modules/cli-table3/index.d.ts | 5 +- .../node_modules/ansi-regex/index.d.ts | 37 ++++++ .../node_modules/ansi-regex/index.js | 10 ++ .../node_modules/ansi-regex/license | 9 ++ .../node_modules/ansi-regex/package.json | 55 +++++++++ .../node_modules/ansi-regex/readme.md | 78 +++++++++++++ .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 ++++ .../node_modules/emoji-regex/README.md | 73 ++++++++++++ .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../node_modules/emoji-regex/index.d.ts | 23 ++++ .../node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 50 +++++++++ .../node_modules/emoji-regex/text.js | 6 + .../is-fullwidth-code-point/index.d.ts | 17 +++ .../is-fullwidth-code-point/index.js | 50 +++++++++ .../is-fullwidth-code-point/license | 9 ++ .../is-fullwidth-code-point/package.json | 42 +++++++ .../is-fullwidth-code-point/readme.md | 39 +++++++ .../node_modules/string-width/index.d.ts | 29 +++++ .../node_modules/string-width/index.js | 43 +++++++ .../node_modules/string-width/license | 9 ++ .../node_modules/string-width/package.json | 56 ++++++++++ .../node_modules/string-width/readme.md | 50 +++++++++ .../node_modules/strip-ansi/index.d.ts | 17 +++ .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 ++ .../node_modules/strip-ansi/package.json | 54 +++++++++ .../node_modules/strip-ansi/readme.md | 46 ++++++++ node_modules/cli-table3/package.json | 20 ++-- node_modules/cli-table3/src/cell.js | 4 +- node_modules/cli-table3/src/layout-manager.js | 26 ++--- node_modules/cli-table3/src/table.js | 10 +- node_modules/cli-table3/src/utils.js | 8 +- package-lock.json | 105 ++++++++++++++++-- package.json | 2 +- 38 files changed, 1013 insertions(+), 53 deletions(-) create mode 100644 node_modules/cli-table3/node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/cli-table3/node_modules/ansi-regex/index.js create mode 100644 node_modules/cli-table3/node_modules/ansi-regex/license create mode 100644 node_modules/cli-table3/node_modules/ansi-regex/package.json create mode 100644 node_modules/cli-table3/node_modules/ansi-regex/readme.md create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/README.md create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/index.js create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/package.json create mode 100644 node_modules/cli-table3/node_modules/emoji-regex/text.js create mode 100644 node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/cli-table3/node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/cli-table3/node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/cli-table3/node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/cli-table3/node_modules/string-width/index.d.ts create mode 100644 node_modules/cli-table3/node_modules/string-width/index.js create mode 100644 node_modules/cli-table3/node_modules/string-width/license create mode 100644 node_modules/cli-table3/node_modules/string-width/package.json create mode 100644 node_modules/cli-table3/node_modules/string-width/readme.md create mode 100644 node_modules/cli-table3/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/cli-table3/node_modules/strip-ansi/index.js create mode 100644 node_modules/cli-table3/node_modules/strip-ansi/license create mode 100644 node_modules/cli-table3/node_modules/strip-ansi/package.json create mode 100644 node_modules/cli-table3/node_modules/strip-ansi/readme.md diff --git a/node_modules/cli-table3/CHANGELOG.md b/node_modules/cli-table3/CHANGELOG.md index 3f6ba35f8393e..1ad2e7581458d 100644 --- a/node_modules/cli-table3/CHANGELOG.md +++ b/node_modules/cli-table3/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## v0.6.0 (2020-03-30) + +#### :boom: Breaking Change +* [#156](https://github.com/cli-table/cli-table3/pull/156) Drop support for Node 6 and 8 ([@Turbo87](https://github.com/Turbo87)) + +#### :bug: Bug Fix +* [#92](https://github.com/cli-table/cli-table3/pull/92) Emoji Length Calculation Fix ([@acupoftee](https://github.com/acupoftee)) +* [#53](https://github.com/cli-table/cli-table3/pull/53) "Table" union type definition fix ([@macieklad](https://github.com/macieklad)) + +#### :memo: Documentation +* [#135](https://github.com/cli-table/cli-table3/pull/135) docs: use https ([@DanielRuf](https://github.com/DanielRuf)) + +#### :house: Internal +* [#132](https://github.com/cli-table/cli-table3/pull/132) Update lockfile ([@DanielRuf](https://github.com/DanielRuf)) +* [#134](https://github.com/cli-table/cli-table3/pull/134) Fix ESLint errors ([@DanielRuf](https://github.com/DanielRuf)) +* [#103](https://github.com/cli-table/cli-table3/pull/103) Fix Jest configuration ([@boneskull](https://github.com/boneskull)) + +#### Committers: 5 +- Christopher Hiller ([@boneskull](https://github.com/boneskull)) +- Daniel Ruf ([@DanielRuf](https://github.com/DanielRuf)) +- Maciej Ładoś ([@macieklad](https://github.com/macieklad)) +- Tee ([@acupoftee](https://github.com/acupoftee)) +- Tobias Bieniek ([@Turbo87](https://github.com/Turbo87)) + + ## v0.5.1 (2018-07-19) #### :rocket: Enhancement diff --git a/node_modules/cli-table3/README.md b/node_modules/cli-table3/README.md index 693b544821728..03f805437cc4e 100644 --- a/node_modules/cli-table3/README.md +++ b/node_modules/cli-table3/README.md @@ -12,7 +12,7 @@ and [cli-table2](https://github.com/jamestalmage/cli-table2), which are both unmaintained. `cli-table3` includes all the additional features from `cli-table2`. -![Screenshot](http://i.imgur.com/sYq4T.png) +![Screenshot](https://i.imgur.com/sYq4T.png) ## Features not in the original cli-table @@ -30,7 +30,7 @@ unmaintained. `cli-table3` includes all the additional features from - Customizable characters that constitute the table. - Color/background styling in the header through - [colors.js](http://github.com/marak/colors.js) + [colors.js](https://github.com/marak/colors.js) - Column width customization - Text truncation based on predefined widths - Text alignment (left, right, center) @@ -187,8 +187,8 @@ $ yarn docs ## Credits -- James Talmage - author <james.talmage@jrtechnical.com> ([jamestalmage](http://github.com/jamestalmage)) -- Guillermo Rauch - author of the original cli-table <guillermo@learnboost.com> ([Guille](http://github.com/guille)) +- James Talmage - author <james.talmage@jrtechnical.com> ([jamestalmage](https://github.com/jamestalmage)) +- Guillermo Rauch - author of the original cli-table <guillermo@learnboost.com> ([Guille](https://github.com/guille)) ## License diff --git a/node_modules/cli-table3/index.d.ts b/node_modules/cli-table3/index.d.ts index bdf17e270ea84..aa94b7440d0ea 100644 --- a/node_modules/cli-table3/index.d.ts +++ b/node_modules/cli-table3/index.d.ts @@ -68,18 +68,15 @@ declare namespace CliTable3 { readonly width: number; } - type Table = HorizontalTable | VerticalTable | CrossTable; + type Table = GenericTable; type Cell = CellValue | CellOptions; - type HorizontalTable = GenericTable; type HorizontalTableRow = Cell[]; - type VerticalTable = GenericTable; interface VerticalTableRow { [name: string]: Cell; } - type CrossTable = GenericTable; interface CrossTableRow { [name: string]: Cell[]; } diff --git a/node_modules/cli-table3/node_modules/ansi-regex/index.d.ts b/node_modules/cli-table3/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000000000..2dbf6af2b6f3b --- /dev/null +++ b/node_modules/cli-table3/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/cli-table3/node_modules/ansi-regex/index.js b/node_modules/cli-table3/node_modules/ansi-regex/index.js new file mode 100644 index 0000000000000..35054aa6774af --- /dev/null +++ b/node_modules/cli-table3/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/cli-table3/node_modules/ansi-regex/license b/node_modules/cli-table3/node_modules/ansi-regex/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/cli-table3/node_modules/ansi-regex/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/cli-table3/node_modules/ansi-regex/package.json b/node_modules/cli-table3/node_modules/ansi-regex/package.json new file mode 100644 index 0000000000000..7af801f352220 --- /dev/null +++ b/node_modules/cli-table3/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/cli-table3/node_modules/ansi-regex/readme.md b/node_modules/cli-table3/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000000000..3c2b77c4354b6 --- /dev/null +++ b/node_modules/cli-table3/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + 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/cli-table3/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/cli-table3/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000000000..a41e0a7ef970e --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +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/cli-table3/node_modules/emoji-regex/README.md b/node_modules/cli-table3/node_modules/emoji-regex/README.md new file mode 100644 index 0000000000000..f10e173335047 --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/cli-table3/node_modules/emoji-regex/es2015/index.js b/node_modules/cli-table3/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000000000..b4cf3dcd38993 --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9D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u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/cli-table3/node_modules/emoji-regex/es2015/text.js b/node_modules/cli-table3/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000000000..780309df58f1a --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1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F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/cli-table3/node_modules/emoji-regex/index.d.ts b/node_modules/cli-table3/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000000000..1955b4704ecfc --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,23 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/cli-table3/node_modules/emoji-regex/index.js b/node_modules/cli-table3/node_modules/emoji-regex/index.js new file mode 100644 index 0000000000000..d993a3a99cb95 --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDF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-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/cli-table3/node_modules/emoji-regex/package.json b/node_modules/cli-table3/node_modules/emoji-regex/package.json new file mode 100644 index 0000000000000..6d323528292b0 --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/package.json @@ -0,0 +1,50 @@ +{ + "name": "emoji-regex", + "version": "8.0.0", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/node_modules/cli-table3/node_modules/emoji-regex/text.js b/node_modules/cli-table3/node_modules/emoji-regex/text.js new file mode 100644 index 0000000000000..0a55ce2f2308a --- /dev/null +++ b/node_modules/cli-table3/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D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u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.d.ts b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.d.ts new file mode 100644 index 0000000000000..729d2020516f0 --- /dev/null +++ b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.d.ts @@ -0,0 +1,17 @@ +/** +Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). + +@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + +@example +``` +import isFullwidthCodePoint from 'is-fullwidth-code-point'; + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` +*/ +export default function isFullwidthCodePoint(codePoint: number): boolean; diff --git a/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.js b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 0000000000000..671f97f760779 --- /dev/null +++ b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,50 @@ +/* eslint-disable yoda */ +'use strict'; + +const isFullwidthCodePoint = codePoint => { + if (Number.isNaN(codePoint)) { + return false; + } + + // Code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + codePoint >= 0x1100 && ( + codePoint <= 0x115F || // Hangul Jamo + codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET + codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= codePoint && codePoint <= 0x4DBF) || + // CJK Unified Ideographs .. Yi Radicals + (0x4E00 <= codePoint && codePoint <= 0xA4C6) || + // Hangul Jamo Extended-A + (0xA960 <= codePoint && codePoint <= 0xA97C) || + // Hangul Syllables + (0xAC00 <= codePoint && codePoint <= 0xD7A3) || + // CJK Compatibility Ideographs + (0xF900 <= codePoint && codePoint <= 0xFAFF) || + // Vertical Forms + (0xFE10 <= codePoint && codePoint <= 0xFE19) || + // CJK Compatibility Forms .. Small Form Variants + (0xFE30 <= codePoint && codePoint <= 0xFE6B) || + // Halfwidth and Fullwidth Forms + (0xFF01 <= codePoint && codePoint <= 0xFF60) || + (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || + // Kana Supplement + (0x1B000 <= codePoint && codePoint <= 0x1B001) || + // Enclosed Ideographic Supplement + (0x1F200 <= codePoint && codePoint <= 0x1F251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= codePoint && codePoint <= 0x3FFFD) + ) + ) { + return true; + } + + return false; +}; + +module.exports = isFullwidthCodePoint; +module.exports.default = isFullwidthCodePoint; diff --git a/node_modules/cli-table3/node_modules/is-fullwidth-code-point/license b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/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/cli-table3/node_modules/is-fullwidth-code-point/package.json b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 0000000000000..2137e888fa503 --- /dev/null +++ b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,42 @@ +{ + "name": "is-fullwidth-code-point", + "version": "3.0.0", + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "license": "MIT", + "repository": "sindresorhus/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "string", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/cli-table3/node_modules/is-fullwidth-code-point/readme.md b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 0000000000000..4236bba980d8f --- /dev/null +++ b/node_modules/cli-table3/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt(0)); +//=> true + +isFullwidthCodePoint('a'.codePointAt(0)); +//=> false +``` + + +## API + +### isFullwidthCodePoint(codePoint) + +#### codePoint + +Type: `number` + +The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/cli-table3/node_modules/string-width/index.d.ts b/node_modules/cli-table3/node_modules/string-width/index.d.ts new file mode 100644 index 0000000000000..12b5309751dd5 --- /dev/null +++ b/node_modules/cli-table3/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/cli-table3/node_modules/string-width/index.js b/node_modules/cli-table3/node_modules/string-width/index.js new file mode 100644 index 0000000000000..a348067f032df --- /dev/null +++ b/node_modules/cli-table3/node_modules/string-width/index.js @@ -0,0 +1,43 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + string = string.replace(emojiRegex(), ' '); + + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/cli-table3/node_modules/string-width/license b/node_modules/cli-table3/node_modules/string-width/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/cli-table3/node_modules/string-width/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/cli-table3/node_modules/string-width/package.json b/node_modules/cli-table3/node_modules/string-width/package.json new file mode 100644 index 0000000000000..5751de5a6464e --- /dev/null +++ b/node_modules/cli-table3/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.0", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/cli-table3/node_modules/string-width/readme.md b/node_modules/cli-table3/node_modules/string-width/readme.md new file mode 100644 index 0000000000000..705f206001b77 --- /dev/null +++ b/node_modules/cli-table3/node_modules/string-width/readme.md @@ -0,0 +1,50 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + 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/cli-table3/node_modules/strip-ansi/index.d.ts b/node_modules/cli-table3/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000000000..907fccc29269e --- /dev/null +++ b/node_modules/cli-table3/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/cli-table3/node_modules/strip-ansi/index.js b/node_modules/cli-table3/node_modules/strip-ansi/index.js new file mode 100644 index 0000000000000..9a593dfcd1fd5 --- /dev/null +++ b/node_modules/cli-table3/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/cli-table3/node_modules/strip-ansi/license b/node_modules/cli-table3/node_modules/strip-ansi/license new file mode 100644 index 0000000000000..e7af2f77107d7 --- /dev/null +++ b/node_modules/cli-table3/node_modules/strip-ansi/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/cli-table3/node_modules/strip-ansi/package.json b/node_modules/cli-table3/node_modules/strip-ansi/package.json new file mode 100644 index 0000000000000..65a6c95161f74 --- /dev/null +++ b/node_modules/cli-table3/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.0", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/cli-table3/node_modules/strip-ansi/readme.md b/node_modules/cli-table3/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000000000..7c4b56d46ddc7 --- /dev/null +++ b/node_modules/cli-table3/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/cli-table3/package.json b/node_modules/cli-table3/package.json index 988089057285d..7d8542e17c008 100644 --- a/node_modules/cli-table3/package.json +++ b/node_modules/cli-table3/package.json @@ -1,6 +1,6 @@ { "name": "cli-table3", - "version": "0.5.1", + "version": "0.6.0", "description": "Pretty unicode tables for the command line. Based on the original cli-table.", "main": "index.js", "types": "index.d.ts", @@ -14,17 +14,17 @@ }, "dependencies": { "object-assign": "^4.1.0", - "string-width": "^2.1.1" + "string-width": "^4.2.0" }, "devDependencies": { "ansi-256-colors": "^1.1.0", "cli-table": "^0.3.1", - "eslint-config-prettier": "^2.9.0", - "eslint-plugin-prettier": "^2.6.0", - "jest": "^23.1.0", - "jest-runner-eslint": "^0.6.0", - "lerna-changelog": "^0.8.0", - "prettier": "1.13.7" + "eslint-config-prettier": "^6.0.0", + "eslint-plugin-prettier": "^3.0.0", + "jest": "^24.0.0", + "jest-runner-eslint": "^0.7.0", + "lerna-changelog": "^1.0.1", + "prettier": "2.0.2" }, "optionalDependencies": { "colors": "^1.1.2" @@ -59,7 +59,7 @@ }, "homepage": "https://github.com/cli-table/cli-table3", "engines": { - "node": ">=6" + "node": "10.* || >= 12.*" }, "changelog": { "repo": "cli-table/cli-table3", @@ -76,7 +76,7 @@ { "displayName": "test", "testMatch": [ - "**/test/**/*-test(s)?.js" + "/test/*.js" ] }, { diff --git a/node_modules/cli-table3/src/cell.js b/node_modules/cli-table3/src/cell.js index 2db7f74d72cb3..b8da994a61a5a 100644 --- a/node_modules/cli-table3/src/cell.js +++ b/node_modules/cli-table3/src/cell.js @@ -44,7 +44,7 @@ class Cell { let optionsChars = this.options.chars || {}; let tableChars = tableOptions.chars; let chars = (this.chars = {}); - CHAR_NAMES.forEach(function(name) { + CHAR_NAMES.forEach(function (name) { setOption(optionsChars, tableChars, name, chars); }); @@ -138,7 +138,7 @@ class Cell { let content = []; if (this.cells) { //TODO: cells should always exist - some tests don't fill it in though - this.widths.forEach(function(width, index) { + this.widths.forEach(function (width, index) { content.push(this._topLeftChar(index)); content.push(utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'], width)); }, this); diff --git a/node_modules/cli-table3/src/layout-manager.js b/node_modules/cli-table3/src/layout-manager.js index 908040e7e5378..8bcef03a0e09e 100644 --- a/node_modules/cli-table3/src/layout-manager.js +++ b/node_modules/cli-table3/src/layout-manager.js @@ -2,10 +2,10 @@ const objectAssign = require('object-assign'); const Cell = require('./cell'); const { ColSpanCell, RowSpanCell } = Cell; -(function() { +(function () { function layoutTable(table) { - table.forEach(function(row, rowIndex) { - row.forEach(function(cell, columnIndex) { + table.forEach(function (row, rowIndex) { + row.forEach(function (cell, columnIndex) { cell.y = rowIndex; cell.x = columnIndex; for (let y = rowIndex; y >= 0; y--) { @@ -24,8 +24,8 @@ const { ColSpanCell, RowSpanCell } = Cell; function maxWidth(table) { let mw = 0; - table.forEach(function(row) { - row.forEach(function(cell) { + table.forEach(function (row) { + row.forEach(function (cell) { mw = Math.max(mw, cell.x + (cell.colSpan || 1)); }); }); @@ -76,8 +76,8 @@ const { ColSpanCell, RowSpanCell } = Cell; } function addRowSpanCells(table) { - table.forEach(function(row, rowIndex) { - row.forEach(function(cell) { + table.forEach(function (row, rowIndex) { + row.forEach(function (cell) { for (let i = 1; i < cell.rowSpan; i++) { let rowSpanCell = new RowSpanCell(cell); rowSpanCell.x = cell.x; @@ -140,7 +140,7 @@ const { ColSpanCell, RowSpanCell } = Cell; } function generateCells(rows) { - return rows.map(function(row) { + return rows.map(function (row) { if (!Array.isArray(row)) { let key = Object.keys(row)[0]; row = row[key]; @@ -151,7 +151,7 @@ const { ColSpanCell, RowSpanCell } = Cell; row = [key, row]; } } - return row.map(function(cell) { + return row.map(function (cell) { return new Cell(cell); }); }); @@ -178,11 +178,11 @@ const { ColSpanCell, RowSpanCell } = Cell; })(); function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) { - return function(vals, table) { + return function (vals, table) { let result = []; let spanners = []; - table.forEach(function(row) { - row.forEach(function(cell) { + table.forEach(function (row) { + row.forEach(function (cell) { if ((cell[colSpan] || 1) > 1) { spanners.push(cell); } else { @@ -191,7 +191,7 @@ function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) { }); }); - vals.forEach(function(val, index) { + vals.forEach(function (val, index) { if (typeof val === 'number') { result[index] = val; } diff --git a/node_modules/cli-table3/src/table.js b/node_modules/cli-table3/src/table.js index af4f146463462..4fb33eccf6406 100644 --- a/node_modules/cli-table3/src/table.js +++ b/node_modules/cli-table3/src/table.js @@ -22,8 +22,8 @@ class Table extends Array { let cells = tableLayout.makeTableLayout(array); - cells.forEach(function(row) { - row.forEach(function(cell) { + cells.forEach(function (row) { + row.forEach(function (cell) { cell.mergeTableOptions(this.options, cells); }, this); }, this); @@ -31,8 +31,8 @@ class Table extends Array { tableLayout.computeWidths(this.options.colWidths, cells); tableLayout.computeHeights(this.options.rowHeights, cells); - cells.forEach(function(row) { - row.forEach(function(cell) { + cells.forEach(function (row) { + row.forEach(function (cell) { cell.init(this.options); }, this); }, this); @@ -67,7 +67,7 @@ class Table extends Array { function doDraw(row, lineNum, result) { let line = []; - row.forEach(function(cell) { + row.forEach(function (cell) { line.push(cell.draw(lineNum)); }); let str = line.join(''); diff --git a/node_modules/cli-table3/src/utils.js b/node_modules/cli-table3/src/utils.js index c9149558e24b9..3ac919c532611 100644 --- a/node_modules/cli-table3/src/utils.js +++ b/node_modules/cli-table3/src/utils.js @@ -9,7 +9,7 @@ function strlen(str) { let code = codeRegex(); let stripped = ('' + str).replace(code, ''); let split = stripped.split('\n'); - return split.reduce(function(memo, s) { + return split.reduce(function (memo, s) { return stringWidth(s) > memo ? stringWidth(s) : memo; }, 0); } @@ -72,7 +72,7 @@ function updateState(state, controlChars) { if (controlCode === 0) { for (let i in state) { /* istanbul ignore else */ - if (state.hasOwnProperty(i)) { + if (Object.prototype.hasOwnProperty.call(state, i)) { delete state[i]; } } @@ -102,7 +102,7 @@ function unwindState(state, ret) { delete state.lastBackgroundAdded; delete state.lastForegroundAdded; - Object.keys(state).forEach(function(key) { + Object.keys(state).forEach(function (key) { if (state[key]) { ret += codeCache[key].off; } @@ -125,7 +125,7 @@ function rewindState(state, ret) { delete state.lastBackgroundAdded; delete state.lastForegroundAdded; - Object.keys(state).forEach(function(key) { + Object.keys(state).forEach(function (key) { if (state[key]) { ret = codeCache[key].on + ret; } diff --git a/package-lock.json b/package-lock.json index a245e94ce0a8b..fed41b0ca7d53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,7 +103,7 @@ "chalk": "^4.1.0", "chownr": "^2.0.0", "cli-columns": "^3.1.2", - "cli-table3": "^0.5.1", + "cli-table3": "^0.6.0", "columnify": "~1.5.4", "config-chain": "^1.1.12", "editor": "~1.0.0", @@ -1177,22 +1177,72 @@ } }, "node_modules/cli-table3": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", - "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", + "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", "inBundle": true, "dependencies": { "colors": "^1.1.2", "object-assign": "^4.1.0", - "string-width": "^2.1.1" + "string-width": "^4.2.0" }, "engines": { - "node": ">=6" + "node": "10.* || >= 12.*" }, "optionalDependencies": { "colors": "^1.1.2" } }, + "node_modules/cli-table3/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "inBundle": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "inBundle": true + }, + "node_modules/cli-table3/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "inBundle": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "inBundle": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "inBundle": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -9890,13 +9940,48 @@ } }, "cli-table3": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", - "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", + "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", "requires": { "colors": "^1.1.2", "object-assign": "^4.1.0", - "string-width": "^2.1.1" + "string-width": "^4.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "cliui": { diff --git a/package.json b/package.json index 64178bf6f973f..053a7faef73a6 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "chalk": "^4.1.0", "chownr": "^2.0.0", "cli-columns": "^3.1.2", - "cli-table3": "^0.5.1", + "cli-table3": "^0.6.0", "columnify": "~1.5.4", "config-chain": "^1.1.12", "editor": "~1.0.0", From 47a8ca1d72f0f0835b45cfb2c4fb8ab1218dc14a Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 12:17:50 -0400 Subject: [PATCH 02/39] byte-size@7.0.0 --- node_modules/byte-size/LICENSE | 2 +- node_modules/byte-size/README.hbs | 136 +++++++++++++++- node_modules/byte-size/README.md | 227 +++++++++++++++++---------- node_modules/byte-size/dist/index.js | 211 +++++++++++-------------- node_modules/byte-size/index.mjs | 211 +++++++++++-------------- node_modules/byte-size/package.json | 36 +++-- package-lock.json | 16 +- package.json | 2 +- 8 files changed, 490 insertions(+), 351 deletions(-) diff --git a/node_modules/byte-size/LICENSE b/node_modules/byte-size/LICENSE index b95c652e2b473..d9e1e9d6918a4 100644 --- a/node_modules/byte-size/LICENSE +++ b/node_modules/byte-size/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-18 Lloyd Brookes <75pound@gmail.com> +Copyright (c) 2014-20 Lloyd Brookes <75pound@gmail.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 diff --git a/node_modules/byte-size/README.hbs b/node_modules/byte-size/README.hbs index 8a57e4a9c784a..5b677f2a98870 100644 --- a/node_modules/byte-size/README.hbs +++ b/node_modules/byte-size/README.hbs @@ -1,13 +1,135 @@ -[![view on npm](https://img.shields.io/npm/v/byte-size.svg)](https://www.npmjs.org/package/byte-size) -[![npm module downloads](https://img.shields.io/npm/dt/byte-size.svg)](https://www.npmjs.org/package/byte-size) +[![view on npm](https://badgen.net/npm/v/byte-size)](https://www.npmjs.org/package/byte-size) +[![npm module downloads](https://badgen.net/npm/dt/byte-size)](https://www.npmjs.org/package/byte-size) +[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/byte-size)](https://github.com/75lb/byte-size/network/dependents?dependent_type=REPOSITORY) +[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/byte-size)](https://github.com/75lb/byte-size/network/dependents?dependent_type=PACKAGE) [![Build Status](https://travis-ci.org/75lb/byte-size.svg?branch=master)](https://travis-ci.org/75lb/byte-size) -[![Coverage Status](https://coveralls.io/repos/github/75lb/byte-size/badge.svg?branch=master)](https://coveralls.io/github/75lb/byte-size?branch=master) -[![Dependency Status](https://david-dm.org/75lb/byte-size.svg)](https://david-dm.org/75lb/byte-size) +[![Coverage Status](https://coveralls.io/repos/github/75lb/byte-size/badge.svg)](https://coveralls.io/github/75lb/byte-size) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) +***Upgraders, please check the [release notes](https://github.com/75lb/byte-size/releases).*** + +# byte-size + +An isomorphic, load-anywhere function to convert a bytes value (e.g. `3456`) to a human-readable string (`'3.5 kB'`). Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte) (summarised below) or specify your own custom units. + +Value | Metric | Metric (octet) | +----- | ------------- | -------------- | +1000 | kB kilobyte | ko kilooctet | +1000^2 | MB megabyte | Mo megaoctet | +1000^3 | GB gigabyte | Go gigaoctet | +1000^4 | TB terabyte | To teraoctet | +1000^5 | PB petabyte | Po petaoctet | +1000^6 | EB exabyte | Eo exaoctet | +1000^7 | ZB zettabyte | Zo zettaoctet | +1000^8 | YB yottabyte | Yo yottaoctet | + +Value | IEC | IEC (octet) | +------ | ------------ | ------------- | +1024 | KiB kibibyte | Kio kibioctet | +1024^2 | MiB mebibyte | Mio mebioctet | +1024^3 | GiB gibibyte | Gio gibioctet | +1024^4 | TiB tebibyte | Tio tebioctet | +1024^5 | PiB pebibyte | Pio pebioctet | +1024^6 | EiB exbibyte | Eio exbioctet | +1024^7 | ZiB zebibyte | Zio zebioctet | +1024^8 | YiB yobibyte | Yio yobioctet | + +## Synopsis + +By default, `byteSize` converts the input number to a human readable string with metric units and a precision of 1. + +```js +> const byteSize = require('byte-size') + +> byteSize(1580) +{ value: '1.6', unit: 'kB', long: 'kilobytes' } +``` + +The object returned by `byteSize` defines a `toString` method therefore can be used directly in string context. + +```js +> `Filesize: ${byteSize(12400)}` +'Filesize: 12.4 kB' +``` + +Override the default `toString` behaviour by setting [`options.toStringFn`](#bytesizebytes-options--object-). + +```js +> function toStringFn () { + return `**${this.value}${this.unit}**` +} + +> `Filesize: ${byteSize(12400, { toStringFn })}` +'Filesize: **12.4kB**' +``` + +Beside the default of `metric`, there are three other built-in units available: `metric_octet`, `iec` and `iec_octet`. + +```js +> byteSize(1580, { units: 'iec' }) +{ value: '1.5', unit: 'KiB', long: 'kibibytes' } + +> byteSize(1580, { units: 'iec_octet' }) +{ value: '1.5', unit: 'Kio', long: 'kibioctets' } + +> byteSize(1580, { units: 'metric_octet' }) +{ value: '1.6', unit: 'ko', long: 'kilooctets' } +``` + +You can adjust the `precision`. + +```js +> byteSize(1580, { units: 'iec', precision: 3 }) +{ value: '1.543', unit: 'KiB', long: 'kibibytes' } + +> byteSize(1580, { units: 'iec', precision: 0 }) +{ value: '2', unit: 'KiB', long: 'kibibytes' } +``` + +Define custom units by passing an object containing one or more additional conversion tables to `options.customUnits`. In `options.units`, specify the name of a property from the `customUnits` object. + +```js +> const customUnits = { + simple: [ + { from: 0 , to: 1e3 , unit: '' }, + { from: 1e3 , to: 1e6 , unit: 'K', long: 'thousand' }, + { from: 1e6 , to: 1e9 , unit: 'Mn', long: 'million' }, + { from: 1e9 , to: 1e12, unit: 'Bn', long: 'billion' } + ] +} + +> const { value, unit } = byteSize(10000, { customUnits, units: 'simple' }) + +> `${value}${unit}` +'10.0K' +``` + +Override the built-in defaults for the duration of the process by passing an options object to `byteSize.defaultOptions()`. This results in cleaner code in cases where `byteSize` is used often with the same options. + +```js +> byteSize.defaultOptions({ + units: 'simple', + precision: 2, + customUnits: { + simple: [ + { from: 0, to: 1e3, unit: '' }, + { from: 1e3, to: 1e6, unit: 'k' }, + { from: 1e6, to: 1e9, unit: 'm' }, + { from: 1e9, to: 1e12, unit: 'bn' }, + ] + }, + toStringFn: function () { + return this.value + this.unit + } +}) + +> [2400, 16400, 3991200].map(byteSize).join(', ') +'2.40k, 16.40k, 3.99m' +``` + {{>main}} -### Load anywhere +## Load anywhere This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. @@ -37,4 +159,6 @@ Old browser (adds `window.byteSize`): * * * -© 2014-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). +© 2014-20 Lloyd Brookes \<75pound@gmail.com\>. + +Isomorphic test suite by [test-runner](https://github.com/test-runner-js/test-runner) and [web-runner](https://github.com/test-runner-js/web-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). diff --git a/node_modules/byte-size/README.md b/node_modules/byte-size/README.md index 9a36daaf52f48..71f47b1e49b3c 100644 --- a/node_modules/byte-size/README.md +++ b/node_modules/byte-size/README.md @@ -1,106 +1,169 @@ -[![view on npm](https://img.shields.io/npm/v/byte-size.svg)](https://www.npmjs.org/package/byte-size) -[![npm module downloads](https://img.shields.io/npm/dt/byte-size.svg)](https://www.npmjs.org/package/byte-size) +[![view on npm](https://badgen.net/npm/v/byte-size)](https://www.npmjs.org/package/byte-size) +[![npm module downloads](https://badgen.net/npm/dt/byte-size)](https://www.npmjs.org/package/byte-size) +[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/byte-size)](https://github.com/75lb/byte-size/network/dependents?dependent_type=REPOSITORY) +[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/byte-size)](https://github.com/75lb/byte-size/network/dependents?dependent_type=PACKAGE) [![Build Status](https://travis-ci.org/75lb/byte-size.svg?branch=master)](https://travis-ci.org/75lb/byte-size) -[![Coverage Status](https://coveralls.io/repos/github/75lb/byte-size/badge.svg?branch=master)](https://coveralls.io/github/75lb/byte-size?branch=master) -[![Dependency Status](https://david-dm.org/75lb/byte-size.svg)](https://david-dm.org/75lb/byte-size) +[![Coverage Status](https://coveralls.io/repos/github/75lb/byte-size/badge.svg)](https://coveralls.io/github/75lb/byte-size) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) - +***Upgraders, please check the [release notes](https://github.com/75lb/byte-size/releases).*** -## byte-size -An isomorphic, load-anywhere function to convert a bytes value into a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. - -Value | Metric ------ | ------------- -1000 | kB kilobyte -1000^2 | MB megabyte -1000^3 | GB gigabyte -1000^4 | TB terabyte -1000^5 | PB petabyte -1000^6 | EB exabyte -1000^7 | ZB zettabyte -1000^8 | YB yottabyte - -Value | IEC ------ | ------------ -1024 | KiB kibibyte -1024^2 | MiB mebibyte -1024^3 | GiB gibibyte -1024^4 | TiB tebibyte -1024^5 | PiB pebibyte -1024^6 | EiB exbibyte -1024^7 | ZiB zebibyte -1024^8 | YiB yobibyte - -Value | Metric (octet) ------ | ------------- -1000 | ko kilooctet -1000^2 | Mo megaoctet -1000^3 | Go gigaoctet -1000^4 | To teraoctet -1000^5 | Po petaoctet -1000^6 | Eo exaoctet -1000^7 | Zo zettaoctet -1000^8 | Yo yottaoctet - -Value | IEC (octet) ------ | ------------ -1024 | Kio kilooctet -1024^2 | Mio mebioctet -1024^3 | Gio gibioctet -1024^4 | Tio tebioctet -1024^5 | Pio pebioctet -1024^6 | Eio exbioctet -1024^7 | Zio zebioctet -1024^8 | Yio yobioctet - -**Example** -```js -const byteSize = require('byte-size') -``` - +# byte-size -### byteSize(bytes, [options]) ⇒ Object ⏏ -**Kind**: Exported function +An isomorphic, load-anywhere function to convert a bytes value (e.g. `3456`) to a human-readable string (`'3.5 kB'`). Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte) (summarised below) or specify your own custom units. -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| bytes | number | | the bytes value to convert. | -| [options] | object | | optional config. | -| [options.precision] | number | 1 | number of decimal places. | -| [options.units] | string | "metric" | select `'metric'`, `'iec'`, `'metric_octet'` or `'iec_octet'` units. | +Value | Metric | Metric (octet) | +----- | ------------- | -------------- | +1000 | kB kilobyte | ko kilooctet | +1000^2 | MB megabyte | Mo megaoctet | +1000^3 | GB gigabyte | Go gigaoctet | +1000^4 | TB terabyte | To teraoctet | +1000^5 | PB petabyte | Po petaoctet | +1000^6 | EB exabyte | Eo exaoctet | +1000^7 | ZB zettabyte | Zo zettaoctet | +1000^8 | YB yottabyte | Yo yottaoctet | + +Value | IEC | IEC (octet) | +------ | ------------ | ------------- | +1024 | KiB kibibyte | Kio kibioctet | +1024^2 | MiB mebibyte | Mio mebioctet | +1024^3 | GiB gibibyte | Gio gibioctet | +1024^4 | TiB tebibyte | Tio tebioctet | +1024^5 | PiB pebibyte | Pio pebioctet | +1024^6 | EiB exbibyte | Eio exbioctet | +1024^7 | ZiB zebibyte | Zio zebioctet | +1024^8 | YiB yobibyte | Yio yobioctet | + +## Synopsis + +By default, `byteSize` converts the input number to a human readable string with metric units and a precision of 1. -**Example** ```js > const byteSize = require('byte-size') > byteSize(1580) -{ value: '1.6', unit: 'kB' } +{ value: '1.6', unit: 'kB', long: 'kilobytes' } +``` + +The object returned by `byteSize` defines a `toString` method therefore can be used directly in string context. + +```js +> `Filesize: ${byteSize(12400)}` +'Filesize: 12.4 kB' +``` + +Override the default `toString` behaviour by setting [`options.toStringFn`](#bytesizebytes-options--object-). + +```js +> function toStringFn () { + return `**${this.value}${this.unit}**` +} + +> `Filesize: ${byteSize(12400, { toStringFn })}` +'Filesize: **12.4kB**' +``` +Beside the default of `metric`, there are three other built-in units available: `metric_octet`, `iec` and `iec_octet`. + +```js > byteSize(1580, { units: 'iec' }) -{ value: '1.5', unit: 'KiB' } +{ value: '1.5', unit: 'KiB', long: 'kibibytes' } + +> byteSize(1580, { units: 'iec_octet' }) +{ value: '1.5', unit: 'Kio', long: 'kibioctets' } + +> byteSize(1580, { units: 'metric_octet' }) +{ value: '1.6', unit: 'ko', long: 'kilooctets' } +``` + +You can adjust the `precision`. +```js > byteSize(1580, { units: 'iec', precision: 3 }) -{ value: '1.543', unit: 'KiB' } +{ value: '1.543', unit: 'KiB', long: 'kibibytes' } > byteSize(1580, { units: 'iec', precision: 0 }) -{ value: '2', unit: 'KiB' } +{ value: '2', unit: 'KiB', long: 'kibibytes' } +``` -> byteSize(1580, { units: 'metric_octet' }) -{ value: '1.6', unit: 'ko' } +Define custom units by passing an object containing one or more additional conversion tables to `options.customUnits`. In `options.units`, specify the name of a property from the `customUnits` object. -> byteSize(1580, { units: 'iec_octet' }) -{ value: '1.5', unit: 'Kio' } +```js +> const customUnits = { + simple: [ + { from: 0 , to: 1e3 , unit: '' }, + { from: 1e3 , to: 1e6 , unit: 'K', long: 'thousand' }, + { from: 1e6 , to: 1e9 , unit: 'Mn', long: 'million' }, + { from: 1e9 , to: 1e12, unit: 'Bn', long: 'billion' } + ] +} + +> const { value, unit } = byteSize(10000, { customUnits, units: 'simple' }) + +> `${value}${unit}` +'10.0K' +``` -> byteSize(1580, { units: 'iec_octet' }).toString() -'1.5 Kio' +Override the built-in defaults for the duration of the process by passing an options object to `byteSize.defaultOptions()`. This results in cleaner code in cases where `byteSize` is used often with the same options. -> const { value, unit } = byteSize(1580, { units: 'iec_octet' }) -> `${value} ${unit}` -'1.5 Kio' +```js +> byteSize.defaultOptions({ + units: 'simple', + precision: 2, + customUnits: { + simple: [ + { from: 0, to: 1e3, unit: '' }, + { from: 1e3, to: 1e6, unit: 'k' }, + { from: 1e6, to: 1e9, unit: 'm' }, + { from: 1e9, to: 1e12, unit: 'bn' }, + ] + }, + toStringFn: function () { + return this.value + this.unit + } +}) + +> [2400, 16400, 3991200].map(byteSize).join(', ') +'2.40k, 16.40k, 3.99m' ``` -### Load anywhere + + +## byte-size + +* [byte-size](#module_byte-size) + * [byteSize(bytes, [options])](#exp_module_byte-size--byteSize) ⇒ object ⏏ + * [.defaultOptions(options)](#module_byte-size--byteSize.defaultOptions) + + + +### byteSize(bytes, [options]) ⇒ object ⏏ +Returns an object with the spec `{ value: string, unit: string, long: string }`. The returned object defines a `toString` method meaning it can be used in any string context. + +**Kind**: Exported function + +| Param | Type | Description | +| --- | --- | --- | +| bytes | number | The bytes value to convert. | +| [options] | object | Optional config. | +| [options.precision] | number | Number of decimal places. Defaults to `1`. | +| [options.units] | string | Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`. | +| [options.customUnits] | object | An object containing one or more custom unit lookup tables. | +| [options.toStringFn] | function | A `toString` function to override the default. | + + + +#### byteSize.defaultOptions(options) +Set the default `byteSize` options for the duration of the process. + +**Kind**: static method of [byteSize](#exp_module_byte-size--byteSize) + +| Param | Type | Description | +| --- | --- | --- | +| options | object | A `byteSize` options object. | + + +## Load anywhere This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. @@ -130,4 +193,6 @@ Old browser (adds `window.byteSize`): * * * -© 2014-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). +© 2014-20 Lloyd Brookes \<75pound@gmail.com\>. + +Isomorphic test suite by [test-runner](https://github.com/test-runner-js/test-runner) and [web-runner](https://github.com/test-runner-js/web-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). diff --git a/node_modules/byte-size/dist/index.js b/node_modules/byte-size/dist/index.js index 8253a63545b3a..78129d8b02d21 100644 --- a/node_modules/byte-size/dist/index.js +++ b/node_modules/byte-size/dist/index.js @@ -2,151 +2,122 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.byteSize = factory()); -}(this, function () { 'use strict'; +}(this, (function () { 'use strict'; /** - * An isomorphic, load-anywhere function to convert a bytes value into a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. - * - * Value | Metric - * ----- | ------------- - * 1000 | kB kilobyte - * 1000^2 | MB megabyte - * 1000^3 | GB gigabyte - * 1000^4 | TB terabyte - * 1000^5 | PB petabyte - * 1000^6 | EB exabyte - * 1000^7 | ZB zettabyte - * 1000^8 | YB yottabyte - * - * Value | IEC - * ----- | ------------ - * 1024 | KiB kibibyte - * 1024^2 | MiB mebibyte - * 1024^3 | GiB gibibyte - * 1024^4 | TiB tebibyte - * 1024^5 | PiB pebibyte - * 1024^6 | EiB exbibyte - * 1024^7 | ZiB zebibyte - * 1024^8 | YiB yobibyte - * - * Value | Metric (octet) - * ----- | ------------- - * 1000 | ko kilooctet - * 1000^2 | Mo megaoctet - * 1000^3 | Go gigaoctet - * 1000^4 | To teraoctet - * 1000^5 | Po petaoctet - * 1000^6 | Eo exaoctet - * 1000^7 | Zo zettaoctet - * 1000^8 | Yo yottaoctet - * - * Value | IEC (octet) - * ----- | ------------ - * 1024 | Kio kilooctet - * 1024^2 | Mio mebioctet - * 1024^3 | Gio gibioctet - * 1024^4 | Tio tebioctet - * 1024^5 | Pio pebioctet - * 1024^6 | Eio exbioctet - * 1024^7 | Zio zebioctet - * 1024^8 | Yio yobioctet - * * @module byte-size - * @example - * ```js - * const byteSize = require('byte-size') - * ``` */ + let defaultOptions = {}; + const _options = new WeakMap(); + class ByteSize { constructor (bytes, options) { - options = options || {}; - options.units = options.units || 'metric'; - options.precision = typeof options.precision === 'undefined' ? 1 : options.precision; + options = Object.assign({ + units: 'metric', + precision: 1 + }, defaultOptions, options); + _options.set(this, options); - const table = [ - { expFrom: 0, expTo: 1, metric: 'B', iec: 'B', metric_octet: 'o', iec_octet: 'o' }, - { expFrom: 1, expTo: 2, metric: 'kB', iec: 'KiB', metric_octet: 'ko', iec_octet: 'Kio' }, - { expFrom: 2, expTo: 3, metric: 'MB', iec: 'MiB', metric_octet: 'Mo', iec_octet: 'Mio' }, - { expFrom: 3, expTo: 4, metric: 'GB', iec: 'GiB', metric_octet: 'Go', iec_octet: 'Gio' }, - { expFrom: 4, expTo: 5, metric: 'TB', iec: 'TiB', metric_octet: 'To', iec_octet: 'Tio' }, - { expFrom: 5, expTo: 6, metric: 'PB', iec: 'PiB', metric_octet: 'Po', iec_octet: 'Pio' }, - { expFrom: 6, expTo: 7, metric: 'EB', iec: 'EiB', metric_octet: 'Eo', iec_octet: 'Eio' }, - { expFrom: 7, expTo: 8, metric: 'ZB', iec: 'ZiB', metric_octet: 'Zo', iec_octet: 'Zio' }, - { expFrom: 8, expTo: 9, metric: 'YB', iec: 'YiB', metric_octet: 'Yo', iec_octet: 'Yio' } - ]; + const tables = { + metric: [ + { from: 0 , to: 1e3 , unit: 'B' , long: 'bytes' }, + { from: 1e3 , to: 1e6 , unit: 'kB', long: 'kilobytes' }, + { from: 1e6 , to: 1e9 , unit: 'MB', long: 'megabytes' }, + { from: 1e9 , to: 1e12, unit: 'GB', long: 'gigabytes' }, + { from: 1e12, to: 1e15, unit: 'TB', long: 'terabytes' }, + { from: 1e15, to: 1e18, unit: 'PB', long: 'petabytes' }, + { from: 1e18, to: 1e21, unit: 'EB', long: 'exabytes' }, + { from: 1e21, to: 1e24, unit: 'ZB', long: 'zettabytes' }, + { from: 1e24, to: 1e27, unit: 'YB', long: 'yottabytes' }, + ], + metric_octet: [ + { from: 0 , to: 1e3 , unit: 'o' , long: 'octets' }, + { from: 1e3 , to: 1e6 , unit: 'ko', long: 'kilooctets' }, + { from: 1e6 , to: 1e9 , unit: 'Mo', long: 'megaoctets' }, + { from: 1e9 , to: 1e12, unit: 'Go', long: 'gigaoctets' }, + { from: 1e12, to: 1e15, unit: 'To', long: 'teraoctets' }, + { from: 1e15, to: 1e18, unit: 'Po', long: 'petaoctets' }, + { from: 1e18, to: 1e21, unit: 'Eo', long: 'exaoctets' }, + { from: 1e21, to: 1e24, unit: 'Zo', long: 'zettaoctets' }, + { from: 1e24, to: 1e27, unit: 'Yo', long: 'yottaoctets' }, + ], + iec: [ + { from: 0 , to: Math.pow(1024, 1), unit: 'B' , long: 'bytes' }, + { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'KiB', long: 'kibibytes' }, + { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'MiB', long: 'mebibytes' }, + { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'GiB', long: 'gibibytes' }, + { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'TiB', long: 'tebibytes' }, + { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'PiB', long: 'pebibytes' }, + { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'EiB', long: 'exbibytes' }, + { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'ZiB', long: 'zebibytes' }, + { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'YiB', long: 'yobibytes' }, + ], + iec_octet: [ + { from: 0 , to: Math.pow(1024, 1), unit: 'o' , long: 'octets' }, + { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'Kio', long: 'kibioctets' }, + { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'Mio', long: 'mebioctets' }, + { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'Gio', long: 'gibioctets' }, + { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'Tio', long: 'tebioctets' }, + { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'Pio', long: 'pebioctets' }, + { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'Eio', long: 'exbioctets' }, + { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'Zio', long: 'zebioctets' }, + { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'Yio', long: 'yobioctets' }, + ], + }; + Object.assign(tables, options.customUnits); - const base = options.units === 'metric' || options.units === 'metric_octet' ? 1000 : 1024; const prefix = bytes < 0 ? '-' : ''; bytes = Math.abs(bytes); - - for (let i = 0; i < table.length; i++) { - const lower = Math.pow(base, table[i].expFrom); - const upper = Math.pow(base, table[i].expTo); - if (bytes >= lower && bytes < upper) { - const units = table[i][options.units]; - if (i === 0) { - this.value = prefix + bytes; - this.unit = units; - return - } else { - this.value = prefix + (bytes / lower).toFixed(options.precision); - this.unit = units; - return - } + const table = tables[options.units]; + if (table) { + const units = table.find(u => bytes >= u.from && bytes < u.to); + if (units) { + const value = units.from === 0 + ? prefix + bytes + : prefix + (bytes / units.from).toFixed(options.precision); + this.value = value; + this.unit = units.unit; + this.long = units.long; + } else { + this.value = prefix + bytes; + this.unit = ''; + this.long = ''; } + } else { + throw new Error(`Invalid units specified: ${options.units}`) } - - this.value = prefix + bytes; - this.unit = ''; } toString () { - return `${this.value} ${this.unit}`.trim() + const options = _options.get(this); + return options.toStringFn ? options.toStringFn.bind(this)() : `${this.value} ${this.unit}` } } /** - * @param {number} - the bytes value to convert. - * @param [options] {object} - optional config. - * @param [options.precision=1] {number} - number of decimal places. - * @param [options.units=metric] {string} - select `'metric'`, `'iec'`, `'metric_octet'` or `'iec_octet'` units. - * @returns {{ value: string, unit: string}} + * Returns an object with the spec `{ value: string, unit: string, long: string }`. The returned object defines a `toString` method meaning it can be used in any string context. + * @param {number} - The bytes value to convert. + * @param [options] {object} - Optional config. + * @param [options.precision] {number} - Number of decimal places. Defaults to `1`. + * @param [options.units] {string} - Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`. + * @param [options.customUnits] {object} - An object containing one or more custom unit lookup tables. + * @param [options.toStringFn] {function} - A `toString` function to override the default. + * @returns {object} * @alias module:byte-size - * @example - * ```js - * > const byteSize = require('byte-size') - * - * > byteSize(1580) - * { value: '1.6', unit: 'kB' } - * - * > byteSize(1580, { units: 'iec' }) - * { value: '1.5', unit: 'KiB' } - * - * > byteSize(1580, { units: 'iec', precision: 3 }) - * { value: '1.543', unit: 'KiB' } - * - * > byteSize(1580, { units: 'iec', precision: 0 }) - * { value: '2', unit: 'KiB' } - * - * > byteSize(1580, { units: 'metric_octet' }) - * { value: '1.6', unit: 'ko' } - * - * > byteSize(1580, { units: 'iec_octet' }) - * { value: '1.5', unit: 'Kio' } - * - * > byteSize(1580, { units: 'iec_octet' }).toString() - * '1.5 Kio' - * - * > const { value, unit } = byteSize(1580, { units: 'iec_octet' }) - * > `${value} ${unit}` - * '1.5 Kio' - * ``` */ function byteSize (bytes, options) { return new ByteSize(bytes, options) } + /** + * Set the default `byteSize` options for the duration of the process. + * @param options {object} - A `byteSize` options object. + */ + byteSize.defaultOptions = function (options) { + defaultOptions = options; + }; + return byteSize; -})); +}))); diff --git a/node_modules/byte-size/index.mjs b/node_modules/byte-size/index.mjs index 2de3e205b087c..bd6548c686aa5 100644 --- a/node_modules/byte-size/index.mjs +++ b/node_modules/byte-size/index.mjs @@ -1,144 +1,115 @@ /** - * An isomorphic, load-anywhere function to convert a bytes value into a more human-readable format. Choose between [metric or IEC units](https://en.wikipedia.org/wiki/Gigabyte), summarised below. - * - * Value | Metric - * ----- | ------------- - * 1000 | kB kilobyte - * 1000^2 | MB megabyte - * 1000^3 | GB gigabyte - * 1000^4 | TB terabyte - * 1000^5 | PB petabyte - * 1000^6 | EB exabyte - * 1000^7 | ZB zettabyte - * 1000^8 | YB yottabyte - * - * Value | IEC - * ----- | ------------ - * 1024 | KiB kibibyte - * 1024^2 | MiB mebibyte - * 1024^3 | GiB gibibyte - * 1024^4 | TiB tebibyte - * 1024^5 | PiB pebibyte - * 1024^6 | EiB exbibyte - * 1024^7 | ZiB zebibyte - * 1024^8 | YiB yobibyte - * - * Value | Metric (octet) - * ----- | ------------- - * 1000 | ko kilooctet - * 1000^2 | Mo megaoctet - * 1000^3 | Go gigaoctet - * 1000^4 | To teraoctet - * 1000^5 | Po petaoctet - * 1000^6 | Eo exaoctet - * 1000^7 | Zo zettaoctet - * 1000^8 | Yo yottaoctet - * - * Value | IEC (octet) - * ----- | ------------ - * 1024 | Kio kilooctet - * 1024^2 | Mio mebioctet - * 1024^3 | Gio gibioctet - * 1024^4 | Tio tebioctet - * 1024^5 | Pio pebioctet - * 1024^6 | Eio exbioctet - * 1024^7 | Zio zebioctet - * 1024^8 | Yio yobioctet - * * @module byte-size - * @example - * ```js - * const byteSize = require('byte-size') - * ``` */ +let defaultOptions = {} +const _options = new WeakMap() + class ByteSize { constructor (bytes, options) { - options = options || {} - options.units = options.units || 'metric' - options.precision = typeof options.precision === 'undefined' ? 1 : options.precision - - const table = [ - { expFrom: 0, expTo: 1, metric: 'B', iec: 'B', metric_octet: 'o', iec_octet: 'o' }, - { expFrom: 1, expTo: 2, metric: 'kB', iec: 'KiB', metric_octet: 'ko', iec_octet: 'Kio' }, - { expFrom: 2, expTo: 3, metric: 'MB', iec: 'MiB', metric_octet: 'Mo', iec_octet: 'Mio' }, - { expFrom: 3, expTo: 4, metric: 'GB', iec: 'GiB', metric_octet: 'Go', iec_octet: 'Gio' }, - { expFrom: 4, expTo: 5, metric: 'TB', iec: 'TiB', metric_octet: 'To', iec_octet: 'Tio' }, - { expFrom: 5, expTo: 6, metric: 'PB', iec: 'PiB', metric_octet: 'Po', iec_octet: 'Pio' }, - { expFrom: 6, expTo: 7, metric: 'EB', iec: 'EiB', metric_octet: 'Eo', iec_octet: 'Eio' }, - { expFrom: 7, expTo: 8, metric: 'ZB', iec: 'ZiB', metric_octet: 'Zo', iec_octet: 'Zio' }, - { expFrom: 8, expTo: 9, metric: 'YB', iec: 'YiB', metric_octet: 'Yo', iec_octet: 'Yio' } - ] + options = Object.assign({ + units: 'metric', + precision: 1 + }, defaultOptions, options) + _options.set(this, options) - const base = options.units === 'metric' || options.units === 'metric_octet' ? 1000 : 1024 - const prefix = bytes < 0 ? '-' : ''; - bytes = Math.abs(bytes); + const tables = { + metric: [ + { from: 0 , to: 1e3 , unit: 'B' , long: 'bytes' }, + { from: 1e3 , to: 1e6 , unit: 'kB', long: 'kilobytes' }, + { from: 1e6 , to: 1e9 , unit: 'MB', long: 'megabytes' }, + { from: 1e9 , to: 1e12, unit: 'GB', long: 'gigabytes' }, + { from: 1e12, to: 1e15, unit: 'TB', long: 'terabytes' }, + { from: 1e15, to: 1e18, unit: 'PB', long: 'petabytes' }, + { from: 1e18, to: 1e21, unit: 'EB', long: 'exabytes' }, + { from: 1e21, to: 1e24, unit: 'ZB', long: 'zettabytes' }, + { from: 1e24, to: 1e27, unit: 'YB', long: 'yottabytes' }, + ], + metric_octet: [ + { from: 0 , to: 1e3 , unit: 'o' , long: 'octets' }, + { from: 1e3 , to: 1e6 , unit: 'ko', long: 'kilooctets' }, + { from: 1e6 , to: 1e9 , unit: 'Mo', long: 'megaoctets' }, + { from: 1e9 , to: 1e12, unit: 'Go', long: 'gigaoctets' }, + { from: 1e12, to: 1e15, unit: 'To', long: 'teraoctets' }, + { from: 1e15, to: 1e18, unit: 'Po', long: 'petaoctets' }, + { from: 1e18, to: 1e21, unit: 'Eo', long: 'exaoctets' }, + { from: 1e21, to: 1e24, unit: 'Zo', long: 'zettaoctets' }, + { from: 1e24, to: 1e27, unit: 'Yo', long: 'yottaoctets' }, + ], + iec: [ + { from: 0 , to: Math.pow(1024, 1), unit: 'B' , long: 'bytes' }, + { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'KiB', long: 'kibibytes' }, + { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'MiB', long: 'mebibytes' }, + { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'GiB', long: 'gibibytes' }, + { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'TiB', long: 'tebibytes' }, + { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'PiB', long: 'pebibytes' }, + { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'EiB', long: 'exbibytes' }, + { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'ZiB', long: 'zebibytes' }, + { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'YiB', long: 'yobibytes' }, + ], + iec_octet: [ + { from: 0 , to: Math.pow(1024, 1), unit: 'o' , long: 'octets' }, + { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'Kio', long: 'kibioctets' }, + { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'Mio', long: 'mebioctets' }, + { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'Gio', long: 'gibioctets' }, + { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'Tio', long: 'tebioctets' }, + { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'Pio', long: 'pebioctets' }, + { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'Eio', long: 'exbioctets' }, + { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'Zio', long: 'zebioctets' }, + { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'Yio', long: 'yobioctets' }, + ], + } + Object.assign(tables, options.customUnits) - for (let i = 0; i < table.length; i++) { - const lower = Math.pow(base, table[i].expFrom) - const upper = Math.pow(base, table[i].expTo) - if (bytes >= lower && bytes < upper) { - const units = table[i][options.units] - if (i === 0) { - this.value = prefix + bytes - this.unit = units - return - } else { - this.value = prefix + (bytes / lower).toFixed(options.precision) - this.unit = units - return - } + const prefix = bytes < 0 ? '-' : '' + bytes = Math.abs(bytes) + const table = tables[options.units] + if (table) { + const units = table.find(u => bytes >= u.from && bytes < u.to) + if (units) { + const value = units.from === 0 + ? prefix + bytes + : prefix + (bytes / units.from).toFixed(options.precision) + this.value = value + this.unit = units.unit + this.long = units.long + } else { + this.value = prefix + bytes + this.unit = '' + this.long = '' } + } else { + throw new Error(`Invalid units specified: ${options.units}`) } - - this.value = prefix + bytes - this.unit = '' } toString () { - return `${this.value} ${this.unit}`.trim() + const options = _options.get(this) + return options.toStringFn ? options.toStringFn.bind(this)() : `${this.value} ${this.unit}` } } /** - * @param {number} - the bytes value to convert. - * @param [options] {object} - optional config. - * @param [options.precision=1] {number} - number of decimal places. - * @param [options.units=metric] {string} - select `'metric'`, `'iec'`, `'metric_octet'` or `'iec_octet'` units. - * @returns {{ value: string, unit: string}} + * Returns an object with the spec `{ value: string, unit: string, long: string }`. The returned object defines a `toString` method meaning it can be used in any string context. + * @param {number} - The bytes value to convert. + * @param [options] {object} - Optional config. + * @param [options.precision] {number} - Number of decimal places. Defaults to `1`. + * @param [options.units] {string} - Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`. + * @param [options.customUnits] {object} - An object containing one or more custom unit lookup tables. + * @param [options.toStringFn] {function} - A `toString` function to override the default. + * @returns {object} * @alias module:byte-size - * @example - * ```js - * > const byteSize = require('byte-size') - * - * > byteSize(1580) - * { value: '1.6', unit: 'kB' } - * - * > byteSize(1580, { units: 'iec' }) - * { value: '1.5', unit: 'KiB' } - * - * > byteSize(1580, { units: 'iec', precision: 3 }) - * { value: '1.543', unit: 'KiB' } - * - * > byteSize(1580, { units: 'iec', precision: 0 }) - * { value: '2', unit: 'KiB' } - * - * > byteSize(1580, { units: 'metric_octet' }) - * { value: '1.6', unit: 'ko' } - * - * > byteSize(1580, { units: 'iec_octet' }) - * { value: '1.5', unit: 'Kio' } - * - * > byteSize(1580, { units: 'iec_octet' }).toString() - * '1.5 Kio' - * - * > const { value, unit } = byteSize(1580, { units: 'iec_octet' }) - * > `${value} ${unit}` - * '1.5 Kio' - * ``` */ function byteSize (bytes, options) { return new ByteSize(bytes, options) } +/** + * Set the default `byteSize` options for the duration of the process. + * @param options {object} - A `byteSize` options object. + */ +byteSize.defaultOptions = function (options) { + defaultOptions = options +} + export default byteSize diff --git a/node_modules/byte-size/package.json b/node_modules/byte-size/package.json index 5c48479993096..e69b7e5f53ae2 100644 --- a/node_modules/byte-size/package.json +++ b/node_modules/byte-size/package.json @@ -8,14 +8,14 @@ "url": "http://repejota.com" } ], - "version": "5.0.1", + "version": "7.0.0", "main": "dist/index.js", "license": "MIT", "engines": { - "node": ">=6.0.0" + "node": ">=10" }, - "description": "Convert a bytes (and octets) value to a more human-readable format. Choose between metric or IEC units.", - "repository": "https://github.com/75lb/byte-size.git", + "description": "Convert a bytes or octets value (e.g. 34565346) to a human-readable string ('34.6 MB'). Choose between metric or IEC units.", + "repository": "https://github.com/75lb/byte-size", "files": [ "index.mjs", "dist/index.js" @@ -31,17 +31,25 @@ "IEC" ], "scripts": { - "test": "npm run test:js && npm run test:mjs", - "test:js": "rollup -c dist/test.config.js && node dist/test.js", - "test:mjs": "node --experimental-modules test/test.mjs", - "docs": "jsdoc2md -t README.hbs dist/index.js > README.md; echo", - "cover": "istanbul cover ./node_modules/.bin/test-runner test.js && cat coverage/lcov.info | ./node_modules/.bin/coveralls", - "dist": "rollup -c dist/index.config.js" + "test": "npm run dist && npm run test:esm && npm run test:web", + "test:esm": "esm-runner test.mjs", + "test:web": "web-runner test.mjs", + "docs": "jsdoc2md -t README.hbs dist/index.js > README.md", + "cover": "c8 npm test && c8 report --reporter=text-lcov | coveralls", + "dist": "rollup -f umd -n byteSize -o dist/index.js index.mjs" }, "devDependencies": { - "coveralls": "^3.0.2", - "jsdoc-to-markdown": "^4.0.1", - "rollup": "^0.68.1", - "test-runner": "^0.5.1" + "@test-runner/web": "^0.3.4", + "coveralls": "^3.1.0", + "esm-runner": "^0.3.4", + "isomorphic-assert": "^0.1.1", + "jsdoc-to-markdown": "^5.0.3", + "rollup": "^2.10.9", + "test-object-model": "^0.6.1" + }, + "standard": { + "ignore": [ + "dist" + ] } } diff --git a/package-lock.json b/package-lock.json index fed41b0ca7d53..661d088f49672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,7 +98,7 @@ "aproba": "^2.0.0", "archy": "~1.0.0", "bin-links": "^2.1.3", - "byte-size": "^5.0.1", + "byte-size": "^7.0.0", "cacache": "^15.0.5", "chalk": "^4.1.0", "chownr": "^2.0.0", @@ -1008,12 +1008,12 @@ "inBundle": true }, "node_modules/byte-size": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", - "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.0.tgz", + "integrity": "sha512-NNiBxKgxybMBtWdmvx7ZITJi4ZG+CYUgwOSZTfqB1qogkRHrhbQE/R2r5Fh94X+InN5MCYz6SvB/ejHMj/HbsQ==", "inBundle": true, "engines": { - "node": ">=6.0.0" + "node": ">=10" } }, "node_modules/cacache": { @@ -9820,9 +9820,9 @@ "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=" }, "byte-size": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", - "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.0.tgz", + "integrity": "sha512-NNiBxKgxybMBtWdmvx7ZITJi4ZG+CYUgwOSZTfqB1qogkRHrhbQE/R2r5Fh94X+InN5MCYz6SvB/ejHMj/HbsQ==" }, "cacache": { "version": "15.0.5", diff --git a/package.json b/package.json index 053a7faef73a6..5404e94d3e148 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "aproba": "^2.0.0", "archy": "~1.0.0", "bin-links": "^2.1.3", - "byte-size": "^5.0.1", + "byte-size": "^7.0.0", "cacache": "^15.0.5", "chalk": "^4.1.0", "chownr": "^2.0.0", From 558e9781ada06b66be4d2d5d0f7e763f645eda25 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 12:25:27 -0400 Subject: [PATCH 03/39] chore: removed unused deep-equal dev-dep --- node_modules/.gitignore | 4 -- package-lock.json | 99 ----------------------------------------- package.json | 1 - 3 files changed, 104 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 82e9f8e3119d7..8e6ca8b885a7d 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -54,7 +54,6 @@ package-lock.json /cp-file /cross-spawn /decamelize -/deep-equal /deep-is /default-require-extensions /define-properties @@ -122,7 +121,6 @@ package-lock.json /http-proxy /ignore /import-fresh -/is-arguments /is-arrayish /is-binary-path /is-callable @@ -177,7 +175,6 @@ package-lock.json /null-check /nyc /object-inspect -/object-is /object-keys /object.assign /object.getownpropertydescriptors @@ -213,7 +210,6 @@ package-lock.json /read-pkg /read-pkg-up /readdirp -/regexp.prototype.flags /regexpp /release-zalgo /require-directory diff --git a/package-lock.json b/package-lock.json index 661d088f49672..4d0d9b362f04a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -171,7 +171,6 @@ "npx": "bin/npx-cli.js" }, "devDependencies": { - "deep-equal": "^1.0.1", "eslint": "^7.5.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", @@ -1611,23 +1610,6 @@ "node": ">=0.10.0" } }, - "node_modules/deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dev": true, - "dependencies": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -3145,15 +3127,6 @@ "node": ">=4" } }, - "node_modules/is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4683,22 +4656,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", - "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -5397,22 +5354,6 @@ "node": ">=8.10.0" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", - "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", @@ -10265,20 +10206,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dev": true, - "requires": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - } - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -11458,12 +11385,6 @@ "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" }, - "is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", - "dev": true - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -12614,16 +12535,6 @@ "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true }, - "object-is": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", - "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -13149,16 +13060,6 @@ "picomatch": "^2.2.1" } }, - "regexp.prototype.flags": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", - "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, "regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", diff --git a/package.json b/package.json index 5404e94d3e148..63c55b8f6e146 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,6 @@ "write-file-atomic" ], "devDependencies": { - "deep-equal": "^1.0.1", "eslint": "^7.5.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", From 81073f99a93b680e3ca08b8f099e9aca2aaf50be Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 12:32:16 -0400 Subject: [PATCH 04/39] eslint@7.10.0 --- node_modules/.gitignore | 1 + node_modules/ajv/README.md | 35 ++--- node_modules/ajv/dist/ajv.bundle.js | 132 +++++++++++----- node_modules/ajv/dist/ajv.min.js | 4 +- node_modules/ajv/dist/ajv.min.js.map | 2 +- node_modules/ajv/lib/compile/formats.js | 4 +- node_modules/ajv/lib/dot/coerce.def | 46 +++--- node_modules/ajv/lib/dot/definitions.def | 3 +- node_modules/ajv/lib/dot/validate.jst | 2 +- node_modules/ajv/lib/dotjs/allOf.js | 2 +- node_modules/ajv/lib/dotjs/anyOf.js | 2 +- node_modules/ajv/lib/dotjs/contains.js | 2 +- node_modules/ajv/lib/dotjs/dependencies.js | 2 +- node_modules/ajv/lib/dotjs/if.js | 4 +- node_modules/ajv/lib/dotjs/items.js | 6 +- node_modules/ajv/lib/dotjs/not.js | 2 +- node_modules/ajv/lib/dotjs/oneOf.js | 2 +- node_modules/ajv/lib/dotjs/properties.js | 4 +- node_modules/ajv/lib/dotjs/propertyNames.js | 2 +- node_modules/ajv/lib/dotjs/required.js | 2 +- node_modules/ajv/lib/dotjs/validate.js | 30 ++-- node_modules/ajv/package.json | 2 +- package-lock.json | 166 +++++++++++++------- package.json | 2 +- 24 files changed, 273 insertions(+), 186 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 8e6ca8b885a7d..90b41aae457ad 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -13,6 +13,7 @@ package-lock.json /@babel/traverse /@babel/types /@blueoak/list +/@eslint/eslintrc /@types/caseless /@types/json5 /@types/node diff --git a/node_modules/ajv/README.md b/node_modules/ajv/README.md index 5e502db930fc5..3a88820d82c48 100644 --- a/node_modules/ajv/README.md +++ b/node_modules/ajv/README.md @@ -12,29 +12,30 @@ The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/ [![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) -## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) +## Mozilla MOSS grant and OpenJS Foundation -I will get straight to the point - I need your support to ensure that the development of Ajv continues. +[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) -I have developed Ajv for 5 years in my free time, but it is not sustainable. I'd appreciate if you consider supporting its further development with donations: -- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) -- [Ajv Open Collective️](https://opencollective.com/ajv) +Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). + +Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. + +This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. -There are many small and large improvements that are long due, including the support of the next versions of JSON Schema specification, improving website and documentation, and making Ajv more modular and maintainable to address its limitations - what Ajv needs to evolve is much more than what I can contribute in my free time. +I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. -I would also really appreciate any advice you could give on how to raise funds for Ajv development - whether some suitable open-source fund I could apply to or some sponsor I should approach. -Since 2015 Ajv has become widely used, thanks to your help and contributions: +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) -- **90** contributors 🏗 -- **5,000** dependent npm packages ⚙️ -- **7,000** github stars, from GitHub users [all over the world](https://www.google.com/maps/d/u/0/viewer?mid=1MGRV8ciFUGIbO1l0EKFWNJGYE7iSkDxP&ll=-3.81666561775622e-14%2C4.821737100000007&z=2) ⭐️ -- **5,000,000** dependent repositories on GitHub 🚀 -- **120,000,000** npm downloads per month! 💯 +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! -I believe it would benefit all Ajv users to help put together the fund that will be used for its further development - it would allow to bring some additional maintainers to the project. +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. -Thank you +Please sponsor Ajv via: +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective️](https://opencollective.com/ajv) + +Thank you. #### Open Collective sponsors @@ -156,8 +157,6 @@ Performance of different validators by [json-schema-benchmark](https://github.co - [$data reference](#data-reference) to use values from the validated data as values for the schema keywords - [asynchronous validation](#asynchronous-validation) of custom formats and keywords -Currently Ajv is the only validator that passes all the tests from [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), apart from the test that requires that `1.0` is not an integer that is impossible to satisfy in JavaScript). - ## Install @@ -330,7 +329,7 @@ There are two modes of format validation: `fast` and `full`. This mode affects f You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. -The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can whitelist specific format(s) to be ignored. See [Options](#options) for details. +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). diff --git a/node_modules/ajv/dist/ajv.bundle.js b/node_modules/ajv/dist/ajv.bundle.js index 79fdd92f467d9..2a34a771fd6f2 100644 --- a/node_modules/ajv/dist/ajv.bundle.js +++ b/node_modules/ajv/dist/ajv.bundle.js @@ -193,8 +193,8 @@ formats.fast = { time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js - uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i, - 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, 'uri-template': URITEMPLATE, url: URL, // email (sources from jsen validator): @@ -1827,7 +1827,7 @@ module.exports = function generate_allOf(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; @@ -1869,7 +1869,7 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { - return (it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all)); + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; @@ -2021,7 +2021,7 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, - $nonEmptySchema = (it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all)); + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; @@ -2459,7 +2459,7 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; @@ -2721,8 +2721,8 @@ module.exports = function generate_if(it, $keyword, $ruleType) { var $nextValid = 'valid' + $it.level; var $thenSch = it.schema['then'], $elseSch = it.schema['else'], - $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? typeof $thenSch == 'object' && Object.keys($thenSch).length > 0 : it.util.schemaHasRules($thenSch, it.RULES.all)), - $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? typeof $elseSch == 'object' && Object.keys($elseSch).length > 0 : it.util.schemaHasRules($elseSch, it.RULES.all)), + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), $currentBaseId = $it.baseId; if ($thenPresent || $elsePresent) { var $ifClause; @@ -2912,7 +2912,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; @@ -2935,7 +2935,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { } } } - if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0 : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; @@ -2959,7 +2959,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { $closingBraces += '}'; } } - } else if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; @@ -3082,7 +3082,7 @@ module.exports = function generate_not(it, $keyword, $ruleType) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; - if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; @@ -3182,7 +3182,7 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; @@ -3497,7 +3497,7 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; @@ -3600,7 +3600,7 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { while (i4 < l4) { $pProperty = arr4[i4 += 1]; var $sch = $pProperties[$pProperty]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); @@ -3659,7 +3659,7 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { $it.level++; var $nextValid = 'valid' + $it.level; out += 'var ' + ($errs) + ' = errors;'; - if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; @@ -3882,7 +3882,7 @@ module.exports = function generate_required(it, $keyword, $ruleType) { while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; - if (!($propertySch && (it.opts.strictKeywords ? typeof $propertySch == 'object' && Object.keys($propertySch).length > 0 : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { $required[$required.length] = $property; } } @@ -4305,7 +4305,7 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; - it.dataPathArr = [undefined]; + it.dataPathArr = [""]; if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = 'default is ignored in the schema root'; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); @@ -4367,43 +4367,35 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; - out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; if (it.opts.coerceTypes == 'array') { - out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; } - out += ' var ' + ($coerced) + ' = undefined; '; - var $bracesCoercion = ''; + out += ' if (' + ($coerced) + ' !== undefined) ; '; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; - if ($i) { - out += ' if (' + ($coerced) + ' === undefined) { '; - $bracesCoercion += '}'; - } - if (it.opts.coerceTypes == 'array' && $type != 'array') { - out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; - } if ($type == 'string') { - out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { - out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { - out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { - out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { - out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } - out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + out += ' else { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ @@ -4443,7 +4435,7 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } - out += ' } else { '; + out += ' } if (' + ($coerced) + ' !== undefined) { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; @@ -5241,7 +5233,7 @@ function escapeJsonPtr(str) { } },{}],45:[function(require,module,exports){ -/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -6204,9 +6196,9 @@ function _recomposeAuthority(components, options) { return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; })); } - if (typeof components.port === "number") { + if (typeof components.port === "number" || typeof components.port === "string") { uriTokens.push(":"); - uriTokens.push(components.port.toString(10)); + uriTokens.push(String(components.port)); } return uriTokens.length ? uriTokens.join("") : undefined; } @@ -6409,8 +6401,9 @@ var handler = { return components; }, serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; //normalize the default port - if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { + if (components.port === (secure ? 443 : 80) || components.port === "") { components.port = undefined; } //normalize the empty path @@ -6431,6 +6424,57 @@ var handler$1 = { serialize: handler.serialize }; +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + var O = {}; var isIRI = true; //RFC 3986 @@ -6461,7 +6505,7 @@ function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(UNRESERVED) ? str : decStr; } -var handler$2 = { +var handler$4 = { scheme: "mailto", parse: function parse$$1(components, options) { var mailtoComponents = components; @@ -6549,7 +6593,7 @@ var handler$2 = { var URN_PARSE = /^([^\:]+)\:(.*)/; //RFC 2141 -var handler$3 = { +var handler$5 = { scheme: "urn", parse: function parse$$1(components, options) { var matches = components.path && components.path.match(URN_PARSE); @@ -6588,7 +6632,7 @@ var handler$3 = { var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; //RFC 4122 -var handler$4 = { +var handler$6 = { scheme: "urn:uuid", parse: function parse(urnComponents, options) { var uuidComponents = urnComponents; @@ -6612,6 +6656,8 @@ SCHEMES[handler$1.scheme] = handler$1; SCHEMES[handler$2.scheme] = handler$2; SCHEMES[handler$3.scheme] = handler$3; SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; exports.SCHEMES = SCHEMES; exports.pctEncChar = pctEncChar; diff --git a/node_modules/ajv/dist/ajv.min.js b/node_modules/ajv/dist/ajv.min.js index 087c4b714199e..d02ec10a7feae 100644 --- a/node_modules/ajv/dist/ajv.min.js +++ b/node_modules/ajv/dist/ajv.min.js @@ -1,3 +1,3 @@ -/* ajv 6.12.3: Another JSON Schema Validator */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Ajv=e()}(function(){return function o(i,n,l){function c(r,e){if(!n[r]){if(!i[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(u)return u(r,!0);var a=new Error("Cannot find module '"+r+"'");throw a.code="MODULE_NOT_FOUND",a}var s=n[r]={exports:{}};i[r][0].call(s.exports,function(e){return c(i[r][1][e]||e)},s,s.exports,o,i,n,l)}return n[r].exports}for(var u="function"==typeof require&&require,e=0;e%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d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{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){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|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var R=e("./resolve"),$=e("./util"),j=e("./error_classes"),D=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=$.ucs2length,A=e("fast-deep-equal"),k=j.Validation;function C(e,c,u,r){var d=this,p=this._opts,h=[void 0],f={},l=[],t={},m=[],a={},v=[],s=function(e,r,t){var a=L.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}.call(this,e,c=c||{schema:e,refVal:h,refs:f},r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=P;var y=this._formats,g=this.RULES;try{var i=E(e,c,u,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,p.sourceCode&&(n.source=i.source)),i}finally{(function(e,r,t){var a=L.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}).call(this,e,c,r)}function P(){var e=o.validate,r=e.apply(this,arguments);return P.errors=e.errors,r}function E(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=c.schema)return C.call(d,e,r,t,a);var o=!0===e.$async,i=O({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:j.MissingRef,RULES:g,validate:O,util:$,resolve:R,resolveRef:w,usePattern:_,useDefault:F,useCustomRule:x,opts:p,formats:y,logger:d.logger,self:d}),i=Q(h,T)+Q(l,N)+Q(m,z)+Q(v,q)+i;p.processCode&&(i=p.processCode(i,e));try{var n=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",i)(d,g,y,c,h,m,v,A,I,k);h[0]=n}catch(e){throw d.logger.error("Error compiling schema, function code:",i),e}return n.schema=e,n.errors=null,n.refs=f,n.refVal=h,n.root=s?n:r,o&&(n.$async=!0),!0===p.sourceCode&&(n.source={code:i,patterns:l,defaults:m}),n}function w(e,r,t){r=R.url(e,r);var a,s,o=f[r];if(void 0!==o)return S(a=h[o],s="refVal["+o+"]");if(!t&&c.refs){var i=c.refs[r];if(void 0!==i)return S(a=c.refVal[i],s=b(r,a))}s=b(r);var n,l=R.call(d,E,c,r);if(void 0!==l||(n=u&&u[r])&&(l=R.inlineRef(n,p.inlineRefs)?n:C.call(d,n,c,u,e)),void 0!==l)return S(h[f[r]]=l,s);delete f[r]}function b(e,r){var t=h.length;return h[t]=r,"refVal"+(f[e]=t)}function S(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function _(e){var r=t[e];return void 0===r&&(r=t[e]=l.length,l[r]=e),"pattern"+r}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return $.toQuotedString(e);case"object":if(null===e)return"null";var r=D(e),t=a[r];return void 0===t&&(t=a[r]=m.length,m[t]=e),"default"+t}}function x(e,r,t,a){if(!1!==d._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o)if(!o(r)){var i="keyword schema is invalid: "+d.errorsText(o.errors);if("log"!=d._opts.validateSchema)throw new Error(i);d.logger.error(i)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(d,r,t,a);else if(u)n=u.call(d,r,t,a),!1!==p.validateSchema&&d.validateSchema(n,!0);else if(c)n=c.call(d,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=v.length;return{code:"customRule"+h,validate:v[h]=n}}}function L(e,r,t){for(var a=0;a",_=P?">":"<",F=void 0;if(!y&&"number"!=typeof d&&void 0!==d)throw new Error(r+" must be number");if(!b&&void 0!==w&&"number"!=typeof w&&"boolean"!=typeof w)throw new Error(E+" must be number or boolean");b?(o="exclIsNumber"+u,i="' + "+(n="op"+u)+" + '",c+=" var schemaExcl"+u+" = "+(t=e.util.getData(w.$data,h,e.dataPathArr))+"; ",F=E,(l=l||[]).push(c+=" var "+(a="exclusive"+u)+"; var "+(s="exclType"+u)+" = typeof "+(t="schemaExcl"+u)+"; if ("+s+" != 'boolean' && "+s+" != 'undefined' && "+s+" != 'number') { "),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(c+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",x=c,c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+s+" == 'number' ? ( ("+a+" = "+g+" === undefined || "+t+" "+S+"= "+g+") ? "+v+" "+_+"= "+t+" : "+v+" "+_+" "+g+" ) : ( ("+a+" = "+t+" === true) ? "+v+" "+_+"= "+g+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { var op"+u+" = "+a+" ? '"+S+"' : '"+S+"='; ",void 0===d&&(f=e.errSchemaPath+"/"+(F=E),g=t,y=b)):(i=S,(o="number"==typeof w)&&y?(n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" ( "+g+" === undefined || "+w+" "+S+"= "+g+" ? "+v+" "+_+"= "+w+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { "):(o&&void 0===d?(a=!0,f=e.errSchemaPath+"/"+(F=E),g=w,_+="="):(o&&(g=Math[P?"min":"max"](w,d)),w===(!o||g)?(a=!0,f=e.errSchemaPath+"/"+(F=E),_+="="):(a=!1,i+="=")),n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+v+" "+_+" "+g+" || "+v+" !== "+v+") { ")),F=F||r,(l=l||[]).push(c),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+n+", limit: "+g+", exclusive: "+a+" } ",!1!==e.opts.messages&&(c+=" , message: 'should be "+i+" ",c+=y?"' + "+g:g+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+d,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ";var x=c;return c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",m&&(c+=" else { "),c}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" "+c+".length "+("maxItems"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxItems"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),t+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ";var d=r,p=p||[];p.push(t+=" "+("maxLength"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be ",t+="maxLength"==r?"longer":"shorter",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" Object.keys("+c+").length "+("maxProperties"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxProperties"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var p,f=-1,m=d.length-1;f "+_+") { ",x=c+"["+_+"]",d.schema=$,d.schemaPath=i+"["+_+"]",d.errSchemaPath=n+"/"+_,d.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0),d.dataPathArr[v]=_,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",t+=" } ",l&&(t+=" if ("+f+") { ",p+="}"))}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&0 "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0),x=c+"["+m+"]",d.dataPathArr[v]=m,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",l&&(t+=" if (!"+f+") break; "),t+=" } } ",l&&(t+=" if ("+f+") { ",p+="}"))}else{(e.opts.strictKeywords?"object"==typeof o&&0 1e-"+e.opts.multipleOfPrecision+" ":" division"+a+" !== parseInt(division"+a+") ",t+=" ) ",u&&(t+=" ) ");var d=d||[];d.push(t+=" ) { "),t="",!1!==e.createErrors?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { multipleOf: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be multiple of ",t+=u?"' + "+h:h+"'"),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t,t=d.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d,p,f,m,v="valid"+h.level;return(e.opts.strictKeywords?"object"==typeof o&&0 1) { ",t=e.schema.items&&e.schema.items.type,a=Array.isArray(t),!t||"object"==t||"array"==t||a&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+f+" = false; break outer; } } } ":(i+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ",i+=" if ("+e.util["checkDataType"+(a?"s":"")](t,"item",e.opts.strictNumbers,!0)+") continue; ",a&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),i+=" } ",m&&(i+=" } "),(s=s||[]).push(i+=" if (!"+f+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=m?"validate.schema"+u:""+c,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",o=i,i=s.pop(),i+=!e.compositeRule&&d?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { ")):d&&(i+=" if (true) { "),i}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,f="data"+(c||""),m="valid"+l;return!1===a.schema?(a.isTop?p=!0:r+=" var "+m+" = false; ",(H=H||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ",O=r,r=H.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+O+"]); ":" validate.errors = ["+O+"]; return false; ":" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ",a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var v=a.isTop,l=a.level=0,c=a.dataLevel=0,f="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(y);a.logger.warn(y)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,f="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}var g,m="valid"+l,p=!a.opts.allErrors,P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){a.opts.coerceTypes&&(g=a.util.coerceToTypes(a.opts.coerceTypes,w));var S=a.RULES.types[w];if(g||b||!0===S||S&&!G(S)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,f,a.opts.strictNumbers,!0)+") { ",g){var _="dataType"+l,F="coerced"+l;r+=" var "+_+" = typeof "+f+"; ","array"==a.opts.coerceTypes&&(r+=" if ("+_+" == 'object' && Array.isArray("+f+")) "+_+" = 'array'; "),r+=" var "+F+" = undefined; ";var x="",R=g;if(R)for(var $,j=-1,D=R.length-1;j= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,C=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=k(e/r);455k((A-a)/h))&&L("overflow"),a+=p*h;var f=d<=o?1:o+26<=d?26:d-o;if(pk(A/m)&&L("overflow"),h*=m}var v=r.length+1,o=T(a-u,v,0==u);k(a/v)>A-s&&L("overflow"),s+=k(a/v),a%=v,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)}function c(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(C(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,p=d;for(d&&r.push("-");pk((A-s)/w)&&L("overflow"),s+=(f-a)*w,a=f;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var R=F.value;if(RA&&L("overflow"),R==a){for(var $=s,j=36;;j+=36){var D=j<=o?1:o+26<=j?26:j-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function p(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]')),M=new RegExp(U,"g"),B=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),G=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',K),"g"),Y=new RegExp(J("[^]",U,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),W=Y;function X(e){var r=p(e);return r.match(M)?r:e}var ee={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a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d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var R=e("./resolve"),$=e("./util"),j=e("./error_classes"),D=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=$.ucs2length,A=e("fast-deep-equal"),k=j.Validation;function C(e,c,u,r){var d=this,p=this._opts,h=[void 0],f={},l=[],t={},m=[],a={},v=[],s=function(e,r,t){var a=L.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}.call(this,e,c=c||{schema:e,refVal:h,refs:f},r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=P;var y=this._formats,g=this.RULES;try{var i=E(e,c,u,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,p.sourceCode&&(n.source=i.source)),i}finally{(function(e,r,t){var a=L.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}).call(this,e,c,r)}function P(){var e=o.validate,r=e.apply(this,arguments);return P.errors=e.errors,r}function E(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=c.schema)return C.call(d,e,r,t,a);var o=!0===e.$async,i=O({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:j.MissingRef,RULES:g,validate:O,util:$,resolve:R,resolveRef:w,usePattern:_,useDefault:F,useCustomRule:x,opts:p,formats:y,logger:d.logger,self:d}),i=Q(h,z)+Q(l,N)+Q(m,q)+Q(v,T)+i;p.processCode&&(i=p.processCode(i,e));try{var n=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",i)(d,g,y,c,h,m,v,A,I,k);h[0]=n}catch(e){throw d.logger.error("Error compiling schema, function code:",i),e}return n.schema=e,n.errors=null,n.refs=f,n.refVal=h,n.root=s?n:r,o&&(n.$async=!0),!0===p.sourceCode&&(n.source={code:i,patterns:l,defaults:m}),n}function w(e,r,t){r=R.url(e,r);var a,s,o=f[r];if(void 0!==o)return S(a=h[o],s="refVal["+o+"]");if(!t&&c.refs){var i=c.refs[r];if(void 0!==i)return S(a=c.refVal[i],s=b(r,a))}s=b(r);var n,l=R.call(d,E,c,r);if(void 0!==l||(n=u&&u[r])&&(l=R.inlineRef(n,p.inlineRefs)?n:C.call(d,n,c,u,e)),void 0!==l)return S(h[f[r]]=l,s);delete f[r]}function b(e,r){var t=h.length;return h[t]=r,"refVal"+(f[e]=t)}function S(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function _(e){var r=t[e];return void 0===r&&(r=t[e]=l.length,l[r]=e),"pattern"+r}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return $.toQuotedString(e);case"object":if(null===e)return"null";var r=D(e),t=a[r];return void 0===t&&(t=a[r]=m.length,m[t]=e),"default"+t}}function x(e,r,t,a){if(!1!==d._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o)if(!o(r)){var i="keyword schema is invalid: "+d.errorsText(o.errors);if("log"!=d._opts.validateSchema)throw new Error(i);d.logger.error(i)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(d,r,t,a);else if(u)n=u.call(d,r,t,a),!1!==p.validateSchema&&d.validateSchema(n,!0);else if(c)n=c.call(d,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=v.length;return{code:"customRule"+h,validate:v[h]=n}}}function L(e,r,t){for(var a=0;a",_=P?">":"<",F=void 0;if(!y&&"number"!=typeof d&&void 0!==d)throw new Error(r+" must be number");if(!b&&void 0!==w&&"number"!=typeof w&&"boolean"!=typeof w)throw new Error(E+" must be number or boolean");b?(o="exclIsNumber"+u,i="' + "+(n="op"+u)+" + '",c+=" var schemaExcl"+u+" = "+(t=e.util.getData(w.$data,h,e.dataPathArr))+"; ",F=E,(l=l||[]).push(c+=" var "+(a="exclusive"+u)+"; var "+(s="exclType"+u)+" = typeof "+(t="schemaExcl"+u)+"; if ("+s+" != 'boolean' && "+s+" != 'undefined' && "+s+" != 'number') { "),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(c+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",x=c,c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+s+" == 'number' ? ( ("+a+" = "+g+" === undefined || "+t+" "+S+"= "+g+") ? "+v+" "+_+"= "+t+" : "+v+" "+_+" "+g+" ) : ( ("+a+" = "+t+" === true) ? "+v+" "+_+"= "+g+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { var op"+u+" = "+a+" ? '"+S+"' : '"+S+"='; ",void 0===d&&(f=e.errSchemaPath+"/"+(F=E),g=t,y=b)):(i=S,(o="number"==typeof w)&&y?(n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" ( "+g+" === undefined || "+w+" "+S+"= "+g+" ? "+v+" "+_+"= "+w+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { "):(o&&void 0===d?(a=!0,f=e.errSchemaPath+"/"+(F=E),g=w,_+="="):(o&&(g=Math[P?"min":"max"](w,d)),w===(!o||g)?(a=!0,f=e.errSchemaPath+"/"+(F=E),_+="="):(a=!1,i+="=")),n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+v+" "+_+" "+g+" || "+v+" !== "+v+") { ")),F=F||r,(l=l||[]).push(c),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+n+", limit: "+g+", exclusive: "+a+" } ",!1!==e.opts.messages&&(c+=" , message: 'should be "+i+" ",c+=y?"' + "+g:g+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+d,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ";var x=c;return c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",m&&(c+=" else { "),c}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" "+c+".length "+("maxItems"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxItems"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),t+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ";var d=r,p=p||[];p.push(t+=" "+("maxLength"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be ",t+="maxLength"==r?"longer":"shorter",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" Object.keys("+c+").length "+("maxProperties"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxProperties"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var p,f=-1,m=d.length-1;f "+_+") { ",x=c+"["+_+"]",d.schema=$,d.schemaPath=i+"["+_+"]",d.errSchemaPath=n+"/"+_,d.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0),d.dataPathArr[v]=_,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",t+=" } ",l&&(t+=" if ("+f+") { ",p+="}"))}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&0 "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0),x=c+"["+m+"]",d.dataPathArr[v]=m,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",l&&(t+=" if (!"+f+") break; "),t+=" } } ",l&&(t+=" if ("+f+") { ",p+="}"))}else{(e.opts.strictKeywords?"object"==typeof o&&0 1e-"+e.opts.multipleOfPrecision+" ":" division"+a+" !== parseInt(division"+a+") ",t+=" ) ",u&&(t+=" ) ");var d=d||[];d.push(t+=" ) { "),t="",!1!==e.createErrors?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { multipleOf: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be multiple of ",t+=u?"' + "+h:h+"'"),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t,t=d.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d,p,f,m,v="valid"+h.level;return(e.opts.strictKeywords?"object"==typeof o&&0 1) { ",t=e.schema.items&&e.schema.items.type,a=Array.isArray(t),!t||"object"==t||"array"==t||a&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+f+" = false; break outer; } } } ":(i+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ",i+=" if ("+e.util["checkDataType"+(a?"s":"")](t,"item",e.opts.strictNumbers,!0)+") continue; ",a&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),i+=" } ",m&&(i+=" } "),(s=s||[]).push(i+=" if (!"+f+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=m?"validate.schema"+u:""+c,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",o=i,i=s.pop(),i+=!e.compositeRule&&d?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { ")):d&&(i+=" if (true) { "),i}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,f="data"+(c||""),m="valid"+l;return!1===a.schema?(a.isTop?p=!0:r+=" var "+m+" = false; ",(U=U||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ",D=r,r=U.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+D+"]); ":" validate.errors = ["+D+"]; return false; ":" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ",a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var v=a.isTop,l=a.level=0,c=a.dataLevel=0,f="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[""],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(y);a.logger.warn(y)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,f="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}var g,m="valid"+l,p=!a.opts.allErrors,P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){a.opts.coerceTypes&&(g=a.util.coerceToTypes(a.opts.coerceTypes,w));var S=a.RULES.types[w];if(g||b||!0===S||S&&!Z(S)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,f,a.opts.strictNumbers,!0)+") { ",g){var _="dataType"+l,F="coerced"+l;r+=" var "+_+" = typeof "+f+"; var "+F+" = undefined; ","array"==a.opts.coerceTypes&&(r+=" if ("+_+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+_+" = typeof "+f+"; if ("+a.util.checkDataType(a.schema.type,f,a.opts.strictNumbers)+") "+F+" = "+f+"; } "),r+=" if ("+F+" !== undefined) ; ";var x=g;if(x)for(var R,$=-1,j=x.length-1;$= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,C=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=k(e/r);455k((A-a)/h))&&L("overflow"),a+=p*h;var f=d<=o?1:o+26<=d?26:d-o;if(pk(A/m)&&L("overflow"),h*=m}var v=r.length+1,o=z(a-u,v,0==u);k(a/v)>A-s&&L("overflow"),s+=k(a/v),a%=v,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)}function c(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(C(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,p=d;for(d&&r.push("-");pk((A-s)/w)&&L("overflow"),s+=(f-a)*w,a=f;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var R=F.value;if(RA&&L("overflow"),R==a){for(var $=s,j=36;;j+=36){var D=j<=o?1:o+26<=j?26:j-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function p(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]')),Y=new RegExp(M,"g"),W=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),X=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',G),"g"),ee=new RegExp(J("[^]",M,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ee;function te(e){var r=p(e);return r.match(Y)?r:e}var ae={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n 0 + ? (typeof _schema == 'object' && Object.keys(_schema).length > 0) + || _schema === false : it.util.schemaHasRules(_schema, it.RULES.all)) #}} diff --git a/node_modules/ajv/lib/dot/validate.jst b/node_modules/ajv/lib/dot/validate.jst index fd833a535c2ab..32087e71c0d53 100644 --- a/node_modules/ajv/lib/dot/validate.jst +++ b/node_modules/ajv/lib/dot/validate.jst @@ -81,7 +81,7 @@ it.baseId = it.baseId || it.rootId; delete it.isTop; - it.dataPathArr = [undefined]; + it.dataPathArr = [""]; if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = 'default is ignored in the schema root'; diff --git a/node_modules/ajv/lib/dotjs/allOf.js b/node_modules/ajv/lib/dotjs/allOf.js index 8fd2e8f4804d8..fb8c2e4bbefe9 100644 --- a/node_modules/ajv/lib/dotjs/allOf.js +++ b/node_modules/ajv/lib/dotjs/allOf.js @@ -17,7 +17,7 @@ module.exports = function generate_allOf(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; diff --git a/node_modules/ajv/lib/dotjs/anyOf.js b/node_modules/ajv/lib/dotjs/anyOf.js index 0421495e1d28e..0600a9d42bce5 100644 --- a/node_modules/ajv/lib/dotjs/anyOf.js +++ b/node_modules/ajv/lib/dotjs/anyOf.js @@ -15,7 +15,7 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { - return (it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all)); + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; diff --git a/node_modules/ajv/lib/dotjs/contains.js b/node_modules/ajv/lib/dotjs/contains.js index 64ab12c5ec978..7d763009073aa 100644 --- a/node_modules/ajv/lib/dotjs/contains.js +++ b/node_modules/ajv/lib/dotjs/contains.js @@ -18,7 +18,7 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, - $nonEmptySchema = (it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all)); + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; diff --git a/node_modules/ajv/lib/dotjs/dependencies.js b/node_modules/ajv/lib/dotjs/dependencies.js index 9654b3c0e9d84..e4829497b0727 100644 --- a/node_modules/ajv/lib/dotjs/dependencies.js +++ b/node_modules/ajv/lib/dotjs/dependencies.js @@ -143,7 +143,7 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; diff --git a/node_modules/ajv/lib/dotjs/if.js b/node_modules/ajv/lib/dotjs/if.js index 93c7ed2a04b20..94d27ad853836 100644 --- a/node_modules/ajv/lib/dotjs/if.js +++ b/node_modules/ajv/lib/dotjs/if.js @@ -15,8 +15,8 @@ module.exports = function generate_if(it, $keyword, $ruleType) { var $nextValid = 'valid' + $it.level; var $thenSch = it.schema['then'], $elseSch = it.schema['else'], - $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? typeof $thenSch == 'object' && Object.keys($thenSch).length > 0 : it.util.schemaHasRules($thenSch, it.RULES.all)), - $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? typeof $elseSch == 'object' && Object.keys($elseSch).length > 0 : it.util.schemaHasRules($elseSch, it.RULES.all)), + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), $currentBaseId = $it.baseId; if ($thenPresent || $elsePresent) { var $ifClause; diff --git a/node_modules/ajv/lib/dotjs/items.js b/node_modules/ajv/lib/dotjs/items.js index 139c1d9470b87..bee5d67da246f 100644 --- a/node_modules/ajv/lib/dotjs/items.js +++ b/node_modules/ajv/lib/dotjs/items.js @@ -66,7 +66,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; @@ -89,7 +89,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { } } } - if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0 : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; @@ -113,7 +113,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { $closingBraces += '}'; } } - } else if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; diff --git a/node_modules/ajv/lib/dotjs/not.js b/node_modules/ajv/lib/dotjs/not.js index 6aea6599144f8..f50c93785b712 100644 --- a/node_modules/ajv/lib/dotjs/not.js +++ b/node_modules/ajv/lib/dotjs/not.js @@ -12,7 +12,7 @@ module.exports = function generate_not(it, $keyword, $ruleType) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; - if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; diff --git a/node_modules/ajv/lib/dotjs/oneOf.js b/node_modules/ajv/lib/dotjs/oneOf.js index 30988d5e3d73d..dfe2fd550ef28 100644 --- a/node_modules/ajv/lib/dotjs/oneOf.js +++ b/node_modules/ajv/lib/dotjs/oneOf.js @@ -26,7 +26,7 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; diff --git a/node_modules/ajv/lib/dotjs/properties.js b/node_modules/ajv/lib/dotjs/properties.js index d981a6a4e01fa..bc5ee55478090 100644 --- a/node_modules/ajv/lib/dotjs/properties.js +++ b/node_modules/ajv/lib/dotjs/properties.js @@ -189,7 +189,7 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; @@ -292,7 +292,7 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { while (i4 < l4) { $pProperty = arr4[i4 += 1]; var $sch = $pProperties[$pProperty]; - if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); diff --git a/node_modules/ajv/lib/dotjs/propertyNames.js b/node_modules/ajv/lib/dotjs/propertyNames.js index 064a0ed816fd4..2a54a08f45e54 100644 --- a/node_modules/ajv/lib/dotjs/propertyNames.js +++ b/node_modules/ajv/lib/dotjs/propertyNames.js @@ -14,7 +14,7 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { $it.level++; var $nextValid = 'valid' + $it.level; out += 'var ' + ($errs) + ' = errors;'; - if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; diff --git a/node_modules/ajv/lib/dotjs/required.js b/node_modules/ajv/lib/dotjs/required.js index 12110a4a262b5..14873eee3d528 100644 --- a/node_modules/ajv/lib/dotjs/required.js +++ b/node_modules/ajv/lib/dotjs/required.js @@ -28,7 +28,7 @@ module.exports = function generate_required(it, $keyword, $ruleType) { while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; - if (!($propertySch && (it.opts.strictKeywords ? typeof $propertySch == 'object' && Object.keys($propertySch).length > 0 : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { $required[$required.length] = $property; } } diff --git a/node_modules/ajv/lib/dotjs/validate.js b/node_modules/ajv/lib/dotjs/validate.js index af51dec31d626..f295824b9325a 100644 --- a/node_modules/ajv/lib/dotjs/validate.js +++ b/node_modules/ajv/lib/dotjs/validate.js @@ -91,7 +91,7 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; - it.dataPathArr = [undefined]; + it.dataPathArr = [""]; if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = 'default is ignored in the schema root'; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); @@ -153,43 +153,35 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; - out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; if (it.opts.coerceTypes == 'array') { - out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; } - out += ' var ' + ($coerced) + ' = undefined; '; - var $bracesCoercion = ''; + out += ' if (' + ($coerced) + ' !== undefined) ; '; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; - if ($i) { - out += ' if (' + ($coerced) + ' === undefined) { '; - $bracesCoercion += '}'; - } - if (it.opts.coerceTypes == 'array' && $type != 'array') { - out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; - } if ($type == 'string') { - out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { - out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { - out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { - out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { - out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } - out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + out += ' else { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ @@ -229,7 +221,7 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } - out += ' } else { '; + out += ' } if (' + ($coerced) + ' !== undefined) { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; diff --git a/node_modules/ajv/package.json b/node_modules/ajv/package.json index c2a1c1f8ed4ae..d764f6860b060 100644 --- a/node_modules/ajv/package.json +++ b/node_modules/ajv/package.json @@ -1,6 +1,6 @@ { "name": "ajv", - "version": "6.12.3", + "version": "6.12.5", "description": "Another JSON Schema Validator", "main": "lib/ajv.js", "typings": "lib/ajv.d.ts", diff --git a/package-lock.json b/package-lock.json index 4d0d9b362f04a..895dc4e404a02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -171,7 +171,7 @@ "npx": "bin/npx-cli.js" }, "devDependencies": { - "eslint": "^7.5.0", + "eslint": "^7.10.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", @@ -394,6 +394,27 @@ "integrity": "sha512-KyqT0kkdxgbGys9mvo/1Mgdt/LGvUFPCZIK9pWPIfOM2mYzMDd/eVYy4sMP1YqvVI129k0alxRyM53H2MAs/Nw==", "dev": true }, + "node_modules/@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/@npmcli/arborist": { "version": "0.0.28", "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.28.tgz", @@ -601,9 +622,9 @@ "inBundle": true }, "node_modules/acorn": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", - "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -613,12 +634,12 @@ } }, "node_modules/acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", "dev": true, "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0" + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/agent-base": { @@ -661,9 +682,9 @@ } }, "node_modules/ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "inBundle": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -1878,22 +1899,23 @@ } }, "node_modules/eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz", + "integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", - "eslint-scope": "^5.1.0", + "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", + "espree": "^7.3.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -2114,12 +2136,12 @@ } }, "node_modules/eslint-scope": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", - "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "engines": { @@ -2181,12 +2203,12 @@ } }, "node_modules/espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", "dev": true, "dependencies": { - "acorn": "^7.3.1", + "acorn": "^7.4.0", "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.3.0" }, @@ -2229,17 +2251,26 @@ } }, "node_modules/esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "dependencies": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -9277,6 +9308,24 @@ "integrity": "sha512-KyqT0kkdxgbGys9mvo/1Mgdt/LGvUFPCZIK9pWPIfOM2mYzMDd/eVYy4sMP1YqvVI129k0alxRyM53H2MAs/Nw==", "dev": true }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, "@npmcli/arborist": { "version": "0.0.28", "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.28.tgz", @@ -9455,15 +9504,15 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "acorn": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", - "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", "dev": true }, "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", "dev": true, "requires": {} }, @@ -9495,9 +9544,9 @@ } }, "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -10413,22 +10462,23 @@ "dev": true }, "eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz", + "integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", - "eslint-scope": "^5.1.0", + "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", + "espree": "^7.3.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -10627,12 +10677,12 @@ "requires": {} }, "eslint-scope": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", - "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, @@ -10658,12 +10708,12 @@ "dev": true }, "espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", "dev": true, "requires": { - "acorn": "^7.3.1", + "acorn": "^7.4.0", "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.3.0" } @@ -10692,12 +10742,20 @@ } }, "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "estraverse": { diff --git a/package.json b/package.json index 63c55b8f6e146..e0949a3b28c74 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,7 @@ "write-file-atomic" ], "devDependencies": { - "eslint": "^7.5.0", + "eslint": "^7.10.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", From 67793abd4abdf315816b6266ddb045289f607b03 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 12:37:40 -0400 Subject: [PATCH 05/39] eslint-plugin-import@2.22.1 --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 895dc4e404a02..4f28d55ea4311 100644 --- a/package-lock.json +++ b/package-lock.json @@ -172,7 +172,7 @@ }, "devDependencies": { "eslint": "^7.10.0", - "eslint-plugin-import": "^2.22.0", + "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", @@ -2025,9 +2025,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", - "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", "dev": true, "dependencies": { "array-includes": "^3.1.1", @@ -2035,7 +2035,7 @@ "contains-path": "^0.1.0", "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.3", + "eslint-import-resolver-node": "^0.3.4", "eslint-module-utils": "^2.6.0", "has": "^1.0.3", "minimatch": "^3.0.4", @@ -10588,9 +10588,9 @@ } }, "eslint-plugin-import": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", - "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", "dev": true, "requires": { "array-includes": "^3.1.1", @@ -10598,7 +10598,7 @@ "contains-path": "^0.1.0", "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.3", + "eslint-import-resolver-node": "^0.3.4", "eslint-module-utils": "^2.6.0", "has": "^1.0.3", "minimatch": "^3.0.4", diff --git a/package.json b/package.json index e0949a3b28c74..6e0b3dc03480f 100644 --- a/package.json +++ b/package.json @@ -201,7 +201,7 @@ ], "devDependencies": { "eslint": "^7.10.0", - "eslint-plugin-import": "^2.22.0", + "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", From 2aa9a1f8a5773b9a960b14b51c8111fb964bc9ae Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 12:47:25 -0400 Subject: [PATCH 06/39] chore: removed unused request dep --- package-lock.json | 2 -- package.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f28d55ea4311..8ce1d0dd23058 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,7 +68,6 @@ "read", "read-package-json", "read-package-json-fast", - "request", "retry", "rimraf", "semver", @@ -148,7 +147,6 @@ "read": "~1.0.7", "read-package-json": "^2.1.2", "read-package-json-fast": "^1.2.1", - "request": "^2.88.0", "retry": "^0.12.0", "rimraf": "^2.6.3", "semver": "^7.3.2", diff --git a/package.json b/package.json index 6e0b3dc03480f..fbdcccba8540b 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,6 @@ "read": "~1.0.7", "read-package-json": "^2.1.2", "read-package-json-fast": "^1.2.1", - "request": "^2.88.0", "retry": "^0.12.0", "rimraf": "^2.6.3", "semver": "^7.3.2", @@ -181,7 +180,6 @@ "read", "read-package-json", "read-package-json-fast", - "request", "retry", "rimraf", "semver", From a27e8d00664e5d4c3e81d664253a10176adb39c8 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 13:26:31 -0400 Subject: [PATCH 07/39] is-cidr@4.0.2 --- node_modules/cidr-regex/README.md | 23 ++++---- node_modules/cidr-regex/index.d.ts | 55 ++++++++++++++++++ node_modules/cidr-regex/index.js | 19 ++++--- node_modules/cidr-regex/package.json | 19 ++++--- node_modules/ip-regex/index.d.ts | 70 +++++++++++++++++++++++ node_modules/ip-regex/index.js | 26 ++++++--- node_modules/ip-regex/license | 20 ++----- node_modules/ip-regex/package.json | 85 ++++++++++++++-------------- node_modules/ip-regex/readme.md | 27 ++++++++- node_modules/is-cidr/index.js | 17 ++---- node_modules/is-cidr/package.json | 16 +++--- package-lock.json | 52 ++++++++--------- package.json | 2 +- 13 files changed, 289 insertions(+), 142 deletions(-) create mode 100644 node_modules/cidr-regex/index.d.ts create mode 100644 node_modules/ip-regex/index.d.ts diff --git a/node_modules/cidr-regex/README.md b/node_modules/cidr-regex/README.md index d24d7071ae78d..b2d110242b25d 100644 --- a/node_modules/cidr-regex/README.md +++ b/node_modules/cidr-regex/README.md @@ -1,36 +1,34 @@ # cidr-regex -[![](https://img.shields.io/npm/v/cidr-regex.svg?style=flat)](https://www.npmjs.org/package/cidr-regex) [![](https://img.shields.io/npm/dm/cidr-regex.svg)](https://www.npmjs.org/package/cidr-regex) [![](https://api.travis-ci.org/silverwind/cidr-regex.svg?style=flat)](https://travis-ci.org/silverwind/cidr-regex) +[![](https://img.shields.io/npm/v/cidr-regex.svg?style=flat)](https://www.npmjs.org/package/cidr-regex) [![](https://img.shields.io/npm/dm/cidr-regex.svg)](https://www.npmjs.org/package/cidr-regex) > Regular expression for matching IP addresses in CIDR notation -## Install +## Usage ```sh -$ npm install --save cidr-regex +$ npm i cidr-regex ``` -## Usage - ```js -const cidrRegex = require('cidr-regex'); +const cidrRegex = require("cidr-regex"); // Contains a CIDR IP address? -cidrRegex().test('foo 192.168.0.1/24'); +cidrRegex().test("foo 192.168.0.1/24"); //=> true // Is a CIDR IP address? -cidrRegex({exact: true}).test('foo 192.168.0.1/24'); +cidrRegex({exact: true}).test("foo 192.168.0.1/24"); //=> false -cidrRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8/64'); +cidrRegex.v6({exact: true}).test("1:2:3:4:5:6:7:8/64"); //=> true -'foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz'.match(cidrRegex()); -//=> ['192.168.0.1/24', '1:2:3:4:5:6:7:8/64'] +// Extract CIDRs from string +"foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz".match(cidrRegex()); +//=> ["192.168.0.1/24", "1:2:3:4:5:6:7:8/64"] ``` ## API - ### cidrRegex([options]) Returns a regex for matching both IPv4 and IPv6 CIDR IP addresses. @@ -50,7 +48,6 @@ Default: `false` *(Matches any CIDR IP address in a string)* Only match an exact string. Useful with `RegExp#test()` to check if a string is a CIDR IP address. - ## Related - [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation diff --git a/node_modules/cidr-regex/index.d.ts b/node_modules/cidr-regex/index.d.ts new file mode 100644 index 0000000000000..9099caecc8e2a --- /dev/null +++ b/node_modules/cidr-regex/index.d.ts @@ -0,0 +1,55 @@ +declare namespace ip { + interface Options { + /** + Only match an exact string. Useful with `RegExp#test()` to check if a string is a CIDR IP address. *(`false` matches any CIDR IP address in a string)* + + @default false + */ + readonly exact?: boolean; + } +} + +declare const ip: { + /** + Regular expression for matching IP addresses in CIDR notation. + + @returns A regex for matching both IPv4 and IPv6 CIDR IP addresses. + + @example + ``` + import cidrRegex = require("cidr-regex"); + + // Contains a CIDR IP address? + cidrRegex().test("foo 192.168.0.1/24"); + //=> true + + // Is a CIDR IP address? + cidrRegex({exact: true}).test("foo 192.168.0.1/24"); + //=> false + + "foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz".match(cidrRegex()); + //=> ["192.168.0.1/24", "1:2:3:4:5:6:7:8/64"] + ``` + */ + (options?: ip.Options): RegExp; + + /** + @returns A regex for matching IPv4 CIDR IP addresses. + */ + v4(options?: ip.Options): RegExp; + + /** + @returns A regex for matching IPv6 CIDR IP addresses. + + @example + ``` + import cidrRegex = require("cidr-regex"); + + cidrRegex.v6({exact: true}).test("1:2:3:4:5:6:7:8/64"); + //=> true + ``` + */ + v6(options?: ip.Options): RegExp; +}; + +export = ip; diff --git a/node_modules/cidr-regex/index.js b/node_modules/cidr-regex/index.js index f141ce14ad0dd..0f12ee10b3c81 100644 --- a/node_modules/cidr-regex/index.js +++ b/node_modules/cidr-regex/index.js @@ -2,12 +2,17 @@ const ipRegex = require("ip-regex"); -const v4 = ipRegex.v4().source + "\\/(3[0-2]|[12]?[0-9])"; -const v6 = ipRegex.v6().source + "\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])"; +const defaultOpts = {exact: false}; -const cidr = module.exports = opts => opts && opts.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${v4})|(?:${v6})`, "g"); +const v4str = `${ipRegex.v4().source}\\/(3[0-2]|[12]?[0-9])`; +const v6str = `${ipRegex.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`; -cidr.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, "g"); -cidr.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, "g"); +// can not precompile the non-exact regexes because global flag makes the regex object stateful +// which would require the user to reset .lastIndex on subsequent calls +const v4exact = new RegExp(`^${v4str}$`); +const v6exact = new RegExp(`^${v6str}$`); +const v46exact = new RegExp(`(?:^${v4str}$)|(?:^${v6str}$)`); + +module.exports = ({exact} = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g"); +module.exports.v4 = ({exact} = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g"); +module.exports.v6 = ({exact} = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g"); diff --git a/node_modules/cidr-regex/package.json b/node_modules/cidr-regex/package.json index 7e5cdf7e32071..8ddef4ed96a93 100644 --- a/node_modules/cidr-regex/package.json +++ b/node_modules/cidr-regex/package.json @@ -1,6 +1,6 @@ { "name": "cidr-regex", - "version": "2.0.10", + "version": "3.1.1", "description": "Regular expression for matching IP addresses in CIDR notation", "author": "silverwind ", "contributors": [ @@ -12,10 +12,11 @@ "test": "make test" }, "engines": { - "node": ">=4" + "node": ">=10" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "keywords": [ "cidr", @@ -28,12 +29,14 @@ "ip address" ], "dependencies": { - "ip-regex": "^2.1.0" + "ip-regex": "^4.1.0" }, "devDependencies": { - "eslint": "^5.6.0", - "eslint-config-silverwind": "^2.0.9", - "updates": "^4.3.0", - "ver": "^2.0.1" + "eslint": "7.8.1", + "eslint-config-silverwind": "18.0.8", + "jest": "26.4.2", + "tsd": "0.13.1", + "updates": "10.3.6", + "versions": "8.4.3" } } diff --git a/node_modules/ip-regex/index.d.ts b/node_modules/ip-regex/index.d.ts new file mode 100644 index 0000000000000..0999ed287f790 --- /dev/null +++ b/node_modules/ip-regex/index.d.ts @@ -0,0 +1,70 @@ +declare namespace ip { + interface Options { + /** + Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. *(`false` matches any IP address in a string)* + + @default false + */ + readonly exact?: boolean; + + /** + Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). + + @default false + */ + readonly includeBoundaries?: boolean; + } +} + +declare const ip: { + /** + Regular expression for matching IP addresses. + + @returns A regex for matching both IPv4 and IPv6. + + @example + ``` + import ipRegex = require('ip-regex'); + + // Contains an IP address? + ipRegex().test('unicorn 192.168.0.1'); + //=> true + + // Is an IP address? + ipRegex({exact: true}).test('unicorn 192.168.0.1'); + //=> false + + 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); + //=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] + + // Contains an IP address? + ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); + //=> false + + // Matches an IP address? + '192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); + //=> null + ``` + */ + (options?: ip.Options): RegExp; + + /** + @returns A regex for matching IPv4. + */ + v4(options?: ip.Options): RegExp; + + /** + @returns A regex for matching IPv6. + + @example + ``` + import ipRegex = require('ip-regex'); + + ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); + //=> true + ``` + */ + v6(options?: ip.Options): RegExp; +}; + +export = ip; diff --git a/node_modules/ip-regex/index.js b/node_modules/ip-regex/index.js index 973e5f41c28c7..1ac39f6a91e0a 100644 --- a/node_modules/ip-regex/index.js +++ b/node_modules/ip-regex/index.js @@ -1,8 +1,13 @@ 'use strict'; -const v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}'; +const word = '[a-fA-F\\d:]'; +const b = options => options && options.includeBoundaries ? + `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : + ''; -const v6seg = '[0-9a-fA-F]{1,4}'; +const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; + +const v6seg = '[a-fA-F\\d]{1,4}'; const v6 = ` ( (?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 @@ -16,9 +21,16 @@ const v6 = ` )(%[0-9a-zA-Z]{1,})? // %eth0 %1 `.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); -const ip = module.exports = opts => opts && opts.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${v4})|(?:${v6})`, 'g'); +// Pre-compile only the exact regexes because adding a global flag make regexes stateful +const v46Exact = new RegExp(`(?:^${v4}$)|(?:^${v6}$)`); +const v4exact = new RegExp(`^${v4}$`); +const v6exact = new RegExp(`^${v6}$`); + +const ip = options => options && options.exact ? + v46Exact : + new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); + +ip.v4 = options => options && options.exact ? v4exact : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); +ip.v6 = options => options && options.exact ? v6exact : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); -ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g'); -ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g'); +module.exports = ip; diff --git a/node_modules/ip-regex/license b/node_modules/ip-regex/license index 654d0bfe94343..e7af2f77107d7 100644 --- a/node_modules/ip-regex/license +++ b/node_modules/ip-regex/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +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: +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 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. +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/ip-regex/package.json b/node_modules/ip-regex/package.json index aa51479286766..b67a413b608dd 100644 --- a/node_modules/ip-regex/package.json +++ b/node_modules/ip-regex/package.json @@ -1,45 +1,44 @@ { - "name": "ip-regex", - "version": "2.1.0", - "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", - "license": "MIT", - "repository": "sindresorhus/ip-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ip", - "ipv6", - "ipv4", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "text", - "pattern", - "internet", - "protocol", - "address", - "validate" - ], - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "xo": { - "esnext": true - } + "name": "ip-regex", + "version": "4.2.0", + "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", + "license": "MIT", + "repository": "sindresorhus/ip-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ip", + "ipv6", + "ipv4", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "text", + "pattern", + "internet", + "protocol", + "address", + "validate" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } } diff --git a/node_modules/ip-regex/readme.md b/node_modules/ip-regex/readme.md index 66bc7f27317b4..08632c054e54b 100644 --- a/node_modules/ip-regex/readme.md +++ b/node_modules/ip-regex/readme.md @@ -6,9 +6,11 @@ ## Install ``` -$ npm install --save ip-regex +$ npm install ip-regex ``` +This module targets Node.js 8 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, use version 2.1.0: `npm install ip-regex@2.1.0` + ## Usage @@ -28,6 +30,14 @@ ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); //=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] + +// Contains an IP address? +ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); +//=> false + +// Matches an IP address? +'192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); +//=> null ``` @@ -45,17 +55,30 @@ Returns a regex for matching IPv4. Returns a regex for matching IPv6. -#### options.exact +#### options + +Type: `Object` + +##### exact Type: `boolean`
Default: `false` *(Matches any IP address in a string)* Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. +##### includeBoundaries + +Type: `boolean`
+Default: `false` + +Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). + ## Related - [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address +- [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation +- [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation ## License diff --git a/node_modules/is-cidr/index.js b/node_modules/is-cidr/index.js index 911c4bef6eb05..8caef5fbb72a3 100644 --- a/node_modules/is-cidr/index.js +++ b/node_modules/is-cidr/index.js @@ -1,14 +1,9 @@ "use strict"; -const cidrRegex = require("cidr-regex"); +const {v4, v6} = require("cidr-regex"); -const re4 = cidrRegex.v4({exact: true}); -const re6 = cidrRegex.v6({exact: true}); +const re4 = v4({exact: true}); +const re6 = v6({exact: true}); -const isCidr = module.exports = str => { - if (re4.test(str)) return 4; - if (re6.test(str)) return 6; - return 0; -}; - -isCidr.v4 = str => re4.test(str); -isCidr.v6 = str => re6.test(str); +module.exports = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0); +module.exports.v4 = str => re4.test(str); +module.exports.v6 = str => re6.test(str); diff --git a/node_modules/is-cidr/package.json b/node_modules/is-cidr/package.json index 370983472d1c5..b02775a0e3f6f 100644 --- a/node_modules/is-cidr/package.json +++ b/node_modules/is-cidr/package.json @@ -1,6 +1,6 @@ { "name": "is-cidr", - "version": "3.1.1", + "version": "4.0.2", "description": "Check if a string is an IP address in CIDR notation", "author": "silverwind ", "contributors": [ @@ -12,7 +12,7 @@ "test": "make test" }, "engines": { - "node": ">=6" + "node": ">=10" }, "files": [ "index.js", @@ -30,14 +30,14 @@ "network" ], "dependencies": { - "cidr-regex": "^2.0.10" + "cidr-regex": "^3.1.1" }, "devDependencies": { - "eslint": "7.0.0", - "eslint-config-silverwind": "13.1.0", - "jest": "26.0.1", - "updates": "10.2.11", - "versions": "8.2.9" + "eslint": "7.10.0", + "eslint-config-silverwind": "18.0.10", + "jest": "26.4.2", + "updates": "11.1.5", + "versions": "8.4.3" }, "jest": { "verbose": false, diff --git a/package-lock.json b/package-lock.json index 8ce1d0dd23058..6e7e543165b57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -115,7 +115,7 @@ "inherits": "^2.0.4", "ini": "^1.3.5", "init-package-json": "^1.10.3", - "is-cidr": "^3.0.0", + "is-cidr": "^4.0.2", "leven": "^3.1.0", "libnpmaccess": "^4.0.0", "libnpmfund": "0.0.0", @@ -1161,15 +1161,15 @@ } }, "node_modules/cidr-regex": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-2.0.10.tgz", - "integrity": "sha512-sB3ogMQXWvreNPbJUZMRApxuRYd+KoIo4RGQ81VatjmMW6WJPo+IJZ2846FGItr9VzKo5w7DXzijPLGtSd0N3Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-3.1.1.tgz", + "integrity": "sha512-RBqYd32aDwbCMFJRL6wHOlDNYJsPNTt8vC82ErHF5vKt8QQzxm1FrkW8s/R5pVrXMf17sba09Uoy91PKiddAsw==", "inBundle": true, "dependencies": { - "ip-regex": "^2.1.0" + "ip-regex": "^4.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/clean-stack": { @@ -3148,12 +3148,12 @@ "inBundle": true }, "node_modules/ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz", + "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A==", "inBundle": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/is-arrayish": { @@ -3187,15 +3187,15 @@ } }, "node_modules/is-cidr": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-3.1.1.tgz", - "integrity": "sha512-Gx+oErgq1j2jAKCR2Kbq0b3wbH0vQKqZ0wOlHxm0o56nq51Cs/DZA8oz9dMDhbHyHEGgJ86eTeVudtgMMOx3Mw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-4.0.2.tgz", + "integrity": "sha512-z4a1ENUajDbEl/Q6/pVBpTR1nBjjEE1X7qb7bmWYanNnPoKAvUCPFKeXV6Fe4mgTkWKBqiHIcwsI3SndiO5FeA==", "inBundle": true, "dependencies": { - "cidr-regex": "^2.0.10" + "cidr-regex": "^3.1.1" }, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/is-date-object": { @@ -9906,11 +9906,11 @@ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" }, "cidr-regex": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-2.0.10.tgz", - "integrity": "sha512-sB3ogMQXWvreNPbJUZMRApxuRYd+KoIo4RGQ81VatjmMW6WJPo+IJZ2846FGItr9VzKo5w7DXzijPLGtSd0N3Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-3.1.1.tgz", + "integrity": "sha512-RBqYd32aDwbCMFJRL6wHOlDNYJsPNTt8vC82ErHF5vKt8QQzxm1FrkW8s/R5pVrXMf17sba09Uoy91PKiddAsw==", "requires": { - "ip-regex": "^2.1.0" + "ip-regex": "^4.1.0" } }, "clean-stack": { @@ -11437,9 +11437,9 @@ "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" }, "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz", + "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A==" }, "is-arrayish": { "version": "0.2.1", @@ -11463,11 +11463,11 @@ "dev": true }, "is-cidr": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-3.1.1.tgz", - "integrity": "sha512-Gx+oErgq1j2jAKCR2Kbq0b3wbH0vQKqZ0wOlHxm0o56nq51Cs/DZA8oz9dMDhbHyHEGgJ86eTeVudtgMMOx3Mw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-4.0.2.tgz", + "integrity": "sha512-z4a1ENUajDbEl/Q6/pVBpTR1nBjjEE1X7qb7bmWYanNnPoKAvUCPFKeXV6Fe4mgTkWKBqiHIcwsI3SndiO5FeA==", "requires": { - "cidr-regex": "^2.0.10" + "cidr-regex": "^3.1.1" } }, "is-date-object": { diff --git a/package.json b/package.json index fbdcccba8540b..30e654e022ff6 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "inherits": "^2.0.4", "ini": "^1.3.5", "init-package-json": "^1.10.3", - "is-cidr": "^3.0.0", + "is-cidr": "^4.0.2", "leven": "^3.1.0", "libnpmaccess": "^4.0.0", "libnpmfund": "0.0.0", From 893fed45e2272ef764ebf927c659fcf5e7b355b3 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 13:30:55 -0400 Subject: [PATCH 08/39] marked-man@0.7.0 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e7e543165b57..26ab10d2206b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -176,7 +176,7 @@ "eslint-plugin-standard": "^4.0.1", "licensee": "^8.1.0", "marked": "^0.6.3", - "marked-man": "^0.6.0", + "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", "npm-registry-couchapp": "^2.7.3", "npm-registry-mock": "^1.3.0", @@ -4028,15 +4028,15 @@ } }, "node_modules/marked-man": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/marked-man/-/marked-man-0.6.0.tgz", - "integrity": "sha512-lqzGe2uPo0KPO5J5yyfZ6PbEpZS6VIMHIzltXNzdwTNBysD0pNLtTaGrtT5R4aFT8UaVR3Fuz9rN3SEFYnea5Q==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked-man/-/marked-man-0.7.0.tgz", + "integrity": "sha512-zxK5E4jbuARALc+fIUAanM2njVGnrd9YvKrqoDHUg2XwNLJijo39EzMIg59LecHBHsIHNtPqepqnJp4SmL/EVg==", "dev": true, "bin": { "marked-man": "bin/marked-man" }, "peerDependencies": { - "marked": "^0.6.2" + "marked": "^0.7.0" } }, "node_modules/merge-source-map": { @@ -12099,9 +12099,9 @@ "dev": true }, "marked-man": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/marked-man/-/marked-man-0.6.0.tgz", - "integrity": "sha512-lqzGe2uPo0KPO5J5yyfZ6PbEpZS6VIMHIzltXNzdwTNBysD0pNLtTaGrtT5R4aFT8UaVR3Fuz9rN3SEFYnea5Q==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked-man/-/marked-man-0.7.0.tgz", + "integrity": "sha512-zxK5E4jbuARALc+fIUAanM2njVGnrd9YvKrqoDHUg2XwNLJijo39EzMIg59LecHBHsIHNtPqepqnJp4SmL/EVg==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 30e654e022ff6..5c2da01a3258c 100644 --- a/package.json +++ b/package.json @@ -205,7 +205,7 @@ "eslint-plugin-standard": "^4.0.1", "licensee": "^8.1.0", "marked": "^0.6.3", - "marked-man": "^0.6.0", + "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", "npm-registry-couchapp": "^2.7.3", "npm-registry-mock": "^1.3.0", From d77594e52f2f7d65d45347f542f48e4dbb6d2f26 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 13:37:56 -0400 Subject: [PATCH 09/39] chore: removed unused npm-registry-couchapp dev-dep --- node_modules/.gitignore | 30 -- package-lock.json | 687 ---------------------------------------- package.json | 1 - 3 files changed, 718 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 90b41aae457ad..5c859281bbf1b 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -14,11 +14,7 @@ package-lock.json /@babel/types /@blueoak/list /@eslint/eslintrc -/@types/caseless /@types/json5 -/@types/node -/@types/request -/@types/tough-cookie /acorn /acorn-jsx /ansi-colors @@ -35,22 +31,17 @@ package-lock.json /bind-obj-methods /braces /browser-process-hrtime -/browser-request /buffer-from /caching-transform /caller /callsites /chokidar /cliui -/cloudant-follow -/coffee-script /color-support /commondir -/connect /contains-path /convert-source-map /correct-license-metadata -/couchapp /coveralls /cp-file /cross-spawn @@ -62,16 +53,12 @@ package-lock.json /diff-frag /docopt /doctrine -/ee-first /emoji-regex -/encodeurl /enquirer /error-ex -/errs /es-abstract /es-to-primitive /es6-error -/escape-html /escape-string-regexp /eslint /eslint-import-resolver-node @@ -95,7 +82,6 @@ package-lock.json /fast-levenshtein /file-entry-cache /fill-range -/finalhandler /find-cache-dir /find-up /findit @@ -104,7 +90,6 @@ package-lock.json /flow-parser /flow-remove-types /foreground-child -/form-data /fs-access /fs-exists-cached /fsevents @@ -119,7 +104,6 @@ package-lock.json /hasha /hock /html-escaper -/http-proxy /ignore /import-fresh /is-arrayish @@ -144,7 +128,6 @@ package-lock.json /js-tokens /js-yaml /jsesc -/json /json-parse-better-errors /json-parse-errback /json-stable-stringify-without-jsonify @@ -163,7 +146,6 @@ package-lock.json /marked-man /merge-source-map /minimist -/nano /natural-compare /nested-error-stacks /nice-try @@ -171,7 +153,6 @@ package-lock.json /normalize-path /npm-cache-filename /npm-license-corrections -/npm-registry-couchapp /npm-registry-mock /null-check /nyc @@ -180,8 +161,6 @@ package-lock.json /object.assign /object.getownpropertydescriptors /object.values -/on-finished -/optimist /optionator /own-or /own-or-env @@ -191,7 +170,6 @@ package-lock.json /package-hash /parent-module /parse-json -/parseurl /path-exists /path-key /path-type @@ -199,12 +177,10 @@ package-lock.json /pify /pirates /pkg-dir -/pkginfo /prelude-ls /progress /prop-types /pseudomap -/querystring /react /react-is /read-package-tree @@ -232,7 +208,6 @@ package-lock.json /spdx-whitelisted /sprintf-js /stack-utils -/statuses /string.prototype.trimend /string.prototype.trimstart /strip-bom @@ -255,17 +230,12 @@ package-lock.json /typedarray-to-buffer /typescript /unicode-length -/unpipe -/url /util-extend /util-promisify -/utils-merge /v8-compile-cache /vlq -/watch /which-module /word-wrap -/wordwrap /wrap-ansi /write /y18n diff --git a/package-lock.json b/package-lock.json index 26ab10d2206b2..9c3882d06be18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -178,7 +178,6 @@ "marked": "^0.6.3", "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", - "npm-registry-couchapp": "^2.7.3", "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", @@ -571,12 +570,6 @@ "node": ">= 6" } }, - "node_modules/@types/caseless": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz", - "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", - "dev": true - }, "node_modules/@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -589,30 +582,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "node_modules/@types/node": { - "version": "14.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", - "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", - "dev": true - }, - "node_modules/@types/request": { - "version": "2.48.5", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.5.tgz", - "integrity": "sha512-/LO7xRVnL3DxJ1WkPGDQrp4VTV1reX9RkC85mJ+Qzykj2Bdw+mG15aAfDahc76HtknjzE16SX/Yddn6MxVbmGQ==", - "dev": true, - "dependencies": { - "@types/caseless": "*", - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.0" - } - }, - "node_modules/@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==", - "dev": true - }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -1004,15 +973,6 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "node_modules/browser-request": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", - "integrity": "sha1-ns5bWsqJopkyJC4Yv5M975h2zBc=", - "dev": true, - "engines": [ - "node" - ] - }, "node_modules/buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -1302,23 +1262,6 @@ "node": ">=0.8" } }, - "node_modules/cloudant-follow": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/cloudant-follow/-/cloudant-follow-0.18.2.tgz", - "integrity": "sha512-qu/AmKxDqJds+UmT77+0NbM7Yab2K3w0qSeJRzsq5dRWJTEJdWeb+XpG4OpKuTE9RKOa/Awn2gR3TTnvNr3TeA==", - "dev": true, - "dependencies": { - "browser-request": "~0.3.0", - "debug": "^4.0.1", - "request": "^2.88.0" - }, - "bin": { - "follow": "cli.js" - }, - "engines": { - "node": ">=6.13.0" - } - }, "node_modules/cmd-shim": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.0.2.tgz", @@ -1341,20 +1284,6 @@ "node": ">=0.10.0" } }, - "node_modules/coffee-script": { - "version": "1.12.7", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", - "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==", - "deprecated": "CoffeeScript on NPM has moved to \"coffeescript\" (no hyphen)", - "dev": true, - "bin": { - "cake": "bin/cake", - "coffee": "bin/coffee" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1442,36 +1371,6 @@ "proto-list": "~1.2.1" } }, - "node_modules/connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/connect/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/connect/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -1511,27 +1410,6 @@ "spdx-expression-validate": "^2.0.0" } }, - "node_modules/couchapp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/couchapp/-/couchapp-0.11.0.tgz", - "integrity": "sha1-8J3DFdYQ9vbnn9DK9eXWJLDMeD4=", - "dev": true, - "engines": [ - "node >= 0.1.95" - ], - "dependencies": { - "coffee-script": "*", - "connect": "*", - "http-proxy": "0.8.7", - "nano": "*", - "request": "*", - "url": "*", - "watch": "~0.8.0" - }, - "bin": { - "couchapp": "bin.js" - } - }, "node_modules/coveralls": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", @@ -1757,27 +1635,12 @@ "integrity": "sha1-YMf4e9YrzGqJT6jM1q+3gjok90I=", "inBundle": true }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, "node_modules/emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/encoding": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", @@ -1824,15 +1687,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/errs": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/errs/-/errs-0.3.2.tgz", - "integrity": "sha1-eYCZstvTfKK8dJ5TinwTB9C1BJk=", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/es-abstract": { "version": "1.17.6", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", @@ -1881,12 +1735,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, "node_modules/escape-string-regexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", @@ -2350,39 +2198,6 @@ "node": ">=8" } }, - "node_modules/finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -2610,20 +2425,6 @@ "node": "*" } }, - "node_modules/form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/fs-access": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-2.0.0.tgz", @@ -2928,23 +2729,6 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "inBundle": true }, - "node_modules/http-proxy": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-0.8.7.tgz", - "integrity": "sha1-p7xThhgJLNJu0ZHkYlkzuu9t6A4=", - "dev": true, - "dependencies": { - "colors": "0.x.x", - "optimist": "0.3.x", - "pkginfo": "0.2.x" - }, - "bin": { - "node-http-proxy": "bin/node-http-proxy" - }, - "engines": { - "node": ">= 0.6.6" - } - }, "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", @@ -2959,15 +2743,6 @@ "node": ">= 6" } }, - "node_modules/http-proxy/node_modules/colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -3579,18 +3354,6 @@ "node": ">=4" } }, - "node_modules/json": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/json/-/json-9.0.6.tgz", - "integrity": "sha1-eXLCpaSKQmeNsnMMfCxO5uTiRYU=", - "dev": true, - "bin": { - "json": "lib/json.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4235,22 +3998,6 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "inBundle": true }, - "node_modules/nano": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/nano/-/nano-8.2.2.tgz", - "integrity": "sha512-1/rAvpd1J0Os0SazgutWQBx2buAq3KwJpmdIylPDqOwy73iQeAhTSCq3uzbGzvcNNW16Vv/BLXkk+DYcdcH+aw==", - "dev": true, - "dependencies": { - "@types/request": "^2.48.4", - "cloudant-follow": "^0.18.2", - "debug": "^4.1.1", - "errs": "^0.3.2", - "request": "^2.88.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4472,26 +4219,6 @@ "node": ">=10" } }, - "node_modules/npm-registry-couchapp": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/npm-registry-couchapp/-/npm-registry-couchapp-2.7.4.tgz", - "integrity": "sha512-8ZZ4zKvRqGhBw3qYGoLhFTltjz7V2ntO+qqrSwMBeYfSIoHt1w/xqqSMG76gM1jhEzv+/WWSJYvOpA8D2Qt7dw==", - "dev": true, - "dependencies": { - "couchapp": "~0.11.0", - "json": "~9.0.2", - "semver": "4" - } - }, - "node_modules/npm-registry-couchapp/node_modules/semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/npm-registry-fetch": { "version": "8.1.4", "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-8.1.4.tgz", @@ -4743,18 +4470,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -4773,15 +4488,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/optimist": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", - "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", - "dev": true, - "dependencies": { - "wordwrap": "~0.0.2" - } - }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -4988,15 +4694,6 @@ "node": ">=0.10.0" } }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -5093,15 +4790,6 @@ "node": ">=4" } }, - "node_modules/pkginfo": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz", - "integrity": "sha1-cjnEKl72wwuPMoQ52bn/cQQkkPg=", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -5237,15 +4925,6 @@ "node": ">=0.6" } }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/react": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", @@ -5897,15 +5576,6 @@ "node": ">=0.10.0" } }, - "node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -8630,15 +8300,6 @@ "imurmurhash": "^0.1.4" } }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -8648,22 +8309,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -8685,15 +8330,6 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -8754,15 +8390,6 @@ "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", "inBundle": true }, - "node_modules/watch": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.8.0.tgz", - "integrity": "sha1-G7DupT3v5uYh6cjGPANYAH7L28w=", - "dev": true, - "engines": [ - "node >=0.1.95" - ] - }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -8811,15 +8438,6 @@ "node": ">=0.10.0" } }, - "node_modules/wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", @@ -9455,12 +9073,6 @@ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, - "@types/caseless": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz", - "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", - "dev": true - }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -9472,30 +9084,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "@types/node": { - "version": "14.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", - "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", - "dev": true - }, - "@types/request": { - "version": "2.48.5", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.5.tgz", - "integrity": "sha512-/LO7xRVnL3DxJ1WkPGDQrp4VTV1reX9RkC85mJ+Qzykj2Bdw+mG15aAfDahc76HtknjzE16SX/Yddn6MxVbmGQ==", - "dev": true, - "requires": { - "@types/caseless": "*", - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.0" - } - }, - "@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==", - "dev": true - }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -9790,12 +9378,6 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "browser-request": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", - "integrity": "sha1-ns5bWsqJopkyJC4Yv5M975h2zBc=", - "dev": true - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -10005,17 +9587,6 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" }, - "cloudant-follow": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/cloudant-follow/-/cloudant-follow-0.18.2.tgz", - "integrity": "sha512-qu/AmKxDqJds+UmT77+0NbM7Yab2K3w0qSeJRzsq5dRWJTEJdWeb+XpG4OpKuTE9RKOa/Awn2gR3TTnvNr3TeA==", - "dev": true, - "requires": { - "browser-request": "~0.3.0", - "debug": "^4.0.1", - "request": "^2.88.0" - } - }, "cmd-shim": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.0.2.tgz", @@ -10030,12 +9601,6 @@ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, - "coffee-script": { - "version": "1.12.7", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", - "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==", - "dev": true - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -10103,35 +9668,6 @@ "proto-list": "~1.2.1" } }, - "connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -10166,21 +9702,6 @@ "spdx-expression-validate": "^2.0.0" } }, - "couchapp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/couchapp/-/couchapp-0.11.0.tgz", - "integrity": "sha1-8J3DFdYQ9vbnn9DK9eXWJLDMeD4=", - "dev": true, - "requires": { - "coffee-script": "*", - "connect": "*", - "http-proxy": "0.8.7", - "nano": "*", - "request": "*", - "url": "*", - "watch": "~0.8.0" - } - }, "coveralls": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", @@ -10350,24 +9871,12 @@ "resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz", "integrity": "sha1-YMf4e9YrzGqJT6jM1q+3gjok90I=" }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, "encoding": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", @@ -10405,12 +9914,6 @@ "is-arrayish": "^0.2.1" } }, - "errs": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/errs/-/errs-0.3.2.tgz", - "integrity": "sha1-eYCZstvTfKK8dJ5TinwTB9C1BJk=", - "dev": true - }, "es-abstract": { "version": "1.17.6", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", @@ -10447,12 +9950,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, "escape-string-regexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", @@ -10818,38 +10315,6 @@ "to-regex-range": "^5.0.1" } }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -11032,17 +10497,6 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, - "form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fs-access": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-2.0.0.tgz", @@ -11270,25 +10724,6 @@ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" }, - "http-proxy": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-0.8.7.tgz", - "integrity": "sha1-p7xThhgJLNJu0ZHkYlkzuu9t6A4=", - "dev": true, - "requires": { - "colors": "0.x.x", - "optimist": "0.3.x", - "pkginfo": "0.2.x" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true - } - } - }, "http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", @@ -11753,12 +11188,6 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "json": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/json/-/json-9.0.6.tgz", - "integrity": "sha1-eXLCpaSKQmeNsnMMfCxO5uTiRYU=", - "dev": true - }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -12243,19 +11672,6 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, - "nano": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/nano/-/nano-8.2.2.tgz", - "integrity": "sha512-1/rAvpd1J0Os0SazgutWQBx2buAq3KwJpmdIylPDqOwy73iQeAhTSCq3uzbGzvcNNW16Vv/BLXkk+DYcdcH+aw==", - "dev": true, - "requires": { - "@types/request": "^2.48.4", - "cloudant-follow": "^0.18.2", - "debug": "^4.1.1", - "errs": "^0.3.2", - "request": "^2.88.0" - } - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -12425,25 +11841,6 @@ "npm-registry-fetch": "^8.0.0" } }, - "npm-registry-couchapp": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/npm-registry-couchapp/-/npm-registry-couchapp-2.7.4.tgz", - "integrity": "sha512-8ZZ4zKvRqGhBw3qYGoLhFTltjz7V2ntO+qqrSwMBeYfSIoHt1w/xqqSMG76gM1jhEzv+/WWSJYvOpA8D2Qt7dw==", - "dev": true, - "requires": { - "couchapp": "~0.11.0", - "json": "~9.0.2", - "semver": "4" - }, - "dependencies": { - "semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true - } - } - }, "npm-registry-fetch": { "version": "8.1.4", "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-8.1.4.tgz", @@ -12631,15 +12028,6 @@ "has": "^1.0.3" } }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -12653,15 +12041,6 @@ "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==" }, - "optimist": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", - "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", - "dev": true, - "requires": { - "wordwrap": "~0.0.2" - } - }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -12818,12 +12197,6 @@ "error-ex": "^1.2.0" } }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -12890,12 +12263,6 @@ "find-up": "^2.1.0" } }, - "pkginfo": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz", - "integrity": "sha1-cjnEKl72wwuPMoQ52bn/cQQkkPg=", - "dev": true - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -12994,12 +12361,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, "react": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", @@ -13513,12 +12874,6 @@ "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", "dev": true }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -15593,12 +14948,6 @@ "imurmurhash": "^0.1.4" } }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -15607,24 +14956,6 @@ "punycode": "^2.1.0" } }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -15645,12 +14976,6 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -15700,12 +15025,6 @@ "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==" }, - "watch": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.8.0.tgz", - "integrity": "sha1-G7DupT3v5uYh6cjGPANYAH7L28w=", - "dev": true - }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -15742,12 +15061,6 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", diff --git a/package.json b/package.json index 5c2da01a3258c..550c485af4e39 100644 --- a/package.json +++ b/package.json @@ -207,7 +207,6 @@ "marked": "^0.6.3", "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", - "npm-registry-couchapp": "^2.7.3", "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", From bc20e0c8ae30a202c72af88586ab9c167dff980a Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 13:57:44 -0400 Subject: [PATCH 10/39] rimraf@3.0.2 --- .../node-gyp/node_modules/.bin/rimraf | 1 + .../node-gyp/node_modules/rimraf/LICENSE | 15 + .../node-gyp/node_modules/rimraf/README.md | 101 +++++ .../node-gyp/node_modules/rimraf/bin.js | 50 +++ .../node-gyp/node_modules/rimraf/package.json | 29 ++ .../node-gyp/node_modules/rimraf/rimraf.js | 372 ++++++++++++++++++ node_modules/rimraf/CHANGELOG.md | 65 +++ node_modules/rimraf/bin.js | 64 +-- node_modules/rimraf/package.json | 7 +- node_modules/rimraf/rimraf.js | 146 ++++--- package-lock.json | 142 ++++++- package.json | 2 +- 12 files changed, 882 insertions(+), 112 deletions(-) create mode 120000 node_modules/node-gyp/node_modules/.bin/rimraf create mode 100644 node_modules/node-gyp/node_modules/rimraf/LICENSE create mode 100644 node_modules/node-gyp/node_modules/rimraf/README.md create mode 100755 node_modules/node-gyp/node_modules/rimraf/bin.js create mode 100644 node_modules/node-gyp/node_modules/rimraf/package.json create mode 100644 node_modules/node-gyp/node_modules/rimraf/rimraf.js create mode 100644 node_modules/rimraf/CHANGELOG.md diff --git a/node_modules/node-gyp/node_modules/.bin/rimraf b/node_modules/node-gyp/node_modules/.bin/rimraf new file mode 120000 index 0000000000000..4cd49a49ddfc1 --- /dev/null +++ b/node_modules/node-gyp/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/node-gyp/node_modules/rimraf/LICENSE b/node_modules/node-gyp/node_modules/rimraf/LICENSE new file mode 100644 index 0000000000000..19129e315fe59 --- /dev/null +++ b/node_modules/node-gyp/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/node-gyp/node_modules/rimraf/README.md b/node_modules/node-gyp/node_modules/rimraf/README.md new file mode 100644 index 0000000000000..423b8cf854ad3 --- /dev/null +++ b/node_modules/node-gyp/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/node-gyp/node_modules/rimraf/bin.js b/node_modules/node-gyp/node_modules/rimraf/bin.js new file mode 100755 index 0000000000000..0d1e17be701ec --- /dev/null +++ b/node_modules/node-gyp/node_modules/rimraf/bin.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var noglob = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}) + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + var options = {} + if (noglob) + options = { glob: false } + rimraf(args[n], options, function (er) { + if (er) + throw er + go(n+1) + }) +} diff --git a/node_modules/node-gyp/node_modules/rimraf/package.json b/node_modules/node-gyp/node_modules/rimraf/package.json new file mode 100644 index 0000000000000..26e05d85ea2fd --- /dev/null +++ b/node_modules/node-gyp/node_modules/rimraf/package.json @@ -0,0 +1,29 @@ +{ + "name": "rimraf", + "version": "2.7.1", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": "git://github.com/isaacs/rimraf.git", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags", + "test": "tap test/*.js" + }, + "bin": "./bin.js", + "dependencies": { + "glob": "^7.1.3" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + } +} diff --git a/node_modules/node-gyp/node_modules/rimraf/rimraf.js b/node_modules/node-gyp/node_modules/rimraf/rimraf.js new file mode 100644 index 0000000000000..a90ad029f3ece --- /dev/null +++ b/node_modules/node-gyp/node_modules/rimraf/rimraf.js @@ -0,0 +1,372 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var assert = require("assert") +var path = require("path") +var fs = require("fs") +var glob = undefined +try { + glob = require("glob") +} catch (_err) { + // treat glob as optional. +} +var _0666 = parseInt('666', 8) + +var defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +var timeout = 0 + +var isWindows = (process.platform === "win32") + +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + if (options.disableGlob !== true && glob === undefined) { + throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + var busyTries = 0 + var errState = null + var n = 0 + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, function (er, stat) { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + + function next (er) { + errState = errState || er + if (--n === 0) + cb(errState) + } + + function afterGlob (er, results) { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(function (p) { + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + }) + }) + } +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, function (er, st) { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, _0666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, _0666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + var results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (var i = 0; i < results.length; i++) { + var p = results[i] + + try { + var st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + var retries = isWindows ? 100 : 1 + var i = 0 + do { + var threw = true + try { + var ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} diff --git a/node_modules/rimraf/CHANGELOG.md b/node_modules/rimraf/CHANGELOG.md new file mode 100644 index 0000000000000..f116f1414d76d --- /dev/null +++ b/node_modules/rimraf/CHANGELOG.md @@ -0,0 +1,65 @@ +# v3.0 + +- Add `--preserve-root` option to executable (default true) +- Drop support for Node.js below version 6 + +# v2.7 + +- Make `glob` an optional dependency + +# 2.6 + +- Retry on EBUSY on non-windows platforms as well +- Make `rimraf.sync` 10000% more reliable on Windows + +# 2.5 + +- Handle Windows EPERM when lstat-ing read-only dirs +- Add glob option to pass options to glob + +# 2.4 + +- Add EPERM to delay/retry loop +- Add `disableGlob` option + +# 2.3 + +- Make maxBusyTries and emfileWait configurable +- Handle weird SunOS unlink-dir issue +- Glob the CLI arg for better Windows support + +# 2.2 + +- Handle ENOENT properly on Windows +- Allow overriding fs methods +- Treat EPERM as indicative of non-empty dir +- Remove optional graceful-fs dep +- Consistently return null error instead of undefined on success +- win32: Treat ENOTEMPTY the same as EBUSY +- Add `rimraf` binary + +# 2.1 + +- Fix SunOS error code for a non-empty directory +- Try rmdir before readdir +- Treat EISDIR like EPERM +- Remove chmod +- Remove lstat polyfill, node 0.7 is not supported + +# 2.0 + +- Fix myGid call to check process.getgid +- Simplify the EBUSY backoff logic. +- Use fs.lstat in node >= 0.7.9 +- Remove gently option +- remove fiber implementation +- Delete files that are marked read-only + +# 1.0 + +- Allow ENOENT in sync method +- Throw when no callback is provided +- Make opts.gently an absolute path +- use 'stat' if 'lstat' is not available +- Consistent error naming, and rethrow non-ENOENT stat errors +- add fiber implementation diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js index 0d1e17be701ec..023814cc93e84 100755 --- a/node_modules/rimraf/bin.js +++ b/node_modules/rimraf/bin.js @@ -1,11 +1,24 @@ #!/usr/bin/env node -var rimraf = require('./') +const rimraf = require('./') -var help = false -var dashdash = false -var noglob = false -var args = process.argv.slice(2).filter(function(arg) { +const path = require('path') + +const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) +const filterOutRoot = arg => { + const ok = preserveRoot === false || !isRoot(arg) + if (!ok) { + console.error(`refusing to remove ${arg}`) + console.error('Set --no-preserve-root to allow this') + } + return ok +} + +let help = false +let dashdash = false +let noglob = false +let preserveRoot = true +const args = process.argv.slice(2).filter(arg => { if (dashdash) return !!arg else if (arg === '--') @@ -16,35 +29,40 @@ var args = process.argv.slice(2).filter(function(arg) { noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true + else if (arg === '--preserve-root') + preserveRoot = true + else if (arg === '--no-preserve-root') + preserveRoot = false else return !!arg -}) +}).filter(arg => !preserveRoot || filterOutRoot(arg)) + +const go = n => { + if (n >= args.length) + return + const options = noglob ? { glob: false } : {} + rimraf(args[n], options, er => { + if (er) + throw er + go(n+1) + }) +} if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" - var log = help ? console.log : console.error + const log = help ? console.log : console.error log('Usage: rimraf [ ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + log(' --preserve-root Do not remove \'/\' (default)') + log(' --no-preserve-root Do not treat \'/\' specially') + log(' -- Stop parsing flags') process.exit(help ? 0 : 1) } else go(0) - -function go (n) { - if (n >= args.length) - return - var options = {} - if (noglob) - options = { glob: false } - rimraf(args[n], options, function (er) { - if (er) - throw er - go(n+1) - }) -} diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json index 26e05d85ea2fd..1bf8d5e38775d 100644 --- a/node_modules/rimraf/package.json +++ b/node_modules/rimraf/package.json @@ -1,6 +1,6 @@ { "name": "rimraf", - "version": "2.7.1", + "version": "3.0.2", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", @@ -9,7 +9,7 @@ "scripts": { "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags", + "postpublish": "git push origin --follow-tags", "test": "tap test/*.js" }, "bin": "./bin.js", @@ -25,5 +25,8 @@ "devDependencies": { "mkdirp": "^0.5.1", "tap": "^12.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } } diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js index a90ad029f3ece..34da4171d7559 100644 --- a/node_modules/rimraf/rimraf.js +++ b/node_modules/rimraf/rimraf.js @@ -1,29 +1,25 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var assert = require("assert") -var path = require("path") -var fs = require("fs") -var glob = undefined +const assert = require("assert") +const path = require("path") +const fs = require("fs") +let glob = undefined try { glob = require("glob") } catch (_err) { // treat glob as optional. } -var _0666 = parseInt('666', 8) -var defaultGlobOpts = { +const defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling -var timeout = 0 +let timeout = 0 -var isWindows = (process.platform === "win32") +const isWindows = (process.platform === "win32") -function defaults (options) { - var methods = [ +const defaults = options => { + const methods = [ 'unlink', 'chmod', 'stat', @@ -31,7 +27,7 @@ function defaults (options) { 'rmdir', 'readdir' ] - methods.forEach(function(m) { + methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] @@ -49,7 +45,7 @@ function defaults (options) { options.glob = options.glob || defaultGlobOpts } -function rimraf (p, options, cb) { +const rimraf = (p, options, cb) => { if (typeof options === 'function') { cb = options options = {} @@ -63,27 +59,17 @@ function rimraf (p, options, cb) { defaults(options) - var busyTries = 0 - var errState = null - var n = 0 - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, function (er, stat) { - if (!er) - return afterGlob(null, [p]) + let busyTries = 0 + let errState = null + let n = 0 - glob(p, options.glob, afterGlob) - }) - - function next (er) { + const next = (er) => { errState = errState || er if (--n === 0) cb(errState) } - function afterGlob (er, results) { + const afterGlob = (er, results) => { if (er) return cb(er) @@ -91,24 +77,19 @@ function rimraf (p, options, cb) { if (n === 0) return cb() - results.forEach(function (p) { - rimraf_(p, options, function CB (er) { + results.forEach(p => { + const CB = (er) => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ - var time = busyTries * 100 // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, options, CB) - }, time) + return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(function () { - rimraf_(p, options, CB) - }, timeout ++) + return setTimeout(() => rimraf_(p, options, CB), timeout ++) } // already gone @@ -117,9 +98,21 @@ function rimraf (p, options, cb) { timeout = 0 next(er) - }) + } + rimraf_(p, options, CB) }) } + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, (er, stat) => { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + } // Two possible strategies. @@ -133,14 +126,14 @@ function rimraf (p, options, cb) { // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { +const rimraf_ = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. - options.lstat(p, function (er, st) { + options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null) @@ -151,7 +144,7 @@ function rimraf_ (p, options, cb) { if (st && st.isDirectory()) return rmdir(p, options, er, cb) - options.unlink(p, function (er) { + options.unlink(p, er => { if (er) { if (er.code === "ENOENT") return cb(null) @@ -167,18 +160,16 @@ function rimraf_ (p, options, cb) { }) } -function fixWinEPERM (p, options, er, cb) { +const fixWinEPERM = (p, options, er, cb) => { assert(p) assert(options) assert(typeof cb === 'function') - if (er) - assert(er instanceof Error) - options.chmod(p, _0666, function (er2) { + options.chmod(p, 0o666, er2 => { if (er2) cb(er2.code === "ENOENT" ? null : er) else - options.stat(p, function(er3, stats) { + options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) @@ -189,14 +180,12 @@ function fixWinEPERM (p, options, er, cb) { }) } -function fixWinEPERMSync (p, options, er) { +const fixWinEPERMSync = (p, options, er) => { assert(p) assert(options) - if (er) - assert(er instanceof Error) try { - options.chmodSync(p, _0666) + options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === "ENOENT") return @@ -204,8 +193,9 @@ function fixWinEPERMSync (p, options, er) { throw er } + let stats try { - var stats = options.statSync(p) + stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return @@ -219,17 +209,15 @@ function fixWinEPERMSync (p, options, er) { options.unlinkSync(p) } -function rmdir (p, options, originalEr, cb) { +const rmdir = (p, options, originalEr, cb) => { assert(p) assert(options) - if (originalEr) - assert(originalEr instanceof Error) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. - options.rmdir(p, function (er) { + options.rmdir(p, er => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") @@ -239,20 +227,20 @@ function rmdir (p, options, originalEr, cb) { }) } -function rmkids(p, options, cb) { +const rmkids = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') - options.readdir(p, function (er, files) { + options.readdir(p, (er, files) => { if (er) return cb(er) - var n = files.length + let n = files.length if (n === 0) return options.rmdir(p, cb) - var errState - files.forEach(function (f) { - rimraf(path.join(p, f), options, function (er) { + let errState + files.forEach(f => { + rimraf(path.join(p, f), options, er => { if (errState) return if (er) @@ -267,7 +255,7 @@ function rmkids(p, options, cb) { // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. -function rimrafSync (p, options) { +const rimrafSync = (p, options) => { options = options || {} defaults(options) @@ -276,7 +264,7 @@ function rimrafSync (p, options) { assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') - var results + let results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] @@ -292,11 +280,12 @@ function rimrafSync (p, options) { if (!results.length) return - for (var i = 0; i < results.length; i++) { - var p = results[i] + for (let i = 0; i < results.length; i++) { + const p = results[i] + let st try { - var st = options.lstatSync(p) + st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return @@ -325,11 +314,9 @@ function rimrafSync (p, options) { } } -function rmdirSync (p, options, originalEr) { +const rmdirSync = (p, options, originalEr) => { assert(p) assert(options) - if (originalEr) - assert(originalEr instanceof Error) try { options.rmdirSync(p) @@ -343,12 +330,10 @@ function rmdirSync (p, options, originalEr) { } } -function rmkidsSync (p, options) { +const rmkidsSync = (p, options) => { assert(p) assert(options) - options.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f), options) - }) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. @@ -356,12 +341,12 @@ function rmkidsSync (p, options) { // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. - var retries = isWindows ? 100 : 1 - var i = 0 + const retries = isWindows ? 100 : 1 + let i = 0 do { - var threw = true + let threw = true try { - var ret = options.rmdirSync(p, options) + const ret = options.rmdirSync(p, options) threw = false return ret } finally { @@ -370,3 +355,6 @@ function rmkidsSync (p, options) { } } while (true) } + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/package-lock.json b/package-lock.json index 9c3882d06be18..5b0c37f4a0eb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -148,7 +148,7 @@ "read-package-json": "^2.1.2", "read-package-json-fast": "^1.2.1", "retry": "^0.12.0", - "rimraf": "^2.6.3", + "rimraf": "^3.0.2", "semver": "^7.3.2", "sha": "^3.0.0", "slide": "~1.1.6", @@ -3191,6 +3191,18 @@ "node": ">=4" } }, + "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/istanbul-lib-processinfo/node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -3284,6 +3296,18 @@ "node": ">=6" } }, + "node_modules/istanbul-lib-source-maps/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -4053,6 +4077,18 @@ "nopt": "bin/nopt.js" } }, + "node_modules/node-gyp/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "inBundle": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -4385,6 +4421,18 @@ "node": ">=6" } }, + "node_modules/nyc/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -5187,15 +5235,18 @@ } }, "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "inBundle": true, "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/run-parallel": { @@ -5438,6 +5489,18 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/spawn-wrap/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/spawn-wrap/node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -7429,6 +7492,18 @@ "node": ">=8" } }, + "node_modules/tap/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/tap/node_modules/scheduler": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.18.0.tgz", @@ -11062,6 +11137,15 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -11135,6 +11219,15 @@ "source-map": "^0.6.1" }, "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11715,6 +11808,14 @@ "abbrev": "1", "osenv": "^0.1.4" } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } } } }, @@ -11969,6 +12070,15 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } } } }, @@ -12572,9 +12682,9 @@ "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" }, "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { "glob": "^7.1.3" } @@ -12757,6 +12867,15 @@ "minimist": "^1.2.5" } }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -14255,6 +14374,15 @@ "signal-exit": "^3.0.2" } }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "scheduler": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.18.0.tgz", diff --git a/package.json b/package.json index 550c485af4e39..61e156526b524 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "read-package-json": "^2.1.2", "read-package-json-fast": "^1.2.1", "retry": "^0.12.0", - "rimraf": "^2.6.3", + "rimraf": "^3.0.2", "semver": "^7.3.2", "sha": "^3.0.0", "slide": "~1.1.6", From 8ec84d9f691686da67bd14c2728472c94ab3b955 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:00:17 -0400 Subject: [PATCH 11/39] chore: removed unused tacks dev-dep --- node_modules/.gitignore | 1 - package-lock.json | 350 ---------------------------------------- package.json | 1 - 3 files changed, 352 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 5c859281bbf1b..3d8cd602eb1dd 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -213,7 +213,6 @@ package-lock.json /strip-bom /strip-json-comments /table -/tacks /tap /tap-mocha-reporter /tap-parser diff --git a/package-lock.json b/package-lock.json index 5b0c37f4a0eb9..aaeab5187660a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -181,7 +181,6 @@ "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", - "tacks": "^1.3.0", "tap": "^14.10.8" }, "engines": { @@ -5809,199 +5808,6 @@ "node": ">=6" } }, - "node_modules/tacks": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tacks/-/tacks-1.3.0.tgz", - "integrity": "sha512-jpQhdKlYom3cohYmjSYqny9Ie8QJr6OYe4wdyu/nEgfiIQpOvLwq72vCRucg9+jUlnspnKvL5HASnmkxOf3DXQ==", - "bundleDependencies": [ - "@iarna/cli", - "mkdirp", - "rimraf" - ], - "dev": true, - "dependencies": { - "@iarna/cli": "^2.0.0", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.2" - }, - "bin": { - "tacks": "cmdline.js" - } - }, - "node_modules/tacks/node_modules/@iarna/cli": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@iarna/cli/-/cli-2.0.0.tgz", - "integrity": "sha512-kfewtgihDKSQVEjn19fXAc7UoomcZ2lm7wNbN22BFRURn5muid79OXUquqdtAdnaulrckZLEObXiYT76ZT1naA==", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "signal-exit": "^3.0.2" - } - }, - "node_modules/tacks/node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/tacks/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/tacks/node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/tacks/node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/tacks/node_modules/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tacks/node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/tacks/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/tacks/node_modules/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tacks/node_modules/minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/tacks/node_modules/mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "minimist": "0.0.8" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/tacks/node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/tacks/node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tacks/node_modules/rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "glob": "^7.0.5" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/tacks/node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/tacks/node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "inBundle": true, - "license": "ISC" - }, "node_modules/tap": { "version": "14.10.8", "resolved": "https://registry.npmjs.org/tap/-/tap-14.10.8.tgz", @@ -13118,162 +12924,6 @@ } } }, - "tacks": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tacks/-/tacks-1.3.0.tgz", - "integrity": "sha512-jpQhdKlYom3cohYmjSYqny9Ie8QJr6OYe4wdyu/nEgfiIQpOvLwq72vCRucg9+jUlnspnKvL5HASnmkxOf3DXQ==", - "dev": true, - "requires": { - "@iarna/cli": "^2.0.0", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.2" - }, - "dependencies": { - "@iarna/cli": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@iarna/cli/-/cli-2.0.0.tgz", - "integrity": "sha512-kfewtgihDKSQVEjn19fXAc7UoomcZ2lm7wNbN22BFRURn5muid79OXUquqdtAdnaulrckZLEObXiYT76ZT1naA==", - "bundled": true, - "dev": true, - "requires": { - "signal-exit": "^3.0.2" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "bundled": true, - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "bundled": true, - "dev": true - }, - "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.0.0" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "bundled": true, - "dev": true - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "bundled": true, - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "bundled": true, - "dev": true - } - } - }, "tap": { "version": "14.10.8", "resolved": "https://registry.npmjs.org/tap/-/tap-14.10.8.tgz", diff --git a/package.json b/package.json index 61e156526b524..4807c92035053 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,6 @@ "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", - "tacks": "^1.3.0", "tap": "^14.10.8" }, "scripts": { From a2b8fd3c153ecca55cb2d60654fff207688532ab Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:05:05 -0400 Subject: [PATCH 12/39] uuid@8.3.0 --- lib/utils/metrics.js | 4 +- node_modules/request/node_modules/.bin/uuid | 1 + .../{ => request/node_modules}/uuid/AUTHORS | 0 .../request/node_modules/uuid/CHANGELOG.md | 119 +++++ .../request/node_modules/uuid/LICENSE.md | 21 + .../request/node_modules/uuid/README.md | 276 ++++++++++ .../{ => request/node_modules}/uuid/bin/uuid | 0 .../{ => request/node_modules}/uuid/index.js | 0 .../node_modules}/uuid/lib/bytesToUuid.js | 0 .../node_modules}/uuid/lib/md5-browser.js | 0 .../node_modules}/uuid/lib/md5.js | 0 .../node_modules}/uuid/lib/rng-browser.js | 0 .../node_modules}/uuid/lib/rng.js | 0 .../node_modules}/uuid/lib/sha1-browser.js | 0 .../node_modules}/uuid/lib/sha1.js | 0 .../node_modules}/uuid/lib/v35.js | 0 .../request/node_modules/uuid/package.json | 49 ++ .../{ => request/node_modules}/uuid/v1.js | 0 .../{ => request/node_modules}/uuid/v3.js | 0 .../{ => request/node_modules}/uuid/v4.js | 0 .../{ => request/node_modules}/uuid/v5.js | 0 node_modules/uuid/CHANGELOG.md | 186 +++++-- node_modules/uuid/CONTRIBUTING.md | 18 + node_modules/uuid/LICENSE.md | 20 +- node_modules/uuid/README.md | 499 ++++++++++++------ node_modules/uuid/dist/bin/uuid | 2 + node_modules/uuid/dist/esm-browser/index.js | 9 + node_modules/uuid/dist/esm-browser/md5.js | 215 ++++++++ node_modules/uuid/dist/esm-browser/nil.js | 1 + node_modules/uuid/dist/esm-browser/parse.js | 35 ++ node_modules/uuid/dist/esm-browser/regex.js | 1 + node_modules/uuid/dist/esm-browser/rng.js | 14 + node_modules/uuid/dist/esm-browser/sha1.js | 96 ++++ .../uuid/dist/esm-browser/stringify.js | 30 ++ node_modules/uuid/dist/esm-browser/v1.js | 95 ++++ node_modules/uuid/dist/esm-browser/v3.js | 4 + node_modules/uuid/dist/esm-browser/v35.js | 64 +++ node_modules/uuid/dist/esm-browser/v4.js | 24 + node_modules/uuid/dist/esm-browser/v5.js | 4 + .../uuid/dist/esm-browser/validate.js | 7 + node_modules/uuid/dist/esm-browser/version.js | 11 + node_modules/uuid/dist/esm-node/index.js | 9 + node_modules/uuid/dist/esm-node/md5.js | 13 + node_modules/uuid/dist/esm-node/nil.js | 1 + node_modules/uuid/dist/esm-node/parse.js | 35 ++ node_modules/uuid/dist/esm-node/regex.js | 1 + node_modules/uuid/dist/esm-node/rng.js | 5 + node_modules/uuid/dist/esm-node/sha1.js | 13 + node_modules/uuid/dist/esm-node/stringify.js | 29 + node_modules/uuid/dist/esm-node/v1.js | 95 ++++ node_modules/uuid/dist/esm-node/v3.js | 4 + node_modules/uuid/dist/esm-node/v35.js | 64 +++ node_modules/uuid/dist/esm-node/v4.js | 24 + node_modules/uuid/dist/esm-node/v5.js | 4 + node_modules/uuid/dist/esm-node/validate.js | 7 + node_modules/uuid/dist/esm-node/version.js | 11 + node_modules/uuid/dist/index.js | 79 +++ node_modules/uuid/dist/md5-browser.js | 223 ++++++++ node_modules/uuid/dist/md5.js | 23 + node_modules/uuid/dist/nil.js | 8 + node_modules/uuid/dist/parse.js | 45 ++ node_modules/uuid/dist/regex.js | 8 + node_modules/uuid/dist/rng-browser.js | 21 + node_modules/uuid/dist/rng.js | 16 + node_modules/uuid/dist/sha1-browser.js | 104 ++++ node_modules/uuid/dist/sha1.js | 23 + node_modules/uuid/dist/stringify.js | 39 ++ node_modules/uuid/dist/umd/uuid.min.js | 1 + node_modules/uuid/dist/umd/uuidNIL.min.js | 1 + node_modules/uuid/dist/umd/uuidParse.min.js | 1 + .../uuid/dist/umd/uuidStringify.min.js | 1 + .../uuid/dist/umd/uuidValidate.min.js | 1 + node_modules/uuid/dist/umd/uuidVersion.min.js | 1 + node_modules/uuid/dist/umd/uuidv1.min.js | 1 + node_modules/uuid/dist/umd/uuidv3.min.js | 1 + node_modules/uuid/dist/umd/uuidv4.min.js | 1 + node_modules/uuid/dist/umd/uuidv5.min.js | 1 + node_modules/uuid/dist/uuid-bin.js | 85 +++ node_modules/uuid/dist/v1.js | 107 ++++ node_modules/uuid/dist/v3.js | 16 + node_modules/uuid/dist/v35.js | 78 +++ node_modules/uuid/dist/v4.js | 37 ++ node_modules/uuid/dist/v5.js | 16 + node_modules/uuid/dist/validate.js | 17 + node_modules/uuid/dist/version.js | 21 + node_modules/uuid/package.json | 121 ++++- node_modules/uuid/wrapper.mjs | 10 + package-lock.json | 60 ++- package.json | 2 +- 89 files changed, 3042 insertions(+), 247 deletions(-) create mode 120000 node_modules/request/node_modules/.bin/uuid rename node_modules/{ => request/node_modules}/uuid/AUTHORS (100%) create mode 100644 node_modules/request/node_modules/uuid/CHANGELOG.md create mode 100644 node_modules/request/node_modules/uuid/LICENSE.md create mode 100644 node_modules/request/node_modules/uuid/README.md rename node_modules/{ => request/node_modules}/uuid/bin/uuid (100%) rename node_modules/{ => request/node_modules}/uuid/index.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/bytesToUuid.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/md5-browser.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/md5.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/rng-browser.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/rng.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/sha1-browser.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/sha1.js (100%) rename node_modules/{ => request/node_modules}/uuid/lib/v35.js (100%) create mode 100644 node_modules/request/node_modules/uuid/package.json rename node_modules/{ => request/node_modules}/uuid/v1.js (100%) rename node_modules/{ => request/node_modules}/uuid/v3.js (100%) rename node_modules/{ => request/node_modules}/uuid/v4.js (100%) rename node_modules/{ => request/node_modules}/uuid/v5.js (100%) create mode 100644 node_modules/uuid/CONTRIBUTING.md create mode 100755 node_modules/uuid/dist/bin/uuid create mode 100644 node_modules/uuid/dist/esm-browser/index.js create mode 100644 node_modules/uuid/dist/esm-browser/md5.js create mode 100644 node_modules/uuid/dist/esm-browser/nil.js create mode 100644 node_modules/uuid/dist/esm-browser/parse.js create mode 100644 node_modules/uuid/dist/esm-browser/regex.js create mode 100644 node_modules/uuid/dist/esm-browser/rng.js create mode 100644 node_modules/uuid/dist/esm-browser/sha1.js create mode 100644 node_modules/uuid/dist/esm-browser/stringify.js create mode 100644 node_modules/uuid/dist/esm-browser/v1.js create mode 100644 node_modules/uuid/dist/esm-browser/v3.js create mode 100644 node_modules/uuid/dist/esm-browser/v35.js create mode 100644 node_modules/uuid/dist/esm-browser/v4.js create mode 100644 node_modules/uuid/dist/esm-browser/v5.js create mode 100644 node_modules/uuid/dist/esm-browser/validate.js create mode 100644 node_modules/uuid/dist/esm-browser/version.js create mode 100644 node_modules/uuid/dist/esm-node/index.js create mode 100644 node_modules/uuid/dist/esm-node/md5.js create mode 100644 node_modules/uuid/dist/esm-node/nil.js create mode 100644 node_modules/uuid/dist/esm-node/parse.js create mode 100644 node_modules/uuid/dist/esm-node/regex.js create mode 100644 node_modules/uuid/dist/esm-node/rng.js create mode 100644 node_modules/uuid/dist/esm-node/sha1.js create mode 100644 node_modules/uuid/dist/esm-node/stringify.js create mode 100644 node_modules/uuid/dist/esm-node/v1.js create mode 100644 node_modules/uuid/dist/esm-node/v3.js create mode 100644 node_modules/uuid/dist/esm-node/v35.js create mode 100644 node_modules/uuid/dist/esm-node/v4.js create mode 100644 node_modules/uuid/dist/esm-node/v5.js create mode 100644 node_modules/uuid/dist/esm-node/validate.js create mode 100644 node_modules/uuid/dist/esm-node/version.js create mode 100644 node_modules/uuid/dist/index.js create mode 100644 node_modules/uuid/dist/md5-browser.js create mode 100644 node_modules/uuid/dist/md5.js create mode 100644 node_modules/uuid/dist/nil.js create mode 100644 node_modules/uuid/dist/parse.js create mode 100644 node_modules/uuid/dist/regex.js create mode 100644 node_modules/uuid/dist/rng-browser.js create mode 100644 node_modules/uuid/dist/rng.js create mode 100644 node_modules/uuid/dist/sha1-browser.js create mode 100644 node_modules/uuid/dist/sha1.js create mode 100644 node_modules/uuid/dist/stringify.js create mode 100644 node_modules/uuid/dist/umd/uuid.min.js create mode 100644 node_modules/uuid/dist/umd/uuidNIL.min.js create mode 100644 node_modules/uuid/dist/umd/uuidParse.min.js create mode 100644 node_modules/uuid/dist/umd/uuidStringify.min.js create mode 100644 node_modules/uuid/dist/umd/uuidValidate.min.js create mode 100644 node_modules/uuid/dist/umd/uuidVersion.min.js create mode 100644 node_modules/uuid/dist/umd/uuidv1.min.js create mode 100644 node_modules/uuid/dist/umd/uuidv3.min.js create mode 100644 node_modules/uuid/dist/umd/uuidv4.min.js create mode 100644 node_modules/uuid/dist/umd/uuidv5.min.js create mode 100644 node_modules/uuid/dist/uuid-bin.js create mode 100644 node_modules/uuid/dist/v1.js create mode 100644 node_modules/uuid/dist/v3.js create mode 100644 node_modules/uuid/dist/v35.js create mode 100644 node_modules/uuid/dist/v4.js create mode 100644 node_modules/uuid/dist/v5.js create mode 100644 node_modules/uuid/dist/validate.js create mode 100644 node_modules/uuid/dist/version.js create mode 100644 node_modules/uuid/wrapper.mjs diff --git a/lib/utils/metrics.js b/lib/utils/metrics.js index c014105834c65..d1f5e5586e575 100644 --- a/lib/utils/metrics.js +++ b/lib/utils/metrics.js @@ -8,7 +8,7 @@ const fs = require('fs') const path = require('path') const npm = require('../npm.js') const regFetch = require('npm-registry-fetch') -const uuid = require('uuid') +const { v4: uuidv4 } = require('uuid') const cacheFile = require('./cache-file.js') let inMetrics = false @@ -42,7 +42,7 @@ function saveMetrics (itWorked) { } } catch (ex) { metrics = { - metricId: uuid.v4(), + metricId: uuidv4(), metrics: { from: new Date().toISOString(), to: new Date().toISOString(), diff --git a/node_modules/request/node_modules/.bin/uuid b/node_modules/request/node_modules/.bin/uuid new file mode 120000 index 0000000000000..b3e45bc53127d --- /dev/null +++ b/node_modules/request/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/uuid/AUTHORS b/node_modules/request/node_modules/uuid/AUTHORS similarity index 100% rename from node_modules/uuid/AUTHORS rename to node_modules/request/node_modules/uuid/AUTHORS diff --git a/node_modules/request/node_modules/uuid/CHANGELOG.md b/node_modules/request/node_modules/uuid/CHANGELOG.md new file mode 100644 index 0000000000000..f811b8a0cb91c --- /dev/null +++ b/node_modules/request/node_modules/uuid/CHANGELOG.md @@ -0,0 +1,119 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) + + +### Features + +* rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) + +### [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) + + +## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) + + +### Bug Fixes + +* typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) + + + + +## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) + + +### Bug Fixes + +* fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) + + + + +# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) + + +### Bug Fixes + +* assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) +* fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) +* Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) +* mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) + +### Features + +* enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) + + + +## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) + + +### Bug Fixes + +* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) + + + + +# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) + + +### Bug Fixes + +* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) +* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) + + +### Features + +* Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) + + +# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17) + +### Bug Fixes + +* (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) +* Fix typo (#178) +* Simple typo fix (#165) + +### Features +* v5 support in CLI (#197) +* V5 support (#188) + + +# 3.0.1 (2016-11-28) + +* split uuid versions into separate files + + +# 3.0.0 (2016-11-17) + +* remove .parse and .unparse + + +# 2.0.0 + +* Removed uuid.BufferClass + + +# 1.4.0 + +* Improved module context detection +* Removed public RNG functions + + +# 1.3.2 + +* Improve tests and handling of v1() options (Issue #24) +* Expose RNG option to allow for perf testing with different generators + + +# 1.3.0 + +* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! +* Support for node.js crypto API +* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/request/node_modules/uuid/LICENSE.md b/node_modules/request/node_modules/uuid/LICENSE.md new file mode 100644 index 0000000000000..8c84e398668b7 --- /dev/null +++ b/node_modules/request/node_modules/uuid/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010-2016 Robert Kieffer and other contributors + +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/request/node_modules/uuid/README.md b/node_modules/request/node_modules/uuid/README.md new file mode 100644 index 0000000000000..1752e4751fc92 --- /dev/null +++ b/node_modules/request/node_modules/uuid/README.md @@ -0,0 +1,276 @@ + + +# uuid [![Build Status](https://secure.travis-ci.org/kelektiv/node-uuid.svg?branch=master)](http://travis-ci.org/kelektiv/node-uuid) # + +Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. + +Features: + +* Support for version 1, 3, 4 and 5 UUIDs +* Cross-platform +* Uses cryptographically-strong random number APIs (when available) +* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883)) + +[**Deprecation warning**: The use of `require('uuid')` is deprecated and will not be +supported after version 3.x of this module. Instead, use `require('uuid/[v1|v3|v4|v5]')` as shown in the examples below.] + +## Quickstart - CommonJS (Recommended) + +```shell +npm install uuid +``` + +Then generate your uuid version of choice ... + +Version 1 (timestamp): + +```javascript +const uuidv1 = require('uuid/v1'); +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' + +``` + +Version 3 (namespace): + +```javascript +const uuidv3 = require('uuid/v3'); + +// ... using predefined DNS namespace (for domain names) +uuidv3('hello.example.com', uuidv3.DNS); // ⇨ '9125a8dc-52ee-365b-a5aa-81b0b3681cf6' + +// ... using predefined URL namespace (for, well, URLs) +uuidv3('http://example.com/hello', uuidv3.URL); // ⇨ 'c6235813-3ba4-3801-ae84-e0a6ebb7d138' + +// ... using a custom namespace +// +// Note: Custom namespaces should be a UUID string specific to your application! +// E.g. the one here was generated using this modules `uuid` CLI. +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; +uuidv3('Hello, World!', MY_NAMESPACE); // ⇨ 'e8b5a51d-11c8-3310-a6ab-367563f20686' + +``` + +Version 4 (random): + +```javascript +const uuidv4 = require('uuid/v4'); +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' + +``` + +Version 5 (namespace): + +```javascript +const uuidv5 = require('uuid/v5'); + +// ... using predefined DNS namespace (for domain names) +uuidv5('hello.example.com', uuidv5.DNS); // ⇨ 'fdda765f-fc57-5604-a269-52a7df8164ec' + +// ... using predefined URL namespace (for, well, URLs) +uuidv5('http://example.com/hello', uuidv5.URL); // ⇨ '3bbcee75-cecc-5b56-8031-b6641c1ed1f1' + +// ... using a custom namespace +// +// Note: Custom namespaces should be a UUID string specific to your application! +// E.g. the one here was generated using this modules `uuid` CLI. +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' + +``` + +## API + +### Version 1 + +```javascript +const uuidv1 = require('uuid/v1'); + +// Incantations +uuidv1(); +uuidv1(options); +uuidv1(options, buffer, offset); +``` + +Generate and return a RFC4122 v1 (timestamp-based) UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + + * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. + * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. + * `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used. + * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. + +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. + +Example: Generate string UUID with fully-specified options + +```javascript +const v1options = { + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678 +}; +uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' + +``` + +Example: In-place generation of two binary IDs + +```javascript +// Generate two ids in an array +const arr = new Array(); +uuidv1(null, arr, 0); // ⇨ + // [ + // 44, 94, 164, 192, 64, 103, + // 17, 233, 146, 52, 155, 29, + // 235, 77, 59, 125 + // ] +uuidv1(null, arr, 16); // ⇨ + // [ + // 44, 94, 164, 192, 64, 103, 17, 233, + // 146, 52, 155, 29, 235, 77, 59, 125, + // 44, 94, 164, 193, 64, 103, 17, 233, + // 146, 52, 155, 29, 235, 77, 59, 125 + // ] + +``` + +### Version 3 + +```javascript +const uuidv3 = require('uuid/v3'); + +// Incantations +uuidv3(name, namespace); +uuidv3(name, namespace, buffer); +uuidv3(name, namespace, buffer, offset); +``` + +Generate and return a RFC4122 v3 UUID. + +* `name` - (String | Array[]) "name" to create UUID with +* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: + +```javascript +uuidv3('hello world', MY_NAMESPACE); // ⇨ '042ffd34-d989-321c-ad06-f60826172424' + +``` + +### Version 4 + +```javascript +const uuidv4 = require('uuid/v4') + +// Incantations +uuidv4(); +uuidv4(options); +uuidv4(options, buffer, offset); +``` + +Generate and return a RFC4122 v4 UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values + * `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255) +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: Generate string UUID with predefined `random` values + +```javascript +const v4options = { + random: [ + 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, + 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 + ] +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' + +``` + +Example: Generate two IDs in a single buffer + +```javascript +const buffer = new Array(); +uuidv4(null, buffer, 0); // ⇨ + // [ + // 155, 29, 235, 77, 59, + // 125, 75, 173, 155, 221, + // 43, 13, 123, 61, 203, + // 109 + // ] +uuidv4(null, buffer, 16); // ⇨ + // [ + // 155, 29, 235, 77, 59, 125, 75, 173, + // 155, 221, 43, 13, 123, 61, 203, 109, + // 27, 157, 107, 205, 187, 253, 75, 45, + // 155, 93, 171, 141, 251, 189, 75, 237 + // ] + +``` + +### Version 5 + +```javascript +const uuidv5 = require('uuid/v5'); + +// Incantations +uuidv5(name, namespace); +uuidv5(name, namespace, buffer); +uuidv5(name, namespace, buffer, offset); +``` + +Generate and return a RFC4122 v5 UUID. + +* `name` - (String | Array[]) "name" to create UUID with +* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: + +```javascript +uuidv5('hello world', MY_NAMESPACE); // ⇨ '9f282611-e0fd-5650-8953-89c8e342da0b' + +``` + +## Command Line + +UUIDs can be generated from the command line with the `uuid` command. + +```shell +$ uuid +ddeb27fb-d9a0-4624-be4d-4615062daed4 + +$ uuid v1 +02d37060-d446-11e7-a9fa-7bdae751ebe1 +``` + +Type `uuid --help` for usage details + +## Testing + +```shell +npm test +``` + +---- +Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/node_modules/uuid/bin/uuid b/node_modules/request/node_modules/uuid/bin/uuid similarity index 100% rename from node_modules/uuid/bin/uuid rename to node_modules/request/node_modules/uuid/bin/uuid diff --git a/node_modules/uuid/index.js b/node_modules/request/node_modules/uuid/index.js similarity index 100% rename from node_modules/uuid/index.js rename to node_modules/request/node_modules/uuid/index.js diff --git a/node_modules/uuid/lib/bytesToUuid.js b/node_modules/request/node_modules/uuid/lib/bytesToUuid.js similarity index 100% rename from node_modules/uuid/lib/bytesToUuid.js rename to node_modules/request/node_modules/uuid/lib/bytesToUuid.js diff --git a/node_modules/uuid/lib/md5-browser.js b/node_modules/request/node_modules/uuid/lib/md5-browser.js similarity index 100% rename from node_modules/uuid/lib/md5-browser.js rename to node_modules/request/node_modules/uuid/lib/md5-browser.js diff --git a/node_modules/uuid/lib/md5.js b/node_modules/request/node_modules/uuid/lib/md5.js similarity index 100% rename from node_modules/uuid/lib/md5.js rename to node_modules/request/node_modules/uuid/lib/md5.js diff --git a/node_modules/uuid/lib/rng-browser.js b/node_modules/request/node_modules/uuid/lib/rng-browser.js similarity index 100% rename from node_modules/uuid/lib/rng-browser.js rename to node_modules/request/node_modules/uuid/lib/rng-browser.js diff --git a/node_modules/uuid/lib/rng.js b/node_modules/request/node_modules/uuid/lib/rng.js similarity index 100% rename from node_modules/uuid/lib/rng.js rename to node_modules/request/node_modules/uuid/lib/rng.js diff --git a/node_modules/uuid/lib/sha1-browser.js b/node_modules/request/node_modules/uuid/lib/sha1-browser.js similarity index 100% rename from node_modules/uuid/lib/sha1-browser.js rename to node_modules/request/node_modules/uuid/lib/sha1-browser.js diff --git a/node_modules/uuid/lib/sha1.js b/node_modules/request/node_modules/uuid/lib/sha1.js similarity index 100% rename from node_modules/uuid/lib/sha1.js rename to node_modules/request/node_modules/uuid/lib/sha1.js diff --git a/node_modules/uuid/lib/v35.js b/node_modules/request/node_modules/uuid/lib/v35.js similarity index 100% rename from node_modules/uuid/lib/v35.js rename to node_modules/request/node_modules/uuid/lib/v35.js diff --git a/node_modules/request/node_modules/uuid/package.json b/node_modules/request/node_modules/uuid/package.json new file mode 100644 index 0000000000000..efc07b8f6c3f7 --- /dev/null +++ b/node_modules/request/node_modules/uuid/package.json @@ -0,0 +1,49 @@ +{ + "name": "uuid", + "version": "3.4.0", + "description": "RFC4122 (v1, v4, and v5) UUIDs", + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "keywords": [ + "uuid", + "guid", + "rfc4122" + ], + "license": "MIT", + "bin": { + "uuid": "./bin/uuid" + }, + "devDependencies": { + "@commitlint/cli": "~8.2.0", + "@commitlint/config-conventional": "~8.2.0", + "eslint": "~6.4.0", + "husky": "~3.0.5", + "mocha": "6.2.0", + "runmd": "1.2.1", + "standard-version": "7.0.0" + }, + "scripts": { + "lint": "eslint .", + "test": "npm run lint && mocha test/test.js", + "md": "runmd --watch --output=README.md README_js.md", + "release": "standard-version", + "prepare": "runmd --output=README.md README_js.md" + }, + "browser": { + "./lib/rng.js": "./lib/rng-browser.js", + "./lib/sha1.js": "./lib/sha1-browser.js", + "./lib/md5.js": "./lib/md5-browser.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/uuidjs/uuid.git" + }, + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } + } +} diff --git a/node_modules/uuid/v1.js b/node_modules/request/node_modules/uuid/v1.js similarity index 100% rename from node_modules/uuid/v1.js rename to node_modules/request/node_modules/uuid/v1.js diff --git a/node_modules/uuid/v3.js b/node_modules/request/node_modules/uuid/v3.js similarity index 100% rename from node_modules/uuid/v3.js rename to node_modules/request/node_modules/uuid/v3.js diff --git a/node_modules/uuid/v4.js b/node_modules/request/node_modules/uuid/v4.js similarity index 100% rename from node_modules/uuid/v4.js rename to node_modules/request/node_modules/uuid/v4.js diff --git a/node_modules/uuid/v5.js b/node_modules/request/node_modules/uuid/v5.js similarity index 100% rename from node_modules/uuid/v5.js rename to node_modules/request/node_modules/uuid/v5.js diff --git a/node_modules/uuid/CHANGELOG.md b/node_modules/uuid/CHANGELOG.md index f811b8a0cb91c..0a2e0546377d2 100644 --- a/node_modules/uuid/CHANGELOG.md +++ b/node_modules/uuid/CHANGELOG.md @@ -2,118 +2,216 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) +## [8.3.0](https://github.com/uuidjs/uuid/compare/v8.2.0...v8.3.0) (2020-07-27) + +### Features + +- add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4)), closes [#475](https://github.com/uuidjs/uuid/issues/475) [#478](https://github.com/uuidjs/uuid/issues/478) closes [#480](https://github.com/uuidjs/uuid/issues/480) closes [#481](https://github.com/uuidjs/uuid/issues/481) closes [#180](https://github.com/uuidjs/uuid/issues/180) +## [8.2.0](https://github.com/uuidjs/uuid/compare/v8.1.0...v8.2.0) (2020-06-23) ### Features -* rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) +- improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5)) +- remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c)), closes [#437](https://github.com/uuidjs/uuid/issues/437) +- support jspm ([#473](https://github.com/uuidjs/uuid/issues/473)) ([e9f2587](https://github.com/uuidjs/uuid/commit/e9f2587a92575cac31bc1d4ae944e17c09756659)) -### [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) +### Bug Fixes - -## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) +- prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8)) +## [8.1.0](https://github.com/uuidjs/uuid/compare/v8.0.0...v8.1.0) (2020-05-20) + +### Features + +- improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d)) +- optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2)) ### Bug Fixes -* typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) +- export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [/github.com/ai/nanoevents/issues/44#issuecomment-602010343](https://github.com/uuidjs//github.com/ai/nanoevents/issues/44/issues/issuecomment-602010343) [#444](https://github.com/uuidjs/uuid/issues/444) +## [8.0.0](https://github.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) (2020-04-29) +### ⚠ BREAKING CHANGES - -## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) +- For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. + + ```diff + -import uuid from 'uuid'; + -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' + +import { v4 as uuidv4 } from 'uuid'; + +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' + ``` + +- Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. + + Instead use the named exports that this module exports. + + For ECMAScript Modules (ESM): + + ```diff + -import uuidv4 from 'uuid/v4'; + +import { v4 as uuidv4 } from 'uuid'; + uuidv4(); + ``` + For CommonJS: + + ```diff + -const uuidv4 = require('uuid/v4'); + +const { v4: uuidv4 } = require('uuid'); + uuidv4(); + ``` + +### Features + +- native Node.js ES Modules (wrapper approach) ([#423](https://github.com/uuidjs/uuid/issues/423)) ([2d9f590](https://github.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#245](https://github.com/uuidjs/uuid/issues/245) [#419](https://github.com/uuidjs/uuid/issues/419) [#342](https://github.com/uuidjs/uuid/issues/342) +- remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ### Bug Fixes -* fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) +- add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) +### [7.0.3](https://github.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) +### Bug Fixes - -# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) +- make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#408](https://github.com/uuidjs/uuid/issues/408) +### [7.0.2](https://github.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ### Bug Fixes -* assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) -* fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) -* Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) -* mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) +- make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) +- simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) +- update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) + +### [7.0.1](https://github.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) + +### Bug Fixes + +- clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) +- provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#378](https://github.com/uuidjs/uuid/issues/378) + +## [7.0.0](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.0) (2020-02-24) + +### ⚠ BREAKING CHANGES + +- The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed. +- Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants. +- Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function. +- Remove support for generating v3 and v5 UUIDs in Node.js<4.x +- Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers. ### Features -* enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) +- add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c)), closes [#345](https://github.com/uuidjs/uuid/issues/345) +- add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555)) +- ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b)) +- hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0)) +- remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9)), closes [#173](https://github.com/uuidjs/uuid/issues/173) +- remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627)) +- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338) +### Bug Fixes - -## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) +- add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48)) +- add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370) +- deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23)) +## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) + +### Features + +- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) + +## [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) ### Bug Fixes -* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) +- no longer run ci tests on node v4 +- upgrade dependencies +## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) +### Bug Fixes - -# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) +- typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) +## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) ### Bug Fixes -* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) -* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) +- fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) + +# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) +### Bug Fixes + +- assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) +- fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) +- Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) +- mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) ### Features -* Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) +- enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) + +## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) + +### Bug Fixes + +- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) + +# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) + +### Bug Fixes +- remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) +- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) + +### Features + +- Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) # [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17) ### Bug Fixes -* (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) -* Fix typo (#178) -* Simple typo fix (#165) +- (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) +- Fix typo (#178) +- Simple typo fix (#165) ### Features -* v5 support in CLI (#197) -* V5 support (#188) +- v5 support in CLI (#197) +- V5 support (#188) # 3.0.1 (2016-11-28) -* split uuid versions into separate files - +- split uuid versions into separate files # 3.0.0 (2016-11-17) -* remove .parse and .unparse - +- remove .parse and .unparse # 2.0.0 -* Removed uuid.BufferClass - +- Removed uuid.BufferClass # 1.4.0 -* Improved module context detection -* Removed public RNG functions - +- Improved module context detection +- Removed public RNG functions # 1.3.2 -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - +- Improve tests and handling of v1() options (Issue #24) +- Expose RNG option to allow for perf testing with different generators # 1.3.0 -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code +- Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! +- Support for node.js crypto API +- De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/uuid/CONTRIBUTING.md b/node_modules/uuid/CONTRIBUTING.md new file mode 100644 index 0000000000000..4a4503d02ca58 --- /dev/null +++ b/node_modules/uuid/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing + +Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library! + +## Testing + +```shell +npm test +``` + +## Releasing + +Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version): + +```shell +npm run release -- --dry-run # verify output manually +npm run release # follow the instructions from the output of this command +``` diff --git a/node_modules/uuid/LICENSE.md b/node_modules/uuid/LICENSE.md index 8c84e398668b7..3934168364063 100644 --- a/node_modules/uuid/LICENSE.md +++ b/node_modules/uuid/LICENSE.md @@ -1,21 +1,9 @@ The MIT License (MIT) -Copyright (c) 2010-2016 Robert Kieffer and other contributors +Copyright (c) 2010-2020 Robert Kieffer and other contributors -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: +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 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. +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/uuid/README.md b/node_modules/uuid/README.md index 1752e4751fc92..e7410c7e6a5da 100644 --- a/node_modules/uuid/README.md +++ b/node_modules/uuid/README.md @@ -2,275 +2,460 @@ -- This file is auto-generated from README_js.md. Changes should be made there. --> -# uuid [![Build Status](https://secure.travis-ci.org/kelektiv/node-uuid.svg?branch=master)](http://travis-ci.org/kelektiv/node-uuid) # +# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser) -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. +For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs -Features: +- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs +- **Cross-platform** - Support for ... + - CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds) + - Node 8, 10, 12, 14 + - Chrome, Safari, Firefox, Edge, IE 11 browsers + - Webpack and rollup.js module bundlers + - [React Native](#react-native) +- **Secure** - Cryptographically-strong random values +- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers +- **CLI** - Includes the [`uuid` command line](#command-line) utility -* Support for version 1, 3, 4 and 5 UUIDs -* Cross-platform -* Uses cryptographically-strong random number APIs (when available) -* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883)) +**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details. -[**Deprecation warning**: The use of `require('uuid')` is deprecated and will not be -supported after version 3.x of this module. Instead, use `require('uuid/[v1|v3|v4|v5]')` as shown in the examples below.] +## Quickstart -## Quickstart - CommonJS (Recommended) +To create a random UUID... + +**1. Install** ```shell npm install uuid ``` -Then generate your uuid version of choice ... - -Version 1 (timestamp): +**2. Create a UUID** (ES6 module syntax) ```javascript -const uuidv1 = require('uuid/v1'); -uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' - +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` -Version 3 (namespace): +... or using CommonJS syntax: ```javascript -const uuidv3 = require('uuid/v3'); +const { v4: uuidv4 } = require('uuid'); +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` -// ... using predefined DNS namespace (for domain names) -uuidv3('hello.example.com', uuidv3.DNS); // ⇨ '9125a8dc-52ee-365b-a5aa-81b0b3681cf6' +For timestamp UUIDs, namespace UUIDs, and other options read on ... -// ... using predefined URL namespace (for, well, URLs) -uuidv3('http://example.com/hello', uuidv3.URL); // ⇨ 'c6235813-3ba4-3801-ae84-e0a6ebb7d138' +## API Summary -// ... using a custom namespace -// -// Note: Custom namespaces should be a UUID string specific to your application! -// E.g. the one here was generated using this modules `uuid` CLI. -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; -uuidv3('Hello, World!', MY_NAMESPACE); // ⇨ 'e8b5a51d-11c8-3310-a6ab-367563f20686' +| | | | +| --- | --- | --- | +| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | +| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | +| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | +| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | +| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | +| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | +| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | +| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | +| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | -``` +## API -Version 4 (random): +### uuid.NIL + +The nil UUID string (all zeros). + +Example: ```javascript -const uuidv4 = require('uuid/v4'); -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +import { NIL as NIL_UUID } from 'uuid'; +NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' ``` -Version 5 (namespace): +### uuid.parse(str) -```javascript -const uuidv5 = require('uuid/v5'); +Convert UUID string to array of bytes -// ... using predefined DNS namespace (for domain names) -uuidv5('hello.example.com', uuidv5.DNS); // ⇨ 'fdda765f-fc57-5604-a269-52a7df8164ec' +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Uint8Array[16]` | +| _throws_ | `TypeError` if `str` is not a valid UUID | -// ... using predefined URL namespace (for, well, URLs) -uuidv5('http://example.com/hello', uuidv5.URL); // ⇨ '3bbcee75-cecc-5b56-8031-b6641c1ed1f1' - -// ... using a custom namespace -// -// Note: Custom namespaces should be a UUID string specific to your application! -// E.g. the one here was generated using this modules `uuid` CLI. -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; -uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' +Example: +```javascript +import { parse as uuidParse } from 'uuid'; + +uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ + // Uint8Array(16) [ + // 110, 192, 189, 127, 17, + // 192, 67, 218, 151, 94, + // 42, 138, 217, 235, 174, + // 11 + // ] ``` -## API +### uuid.stringify(arr[, offset]) -### Version 1 +Convert array of bytes to UUID string + +| | | +| -------------- | --------------------------------------------------------------------------- | +| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255 | +| [`offset` = 0] | `Number` Starting index in the Array | +| _returns_ | `String` | +| _throws_ | `TypeError` if a valid UUID string cannot be generated | + +Example: ```javascript -const uuidv1 = require('uuid/v1'); +import { stringify as uuidStringify } from 'uuid'; + +const uuidBytes = [110, 192, 189, 127, 17, 192, 67, 218, 151, 94, 42, 138, 217, 235, 174, 11]; -// Incantations -uuidv1(); -uuidv1(options); -uuidv1(options, buffer, offset); +uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' ``` -Generate and return a RFC4122 v1 (timestamp-based) UUID. +### uuid.v1([options[, buffer[, offset]]]) -* `options` - (Object) Optional uuid state to apply. Properties may include: +Create an RFC version 1 (timestamp) UUID - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | +| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | +| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | +| _throws_ | `Error` if more than 10M UUIDs/sec are requested | -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. +Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. -Returns `buffer`, if specified, otherwise the string form of the UUID +Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. -Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. +Example: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' +``` -Example: Generate string UUID with fully-specified options +Example using `options`: ```javascript +import { v1 as uuidv1 } from 'uuid'; + const v1options = { node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], clockseq: 0x1234, msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 + nsecs: 5678, }; uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' - ``` -Example: In-place generation of two binary IDs +### uuid.v3(name, namespace[, buffer[, offset]]) -```javascript -// Generate two ids in an array -const arr = new Array(); -uuidv1(null, arr, 0); // ⇨ - // [ - // 44, 94, 164, 192, 64, 103, - // 17, 233, 146, 52, 155, 29, - // 235, 77, 59, 125 - // ] -uuidv1(null, arr, 16); // ⇨ - // [ - // 44, 94, 164, 192, 64, 103, 17, 233, - // 146, 52, 155, 29, 235, 77, 59, 125, - // 44, 94, 164, 193, 64, 103, 17, 233, - // 146, 52, 155, 29, 235, 77, 59, 125 - // ] +Create an RFC version 3 (namespace w/ MD5) UUID -``` +API is identical to `v5()`, but uses "v3" instead. -### Version 3 +⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." -```javascript -const uuidv3 = require('uuid/v3'); +### uuid.v4([options[, buffer[, offset]]]) -// Incantations -uuidv3(name, namespace); -uuidv3(name, namespace, buffer); -uuidv3(name, namespace, buffer, offset); -``` - -Generate and return a RFC4122 v3 UUID. +Create an RFC version 4 (random) UUID -* `name` - (String | Array[]) "name" to create UUID with -* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 - -Returns `buffer`, if specified, otherwise the string form of the UUID +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | Example: ```javascript -uuidv3('hello world', MY_NAMESPACE); // ⇨ '042ffd34-d989-321c-ad06-f60826172424' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' ``` -### Version 4 +Example using predefined `random` values: ```javascript -const uuidv4 = require('uuid/v4') +import { v4 as uuidv4 } from 'uuid'; -// Incantations -uuidv4(); -uuidv4(options); -uuidv4(options, buffer, offset); +const v4options = { + random: [ + 0x10, + 0x91, + 0x56, + 0xbe, + 0xc4, + 0xfb, + 0xc1, + 0xea, + 0x71, + 0xb4, + 0xef, + 0xe1, + 0x67, + 0x1c, + 0x58, + 0x36, + ], +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' ``` -Generate and return a RFC4122 v4 UUID. +### uuid.v5(name, namespace[, buffer[, offset]]) -* `options` - (Object) Optional uuid state to apply. Properties may include: - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255) -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. +Createa an RFC version 5 (namespace w/ SHA-1) UUID -Returns `buffer`, if specified, otherwise the string form of the UUID +| | | +| --- | --- | +| `name` | `String \| Array` | +| `namespace` | `String \| Array[16]` Namespace UUID | +| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | -Example: Generate string UUID with predefined `random` values +Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. + +Example with custom namespace: ```javascript -const v4options = { - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}; -uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' +import { v5 as uuidv5 } from 'uuid'; + +// Define a custom namespace. Readers, create your own using something like +// https://www.uuidgenerator.net/ +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' ``` -Example: Generate two IDs in a single buffer +Example with RFC `URL` namespace: ```javascript -const buffer = new Array(); -uuidv4(null, buffer, 0); // ⇨ - // [ - // 155, 29, 235, 77, 59, - // 125, 75, 173, 155, 221, - // 43, 13, 123, 61, 203, - // 109 - // ] -uuidv4(null, buffer, 16); // ⇨ - // [ - // 155, 29, 235, 77, 59, 125, 75, 173, - // 155, 221, 43, 13, 123, 61, 203, 109, - // 27, 157, 107, 205, 187, 253, 75, 45, - // 155, 93, 171, 141, 251, 189, 75, 237 - // ] +import { v5 as uuidv5 } from 'uuid'; +uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' ``` -### Version 5 +### uuid.validate(str) + +Test a string to see if it is a valid UUID + +| | | +| --------- | --------------------------------------------------- | +| `str` | `String` to validate | +| _returns_ | `true` if string is a valid UUID, `false` otherwise | + +Example: ```javascript -const uuidv5 = require('uuid/v5'); +import { validate as uuidValidate } from 'uuid'; -// Incantations -uuidv5(name, namespace); -uuidv5(name, namespace, buffer); -uuidv5(name, namespace, buffer, offset); +uuidValidate('not a UUID'); // ⇨ false +uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true ``` -Generate and return a RFC4122 v5 UUID. +### uuid.version(str) -* `name` - (String | Array[]) "name" to create UUID with -* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 +Detect RFC version of a UUID -Returns `buffer`, if specified, otherwise the string form of the UUID +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Number` The RFC version of the UUID | +| _throws_ | `TypeError` if `str` is not a valid UUID | Example: ```javascript -uuidv5('hello world', MY_NAMESPACE); // ⇨ '9f282611-e0fd-5650-8953-89c8e342da0b' +import { version as uuidVersion } from 'uuid'; +uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 +uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 ``` ## Command Line -UUIDs can be generated from the command line with the `uuid` command. +UUIDs can be generated from the command line using `uuid`. ```shell $ uuid ddeb27fb-d9a0-4624-be4d-4615062daed4 +``` -$ uuid v1 -02d37060-d446-11e7-a9fa-7bdae751ebe1 +The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: + +```shell +$ uuid --help + +Usage: + uuid + uuid v1 + uuid v3 + uuid v4 + uuid v5 + uuid --help + +Note: may be "URL" or "DNS" to use the corresponding UUIDs +defined by RFC4122 ``` -Type `uuid --help` for usage details +## ECMAScript Modules -## Testing +This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments). + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` + +To run the examples you must first create a dist build of this library in the module root: ```shell -npm test +npm run build +``` + +## CDN Builds + +### ECMAScript Modules + +To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/): + +```html + +``` + +### UMD + +To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs: + +**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**: + +```html + +``` + +**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**: + +```html + ``` +**Using [cdnjs](https://cdnjs.com/libraries/uuid)**: + +```html + +``` + +These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method: + +```html + +``` + +Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively. + +## "getRandomValues() not supported" + +This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: + +### React Native + +1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) +1. Import it before `uuid`: + +```javascript +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; +``` + +### Web Workers / Service Workers (Edge <= 18) + +[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). + +## Upgrading From `uuid@7.x` + +### Only Named Exports Supported When Using with Node.js ESM + +`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports. + +Instead of doing: + +```javascript +import uuid from 'uuid'; +uuid.v4(); +``` + +you will now have to use the named exports: + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); +``` + +### Deep Requires No Longer Supported + +Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported. + +## Upgrading From `uuid@3.x` + +"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_" + +In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped. + +### Deep Requires Now Deprecated + +`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds: + +```javascript +const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED! +uuidv4(); +``` + +As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax: + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); +``` + +... or for CommonJS: + +```javascript +const { v4: uuidv4 } = require('uuid'); +uuidv4(); +``` + +### Default Export Removed + +`uuid@3.x` was exporting the Version 4 UUID method as a default export: + +```javascript +const uuid = require('uuid'); // <== REMOVED! +``` + +This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`. + ---- Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/node_modules/uuid/dist/bin/uuid b/node_modules/uuid/dist/bin/uuid new file mode 100755 index 0000000000000..f38d2ee19e7d3 --- /dev/null +++ b/node_modules/uuid/dist/bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../uuid-bin'); diff --git a/node_modules/uuid/dist/esm-browser/index.js b/node_modules/uuid/dist/esm-browser/index.js new file mode 100644 index 0000000000000..1db6f6d25b2b6 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/index.js @@ -0,0 +1,9 @@ +export { default as v1 } from './v1.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as NIL } from './nil.js'; +export { default as version } from './version.js'; +export { default as validate } from './validate.js'; +export { default as stringify } from './stringify.js'; +export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/md5.js b/node_modules/uuid/dist/esm-browser/md5.js new file mode 100644 index 0000000000000..8b5d46a7e4c5c --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/md5.js @@ -0,0 +1,215 @@ +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (var i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + var output = []; + var length32 = input.length * 32; + var hexTab = '0123456789abcdef'; + + for (var i = 0; i < length32; i += 8) { + var x = input[i >> 5] >>> i % 32 & 0xff; + var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for (var i = 0; i < x.length; i += 16) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + var length8 = input.length * 8; + var output = new Uint32Array(getOutputLength(length8)); + + for (var i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +export default md5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/nil.js b/node_modules/uuid/dist/esm-browser/nil.js new file mode 100644 index 0000000000000..b36324c2aa3fa --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/parse.js b/node_modules/uuid/dist/esm-browser/parse.js new file mode 100644 index 0000000000000..7c5b1d5a6b021 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + var v; + var arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/regex.js b/node_modules/uuid/dist/esm-browser/regex.js new file mode 100644 index 0000000000000..3da8673a5cdf3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/rng.js b/node_modules/uuid/dist/esm-browser/rng.js new file mode 100644 index 0000000000000..a12aefaa7f466 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/rng.js @@ -0,0 +1,14 @@ +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, +// find the complete implementation of crypto (msCrypto) on IE11. +var getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); +var rnds8 = new Uint8Array(16); +export default function rng() { + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + + return getRandomValues(rnds8); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/sha1.js b/node_modules/uuid/dist/esm-browser/sha1.js new file mode 100644 index 0000000000000..940548baa840a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/sha1.js @@ -0,0 +1,96 @@ +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (var i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + var l = bytes.length / 4 + 2; + var N = Math.ceil(l / 16); + var M = new Array(N); + + for (var _i = 0; _i < N; ++_i) { + var arr = new Uint32Array(16); + + for (var j = 0; j < 16; ++j) { + arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; + } + + M[_i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (var _i2 = 0; _i2 < N; ++_i2) { + var W = new Uint32Array(80); + + for (var t = 0; t < 16; ++t) { + W[t] = M[_i2][t]; + } + + for (var _t = 16; _t < 80; ++_t) { + W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); + } + + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + for (var _t2 = 0; _t2 < 80; ++_t2) { + var s = Math.floor(_t2 / 20); + var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +export default sha1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/stringify.js b/node_modules/uuid/dist/esm-browser/stringify.js new file mode 100644 index 0000000000000..310211158db7a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/stringify.js @@ -0,0 +1,30 @@ +import validate from './validate.js'; +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +var byteToHex = []; + +for (var i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +export default stringify; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v1.js b/node_modules/uuid/dist/esm-browser/v1.js new file mode 100644 index 0000000000000..1a22591ef1eb8 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v1.js @@ -0,0 +1,95 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +var _nodeId; + +var _clockseq; // Previous uuid creation time + + +var _lastMSecs = 0; +var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || new Array(16); + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + var seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || stringify(b); +} + +export default v1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v3.js b/node_modules/uuid/dist/esm-browser/v3.js new file mode 100644 index 0000000000000..c9ab9a4cd78d3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v3.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import md5 from './md5.js'; +var v3 = v35('v3', 0x30, md5); +export default v3; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v35.js b/node_modules/uuid/dist/esm-browser/v35.js new file mode 100644 index 0000000000000..31dd8a1c89b16 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v35.js @@ -0,0 +1,64 @@ +import stringify from './stringify.js'; +import parse from './parse.js'; + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + var bytes = []; + + for (var i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function (name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + var bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v4.js b/node_modules/uuid/dist/esm-browser/v4.js new file mode 100644 index 0000000000000..404810a488de0 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v4.js @@ -0,0 +1,24 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; + +function v4(options, buf, offset) { + options = options || {}; + var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +export default v4; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v5.js b/node_modules/uuid/dist/esm-browser/v5.js new file mode 100644 index 0000000000000..c08d96ba0bd92 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v5.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import sha1 from './sha1.js'; +var v5 = v35('v5', 0x50, sha1); +export default v5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/validate.js b/node_modules/uuid/dist/esm-browser/validate.js new file mode 100644 index 0000000000000..f1cdc7af49bcf --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/validate.js @@ -0,0 +1,7 @@ +import REGEX from './regex.js'; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +export default validate; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/version.js b/node_modules/uuid/dist/esm-browser/version.js new file mode 100644 index 0000000000000..77530e9cb0e35 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/version.js @@ -0,0 +1,11 @@ +import validate from './validate.js'; + +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +export default version; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/index.js b/node_modules/uuid/dist/esm-node/index.js new file mode 100644 index 0000000000000..1db6f6d25b2b6 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/index.js @@ -0,0 +1,9 @@ +export { default as v1 } from './v1.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as NIL } from './nil.js'; +export { default as version } from './version.js'; +export { default as validate } from './validate.js'; +export { default as stringify } from './stringify.js'; +export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/md5.js b/node_modules/uuid/dist/esm-node/md5.js new file mode 100644 index 0000000000000..4d68b040f6c19 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/md5.js @@ -0,0 +1,13 @@ +import crypto from 'crypto'; + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return crypto.createHash('md5').update(bytes).digest(); +} + +export default md5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/nil.js b/node_modules/uuid/dist/esm-node/nil.js new file mode 100644 index 0000000000000..b36324c2aa3fa --- /dev/null +++ b/node_modules/uuid/dist/esm-node/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/parse.js b/node_modules/uuid/dist/esm-node/parse.js new file mode 100644 index 0000000000000..6421c5d5a08e4 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/regex.js b/node_modules/uuid/dist/esm-node/regex.js new file mode 100644 index 0000000000000..3da8673a5cdf3 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/rng.js b/node_modules/uuid/dist/esm-node/rng.js new file mode 100644 index 0000000000000..47620c4b7aefc --- /dev/null +++ b/node_modules/uuid/dist/esm-node/rng.js @@ -0,0 +1,5 @@ +import crypto from 'crypto'; +const rnds8 = new Uint8Array(16); +export default function rng() { + return crypto.randomFillSync(rnds8); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/sha1.js b/node_modules/uuid/dist/esm-node/sha1.js new file mode 100644 index 0000000000000..e23850b441a0c --- /dev/null +++ b/node_modules/uuid/dist/esm-node/sha1.js @@ -0,0 +1,13 @@ +import crypto from 'crypto'; + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return crypto.createHash('sha1').update(bytes).digest(); +} + +export default sha1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/stringify.js b/node_modules/uuid/dist/esm-node/stringify.js new file mode 100644 index 0000000000000..f9bca12026e21 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/stringify.js @@ -0,0 +1,29 @@ +import validate from './validate.js'; +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +export default stringify; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v1.js b/node_modules/uuid/dist/esm-node/v1.js new file mode 100644 index 0000000000000..ebf81acb7d3a8 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v1.js @@ -0,0 +1,95 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || stringify(b); +} + +export default v1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v3.js b/node_modules/uuid/dist/esm-node/v3.js new file mode 100644 index 0000000000000..09063b860499e --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v3.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import md5 from './md5.js'; +const v3 = v35('v3', 0x30, md5); +export default v3; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v35.js b/node_modules/uuid/dist/esm-node/v35.js new file mode 100644 index 0000000000000..22f6a196037f9 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v35.js @@ -0,0 +1,64 @@ +import stringify from './stringify.js'; +import parse from './parse.js'; + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function (name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v4.js b/node_modules/uuid/dist/esm-node/v4.js new file mode 100644 index 0000000000000..efad926f68dee --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v4.js @@ -0,0 +1,24 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; + +function v4(options, buf, offset) { + options = options || {}; + const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +export default v4; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v5.js b/node_modules/uuid/dist/esm-node/v5.js new file mode 100644 index 0000000000000..e87fe317d70a0 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v5.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import sha1 from './sha1.js'; +const v5 = v35('v5', 0x50, sha1); +export default v5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/validate.js b/node_modules/uuid/dist/esm-node/validate.js new file mode 100644 index 0000000000000..f1cdc7af49bcf --- /dev/null +++ b/node_modules/uuid/dist/esm-node/validate.js @@ -0,0 +1,7 @@ +import REGEX from './regex.js'; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +export default validate; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/version.js b/node_modules/uuid/dist/esm-node/version.js new file mode 100644 index 0000000000000..77530e9cb0e35 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/version.js @@ -0,0 +1,11 @@ +import validate from './validate.js'; + +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +export default version; \ No newline at end of file diff --git a/node_modules/uuid/dist/index.js b/node_modules/uuid/dist/index.js new file mode 100644 index 0000000000000..bf13b103c651d --- /dev/null +++ b/node_modules/uuid/dist/index.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "v1", { + enumerable: true, + get: function () { + return _v.default; + } +}); +Object.defineProperty(exports, "v3", { + enumerable: true, + get: function () { + return _v2.default; + } +}); +Object.defineProperty(exports, "v4", { + enumerable: true, + get: function () { + return _v3.default; + } +}); +Object.defineProperty(exports, "v5", { + enumerable: true, + get: function () { + return _v4.default; + } +}); +Object.defineProperty(exports, "NIL", { + enumerable: true, + get: function () { + return _nil.default; + } +}); +Object.defineProperty(exports, "version", { + enumerable: true, + get: function () { + return _version.default; + } +}); +Object.defineProperty(exports, "validate", { + enumerable: true, + get: function () { + return _validate.default; + } +}); +Object.defineProperty(exports, "stringify", { + enumerable: true, + get: function () { + return _stringify.default; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.default; + } +}); + +var _v = _interopRequireDefault(require("./v1.js")); + +var _v2 = _interopRequireDefault(require("./v3.js")); + +var _v3 = _interopRequireDefault(require("./v4.js")); + +var _v4 = _interopRequireDefault(require("./v5.js")); + +var _nil = _interopRequireDefault(require("./nil.js")); + +var _version = _interopRequireDefault(require("./version.js")); + +var _validate = _interopRequireDefault(require("./validate.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +var _parse = _interopRequireDefault(require("./parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/node_modules/uuid/dist/md5-browser.js b/node_modules/uuid/dist/md5-browser.js new file mode 100644 index 0000000000000..7a4582ace6868 --- /dev/null +++ b/node_modules/uuid/dist/md5-browser.js @@ -0,0 +1,223 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (let i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + const output = []; + const length32 = input.length * 32; + const hexTab = '0123456789abcdef'; + + for (let i = 0; i < length32; i += 8) { + const x = input[i >> 5] >>> i % 32 & 0xff; + const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + const length8 = input.length * 8; + const output = new Uint32Array(getOutputLength(length8)); + + for (let i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +var _default = md5; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/md5.js b/node_modules/uuid/dist/md5.js new file mode 100644 index 0000000000000..824d48167a980 --- /dev/null +++ b/node_modules/uuid/dist/md5.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/nil.js b/node_modules/uuid/dist/nil.js new file mode 100644 index 0000000000000..7ade577b256b2 --- /dev/null +++ b/node_modules/uuid/dist/nil.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/parse.js b/node_modules/uuid/dist/parse.js new file mode 100644 index 0000000000000..4c69fc39e74c2 --- /dev/null +++ b/node_modules/uuid/dist/parse.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +var _default = parse; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/regex.js b/node_modules/uuid/dist/regex.js new file mode 100644 index 0000000000000..1ef91d64c80e2 --- /dev/null +++ b/node_modules/uuid/dist/regex.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/rng-browser.js b/node_modules/uuid/dist/rng-browser.js new file mode 100644 index 0000000000000..d3cc3085c732b --- /dev/null +++ b/node_modules/uuid/dist/rng-browser.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rng; +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, +// find the complete implementation of crypto (msCrypto) on IE11. +const getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); +const rnds8 = new Uint8Array(16); + +function rng() { + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + + return getRandomValues(rnds8); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/rng.js b/node_modules/uuid/dist/rng.js new file mode 100644 index 0000000000000..3e152a58f3a09 --- /dev/null +++ b/node_modules/uuid/dist/rng.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rng; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rnds8 = new Uint8Array(16); + +function rng() { + return _crypto.default.randomFillSync(rnds8); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/sha1-browser.js b/node_modules/uuid/dist/sha1-browser.js new file mode 100644 index 0000000000000..24cbcedca58c8 --- /dev/null +++ b/node_modules/uuid/dist/sha1-browser.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (let i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + + for (let j = 0; j < 16; ++j) { + arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; + } + + M[i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +var _default = sha1; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/sha1.js b/node_modules/uuid/dist/sha1.js new file mode 100644 index 0000000000000..03bdd63cedada --- /dev/null +++ b/node_modules/uuid/dist/sha1.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('sha1').update(bytes).digest(); +} + +var _default = sha1; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/stringify.js b/node_modules/uuid/dist/stringify.js new file mode 100644 index 0000000000000..b8e7519403eed --- /dev/null +++ b/node_modules/uuid/dist/stringify.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuid.min.js b/node_modules/uuid/dist/umd/uuid.min.js new file mode 100644 index 0000000000000..784b121f6a867 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuid.min.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r=r||self).uuid={})}(this,(function(r){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function t(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}var o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function a(r){return"string"==typeof r&&o.test(r)}for(var i,u,f=[],s=0;s<256;++s)f.push((s+256).toString(16).substr(1));function c(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(f[r[e+0]]+f[r[e+1]]+f[r[e+2]]+f[r[e+3]]+"-"+f[r[e+4]]+f[r[e+5]]+"-"+f[r[e+6]]+f[r[e+7]]+"-"+f[r[e+8]]+f[r[e+9]]+"-"+f[r[e+10]]+f[r[e+11]]+f[r[e+12]]+f[r[e+13]]+f[r[e+14]]+f[r[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n}var v=0,d=0;function l(r){if(!a(r))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(r.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(r.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(r.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(r.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function p(r,e,n){function t(r,t,o,a){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],n=0;n>>9<<4)+1}function y(r,e){var n=(65535&r)+(65535&e);return(r>>16)+(e>>16)+(n>>16)<<16|65535&n}function g(r,e,n,t,o,a){return y((i=y(y(e,r),y(t,a)))<<(u=o)|i>>>32-u,n);var i,u}function m(r,e,n,t,o,a,i){return g(e&n|~e&t,r,e,o,a,i)}function w(r,e,n,t,o,a,i){return g(e&t|n&~t,r,e,o,a,i)}function b(r,e,n,t,o,a,i){return g(e^n^t,r,e,o,a,i)}function A(r,e,n,t,o,a,i){return g(n^(e|~t),r,e,o,a,i)}var U=p("v3",48,(function(r){if("string"==typeof r){var e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(var n=0;n>5]>>>t%32&255,a=parseInt("0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o),16);e.push(a)}return e}(function(r,e){r[e>>5]|=128<>5]|=(255&r[t/8])<>>32-e}var R=p("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var t=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;w=m,m=g,g=C(y,30)>>>0,y=h,h=U}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));r.NIL="00000000-0000-0000-0000-000000000000",r.parse=l,r.stringify=c,r.v1=function(r,e,n){var o=e&&n||0,a=e||new Array(16),f=(r=r||{}).node||i,s=void 0!==r.clockseq?r.clockseq:u;if(null==f||null==s){var l=r.random||(r.rng||t)();null==f&&(f=i=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==s&&(s=u=16383&(l[6]<<8|l[7]))}var p=void 0!==r.msecs?r.msecs:Date.now(),h=void 0!==r.nsecs?r.nsecs:d+1,y=p-v+(h-d)/1e4;if(y<0&&void 0===r.clockseq&&(s=s+1&16383),(y<0||p>v)&&void 0===r.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=p,d=h,u=s;var g=(1e4*(268435455&(p+=122192928e5))+h)%4294967296;a[o++]=g>>>24&255,a[o++]=g>>>16&255,a[o++]=g>>>8&255,a[o++]=255&g;var m=p/4294967296*1e4&268435455;a[o++]=m>>>8&255,a[o++]=255&m,a[o++]=m>>>24&15|16,a[o++]=m>>>16&255,a[o++]=s>>>8|128,a[o++]=255&s;for(var w=0;w<6;++w)a[o+w]=f[w];return e||c(a)},r.v3=U,r.v4=function(r,e,n){var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(var a=0;a<16;++a)e[n+a]=o[a];return e}return c(o)},r.v5=R,r.validate=a,r.version=function(r){if(!a(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)},Object.defineProperty(r,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidNIL.min.js b/node_modules/uuid/dist/umd/uuidNIL.min.js new file mode 100644 index 0000000000000..0c6a0bf9cb5f9 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidNIL.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidNIL=t()}(this,(function(){"use strict";return"00000000-0000-0000-0000-000000000000"})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidParse.min.js b/node_modules/uuid/dist/umd/uuidParse.min.js new file mode 100644 index 0000000000000..faceea50ed7f7 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidParse.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidParse=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");var n,r=new Uint8Array(16);return r[0]=(n=parseInt(t.slice(0,8),16))>>>24,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=255&n,r[4]=(n=parseInt(t.slice(9,13),16))>>>8,r[5]=255&n,r[6]=(n=parseInt(t.slice(14,18),16))>>>8,r[7]=255&n,r[8]=(n=parseInt(t.slice(19,23),16))>>>8,r[9]=255&n,r[10]=(n=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=n/4294967296&255,r[12]=n>>>24&255,r[13]=n>>>16&255,r[14]=n>>>8&255,r[15]=255&n,r}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidStringify.min.js b/node_modules/uuid/dist/umd/uuidStringify.min.js new file mode 100644 index 0000000000000..df0d50f515558 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidStringify.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).uuidStringify=e()}(this,(function(){"use strict";var t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function e(e){return"string"==typeof e&&t.test(e)}for(var i=[],n=0;n<256;++n)i.push((n+256).toString(16).substr(1));return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,f=(i[t[n+0]]+i[t[n+1]]+i[t[n+2]]+i[t[n+3]]+"-"+i[t[n+4]]+i[t[n+5]]+"-"+i[t[n+6]]+i[t[n+7]]+"-"+i[t[n+8]]+i[t[n+9]]+"-"+i[t[n+10]]+i[t[n+11]]+i[t[n+12]]+i[t[n+13]]+i[t[n+14]]+i[t[n+15]]).toLowerCase();if(!e(f))throw TypeError("Stringified UUID is invalid");return f}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidValidate.min.js b/node_modules/uuid/dist/umd/uuidValidate.min.js new file mode 100644 index 0000000000000..c65495ed6d6bf --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidValidate.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidValidate=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){return"string"==typeof t&&e.test(t)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidVersion.min.js b/node_modules/uuid/dist/umd/uuidVersion.min.js new file mode 100644 index 0000000000000..1ebd58c2ac112 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidVersion.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidVersion=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidv1.min.js b/node_modules/uuid/dist/umd/uuidv1.min.js new file mode 100644 index 0000000000000..c5693b940722a --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidv1.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidv1=t()}(this,(function(){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),t=new Uint8Array(16);function o(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(e){return"string"==typeof e&&n.test(e)}for(var i,u,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var d=0,f=0;return function(e,t,n){var a=t&&n||0,c=t||new Array(16),p=(e=e||{}).node||i,l=void 0!==e.clockseq?e.clockseq:u;if(null==p||null==l){var v=e.random||(e.rng||o)();null==p&&(p=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==l&&(l=u=16383&(v[6]<<8|v[7]))}var y=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,g=y-d+(m-f)/1e4;if(g<0&&void 0===e.clockseq&&(l=l+1&16383),(g<0||y>d)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=y,f=m,u=l;var h=(1e4*(268435455&(y+=122192928e5))+m)%4294967296;c[a++]=h>>>24&255,c[a++]=h>>>16&255,c[a++]=h>>>8&255,c[a++]=255&h;var w=y/4294967296*1e4&268435455;c[a++]=w>>>8&255,c[a++]=255&w,c[a++]=w>>>24&15|16,c[a++]=w>>>16&255,c[a++]=l>>>8|128,c[a++]=255&l;for(var b=0;b<6;++b)c[a+b]=p[b];return t||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!r(o))throw TypeError("Stringified UUID is invalid");return o}(c)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidv3.min.js b/node_modules/uuid/dist/umd/uuidv3.min.js new file mode 100644 index 0000000000000..d818c2ecb834e --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidv3.min.js @@ -0,0 +1 @@ +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).uuidv3=r()}(this,(function(){"use strict";var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(r){return"string"==typeof r&&n.test(r)}for(var e=[],t=0;t<256;++t)e.push((t+256).toString(16).substr(1));function i(n){return 14+(n+64>>>9<<4)+1}function o(n,r){var e=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(e>>16)<<16|65535&e}function a(n,r,e,t,i,a){return o((f=o(o(r,n),o(t,a)))<<(u=i)|f>>>32-u,e);var f,u}function f(n,r,e,t,i,o,f){return a(r&e|~r&t,n,r,i,o,f)}function u(n,r,e,t,i,o,f){return a(r&t|e&~t,n,r,i,o,f)}function c(n,r,e,t,i,o,f){return a(r^e^t,n,r,i,o,f)}function s(n,r,e,t,i,o,f){return a(e^(r|~t),n,r,i,o,f)}return function(n,t,i){function o(n,o,a,f){if("string"==typeof n&&(n=function(n){n=unescape(encodeURIComponent(n));for(var r=[],e=0;e>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=255&e,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=255&e,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=255&e,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=255&e,t}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+n.length);if(u.set(o),u.set(n,o.length),(u=i(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,a){f=f||0;for(var c=0;c<16;++c)a[f+c]=u[c];return a}return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(e[n[t+0]]+e[n[t+1]]+e[n[t+2]]+e[n[t+3]]+"-"+e[n[t+4]]+e[n[t+5]]+"-"+e[n[t+6]]+e[n[t+7]]+"-"+e[n[t+8]]+e[n[t+9]]+"-"+e[n[t+10]]+e[n[t+11]]+e[n[t+12]]+e[n[t+13]]+e[n[t+14]]+e[n[t+15]]).toLowerCase();if(!r(i))throw TypeError("Stringified UUID is invalid");return i}(u)}try{o.name=n}catch(n){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(n){if("string"==typeof n){var r=unescape(encodeURIComponent(n));n=new Uint8Array(r.length);for(var e=0;e>5]>>>t%32&255,o=parseInt("0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i),16);r.push(o)}return r}(function(n,r){n[r>>5]|=128<>5]|=(255&n[t/8])<1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!o(r))throw TypeError("Stringified UUID is invalid");return r}(i)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidv5.min.js b/node_modules/uuid/dist/umd/uuidv5.min.js new file mode 100644 index 0000000000000..0d04c295fc03a --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidv5.min.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r=r||self).uuidv5=e()}(this,(function(){"use strict";var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function e(e){return"string"==typeof e&&r.test(e)}for(var t=[],n=0;n<256;++n)t.push((n+256).toString(16).substr(1));function a(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function o(r,e){return r<>>32-e}return function(r,n,a){function o(r,o,i,f){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],t=0;t>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+r.length);if(s.set(o),s.set(r,o.length),(s=a(s))[6]=15&s[6]|n,s[8]=63&s[8]|128,i){f=f||0;for(var u=0;u<16;++u)i[f+u]=s[u];return i}return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(t[r[n+0]]+t[r[n+1]]+t[r[n+2]]+t[r[n+3]]+"-"+t[r[n+4]]+t[r[n+5]]+"-"+t[r[n+6]]+t[r[n+7]]+"-"+t[r[n+8]]+t[r[n+9]]+"-"+t[r[n+10]]+t[r[n+11]]+t[r[n+12]]+t[r[n+13]]+t[r[n+14]]+t[r[n+15]]).toLowerCase();if(!e(a))throw TypeError("Stringified UUID is invalid");return a}(s)}try{o.name=r}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=[];for(var i=0;i>>0;A=U,U=w,w=o(b,30)>>>0,b=g,g=C}t[0]=t[0]+g>>>0,t[1]=t[1]+b>>>0,t[2]=t[2]+w>>>0,t[3]=t[3]+U>>>0,t[4]=t[4]+A>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,255&t[0],t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,255&t[1],t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,255&t[2],t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,255&t[3],t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,255&t[4]]}))})); \ No newline at end of file diff --git a/node_modules/uuid/dist/uuid-bin.js b/node_modules/uuid/dist/uuid-bin.js new file mode 100644 index 0000000000000..50a7a9f17a065 --- /dev/null +++ b/node_modules/uuid/dist/uuid-bin.js @@ -0,0 +1,85 @@ +"use strict"; + +var _assert = _interopRequireDefault(require("assert")); + +var _v = _interopRequireDefault(require("./v1.js")); + +var _v2 = _interopRequireDefault(require("./v3.js")); + +var _v3 = _interopRequireDefault(require("./v4.js")); + +var _v4 = _interopRequireDefault(require("./v5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122'); +} + +const args = process.argv.slice(2); + +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} + +const version = args.shift() || 'v4'; + +switch (version) { + case 'v1': + console.log((0, _v.default)()); + break; + + case 'v3': + { + const name = args.shift(); + let namespace = args.shift(); + (0, _assert.default)(name != null, 'v3 name not specified'); + (0, _assert.default)(namespace != null, 'v3 namespace not specified'); + + if (namespace === 'URL') { + namespace = _v2.default.URL; + } + + if (namespace === 'DNS') { + namespace = _v2.default.DNS; + } + + console.log((0, _v2.default)(name, namespace)); + break; + } + + case 'v4': + console.log((0, _v3.default)()); + break; + + case 'v5': + { + const name = args.shift(); + let namespace = args.shift(); + (0, _assert.default)(name != null, 'v5 name not specified'); + (0, _assert.default)(namespace != null, 'v5 namespace not specified'); + + if (namespace === 'URL') { + namespace = _v4.default.URL; + } + + if (namespace === 'DNS') { + namespace = _v4.default.DNS; + } + + console.log((0, _v4.default)(name, namespace)); + break; + } + + default: + usage(); + process.exit(1); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/v1.js b/node_modules/uuid/dist/v1.js new file mode 100644 index 0000000000000..abb9b3d1672a3 --- /dev/null +++ b/node_modules/uuid/dist/v1.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _rng = _interopRequireDefault(require("./rng.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.default)(b); +} + +var _default = v1; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/v3.js b/node_modules/uuid/dist/v3.js new file mode 100644 index 0000000000000..6b47ff517535a --- /dev/null +++ b/node_modules/uuid/dist/v3.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _v = _interopRequireDefault(require("./v35.js")); + +var _md = _interopRequireDefault(require("./md5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/v35.js b/node_modules/uuid/dist/v35.js new file mode 100644 index 0000000000000..f784c6337fa0e --- /dev/null +++ b/node_modules/uuid/dist/v35.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +var _parse = _interopRequireDefault(require("./parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/node_modules/uuid/dist/v4.js b/node_modules/uuid/dist/v4.js new file mode 100644 index 0000000000000..838ce0b28d743 --- /dev/null +++ b/node_modules/uuid/dist/v4.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _rng = _interopRequireDefault(require("./rng.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return (0, _stringify.default)(rnds); +} + +var _default = v4; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/v5.js b/node_modules/uuid/dist/v5.js new file mode 100644 index 0000000000000..99d615e096c5e --- /dev/null +++ b/node_modules/uuid/dist/v5.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _v = _interopRequireDefault(require("./v35.js")); + +var _sha = _interopRequireDefault(require("./sha1.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/validate.js b/node_modules/uuid/dist/validate.js new file mode 100644 index 0000000000000..fd052157d4400 --- /dev/null +++ b/node_modules/uuid/dist/validate.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _regex = _interopRequireDefault(require("./regex.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); +} + +var _default = validate; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/version.js b/node_modules/uuid/dist/version.js new file mode 100644 index 0000000000000..b72949cdb96e7 --- /dev/null +++ b/node_modules/uuid/dist/version.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +var _default = version; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/package.json b/node_modules/uuid/package.json index efc07b8f6c3f7..493ea856da915 100644 --- a/node_modules/uuid/package.json +++ b/node_modules/uuid/package.json @@ -1,6 +1,6 @@ { "name": "uuid", - "version": "3.4.0", + "version": "8.3.0", "description": "RFC4122 (v1, v4, and v5) UUIDs", "commitlint": { "extends": [ @@ -14,28 +14,97 @@ ], "license": "MIT", "bin": { - "uuid": "./bin/uuid" + "uuid": "./dist/bin/uuid" }, + "sideEffects": false, + "main": "./dist/index.js", + "exports": { + ".": { + "node": { + "module": "./dist/esm-node/index.js", + "require": "./dist/index.js", + "import": "./wrapper.mjs" + }, + "default": "./dist/esm-browser/index.js" + }, + "./package.json": "./package.json" + }, + "module": "./dist/esm-node/index.js", + "browser": { + "./dist/md5.js": "./dist/md5-browser.js", + "./dist/rng.js": "./dist/rng-browser.js", + "./dist/sha1.js": "./dist/sha1-browser.js", + "./dist/esm-node/index.js": "./dist/esm-browser/index.js" + }, + "files": [ + "CHANGELOG.md", + "CONTRIBUTING.md", + "LICENSE.md", + "README.md", + "dist", + "wrapper.mjs" + ], "devDependencies": { - "@commitlint/cli": "~8.2.0", - "@commitlint/config-conventional": "~8.2.0", - "eslint": "~6.4.0", - "husky": "~3.0.5", - "mocha": "6.2.0", - "runmd": "1.2.1", - "standard-version": "7.0.0" + "@babel/cli": "7.10.3", + "@babel/core": "7.10.3", + "@babel/preset-env": "7.10.3", + "@commitlint/cli": "9.1.2", + "@commitlint/config-conventional": "9.0.1", + "@rollup/plugin-node-resolve": "8.0.1", + "@wdio/browserstack-service": "6.1.15", + "@wdio/cli": "6.1.20", + "@wdio/jasmine-framework": "6.1.17", + "@wdio/local-runner": "6.1.20", + "@wdio/spec-reporter": "6.1.14", + "@wdio/static-server-service": "6.1.14", + "@wdio/sync": "6.1.14", + "babel-eslint": "10.1.0", + "bundlewatch": "0.2.7", + "eslint": "7.3.0", + "eslint-config-prettier": "6.11.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.21.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-prettier": "3.1.4", + "eslint-plugin-promise": "4.2.1", + "eslint-plugin-standard": "4.0.1", + "husky": "4.2.5", + "jest": "25.5.4", + "lint-staged": "10.2.11", + "npm-run-all": "4.1.5", + "prettier": "2.0.5", + "random-seed": "0.3.0", + "rollup": "2.18.0", + "rollup-plugin-terser": "6.1.0", + "runmd": "1.3.2", + "standard-version": "8.0.2" }, "scripts": { - "lint": "eslint .", - "test": "npm run lint && mocha test/test.js", + "examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build", + "examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build", + "examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test", + "examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test", + "lint": "npm run eslint:check && npm run prettier:check", + "eslint:check": "eslint src/ test/ examples/ *.js", + "eslint:fix": "eslint --fix src/ test/ examples/ *.js", + "pretest": "[ -n $CI ] || npm run build", + "test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/", + "pretest:browser": "npm run build && npm-run-all --parallel examples:browser:**", + "test:browser": "wdio run ./wdio.conf.js", + "pretest:node": "npm run build", + "test:node": "npm-run-all --parallel examples:node:**", + "test:pack": "./scripts/testpack.sh", + "pretest:benchmark": "npm run build", + "test:benchmark": "cd examples/benchmark && npm install && npm test", + "prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'", + "prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'", + "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", "md": "runmd --watch --output=README.md README_js.md", - "release": "standard-version", - "prepare": "runmd --output=README.md README_js.md" - }, - "browser": { - "./lib/rng.js": "./lib/rng-browser.js", - "./lib/sha1.js": "./lib/sha1-browser.js", - "./lib/md5.js": "./lib/md5-browser.js" + "docs": "( node --version | grep -q 'v12' ) && ( npm run build && runmd --output=README.md README_js.md )", + "docs:diff": "npm run docs && git diff --quiet README.md", + "build": "./scripts/build.sh", + "prepack": "npm run build", + "release": "standard-version --no-verify" }, "repository": { "type": "git", @@ -43,7 +112,21 @@ }, "husky": { "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,jsx,json,md}": [ + "prettier --write" + ], + "*.{js,jsx}": [ + "eslint --fix" + ] + }, + "standard-version": { + "scripts": { + "postchangelog": "prettier --write CHANGELOG.md" } } } diff --git a/node_modules/uuid/wrapper.mjs b/node_modules/uuid/wrapper.mjs new file mode 100644 index 0000000000000..c31e9cef45e2b --- /dev/null +++ b/node_modules/uuid/wrapper.mjs @@ -0,0 +1,10 @@ +import uuid from './dist/index.js'; +export const v1 = uuid.v1; +export const v3 = uuid.v3; +export const v4 = uuid.v4; +export const v5 = uuid.v5; +export const NIL = uuid.NIL; +export const version = uuid.version; +export const validate = uuid.validate; +export const stringify = uuid.stringify; +export const parse = uuid.parse; diff --git a/package-lock.json b/package-lock.json index aaeab5187660a..b1ca09e8a650a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -159,7 +159,7 @@ "tiny-relative-date": "^1.3.0", "uid-number": "0.0.6", "umask": "~1.1.0", - "uuid": "^3.3.3", + "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", "which": "^2.0.2", "write-file-atomic": "^2.4.3" @@ -3232,6 +3232,15 @@ "node": ">=0.10.0" } }, + "node_modules/istanbul-lib-processinfo/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/istanbul-lib-processinfo/node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -4432,6 +4441,15 @@ "rimraf": "bin.js" } }, + "node_modules/nyc/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -5179,6 +5197,15 @@ "node": ">= 0.12" } }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "inBundle": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -8212,12 +8239,12 @@ } }, "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==", "inBundle": true, "bin": { - "uuid": "bin/uuid" + "uuid": "dist/bin/uuid" } }, "node_modules/v8-compile-cache": { @@ -10973,6 +11000,12 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -11885,6 +11918,12 @@ "requires": { "glob": "^7.1.3" } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true } } }, @@ -12444,6 +12483,11 @@ "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } }, @@ -14755,9 +14799,9 @@ } }, "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" }, "v8-compile-cache": { "version": "2.1.1", diff --git a/package.json b/package.json index 4807c92035053..10741f53cf094 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "tiny-relative-date": "^1.3.0", "uid-number": "0.0.6", "umask": "~1.1.0", - "uuid": "^3.3.3", + "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", "which": "^2.0.2", "write-file-atomic": "^2.4.3" From ee4c85b878410143644460c3860ab706a8c925e0 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:15:15 -0400 Subject: [PATCH 13/39] write-file-atomic@3.0.3 --- node_modules/.gitignore | 1 - .../write-file-atomic/CHANGELOG.md | 25 ++ .../node_modules/write-file-atomic/LICENSE | 6 + .../node_modules/write-file-atomic/README.md | 56 ++++ .../node_modules/write-file-atomic/index.js | 238 ++++++++++++++ .../write-file-atomic/package.json | 41 +++ node_modules/typedarray-to-buffer/.airtap.yml | 15 + node_modules/typedarray-to-buffer/.travis.yml | 11 + node_modules/typedarray-to-buffer/LICENSE | 21 ++ node_modules/typedarray-to-buffer/README.md | 85 +++++ node_modules/typedarray-to-buffer/index.js | 25 ++ .../typedarray-to-buffer/package.json | 50 +++ .../typedarray-to-buffer/test/basic.js | 50 +++ node_modules/write-file-atomic/CHANGELOG.md | 7 + node_modules/write-file-atomic/README.md | 22 +- node_modules/write-file-atomic/index.js | 293 ++++++++++-------- node_modules/write-file-atomic/package.json | 33 +- package-lock.json | 96 +++--- package.json | 2 +- 19 files changed, 886 insertions(+), 191 deletions(-) create mode 100644 node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md create mode 100644 node_modules/bin-links/node_modules/write-file-atomic/LICENSE create mode 100644 node_modules/bin-links/node_modules/write-file-atomic/README.md create mode 100644 node_modules/bin-links/node_modules/write-file-atomic/index.js create mode 100644 node_modules/bin-links/node_modules/write-file-atomic/package.json create mode 100644 node_modules/typedarray-to-buffer/.airtap.yml create mode 100644 node_modules/typedarray-to-buffer/.travis.yml create mode 100644 node_modules/typedarray-to-buffer/LICENSE create mode 100644 node_modules/typedarray-to-buffer/README.md create mode 100644 node_modules/typedarray-to-buffer/index.js create mode 100644 node_modules/typedarray-to-buffer/package.json create mode 100644 node_modules/typedarray-to-buffer/test/basic.js diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 3d8cd602eb1dd..012498eedd4fc 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -226,7 +226,6 @@ package-lock.json /tsconfig-paths /type-check /type-fest -/typedarray-to-buffer /typescript /unicode-length /util-extend diff --git a/node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md b/node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md new file mode 100644 index 0000000000000..920ae2cb4d1fd --- /dev/null +++ b/node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md @@ -0,0 +1,25 @@ +# 2.4.3 + +* Ignore errors raised by `fs.closeSync` when cleaning up after a write + error. + +# 2.4.2 + +* A pair of patches to fix some fd leaks. We would leak fds with sync use + when errors occured and with async use any time fsync was not in use. (#34) + +# 2.4.1 + +* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35. + +# 2.4.0 + +## Features + +* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20) +* Support passing encoding strings in options slot for compat with Node.js API. (#31) +* Add support for running inside of worker threads (#37) + +## Fixes + +* Remove unneeded call when returning success (#36) diff --git a/node_modules/bin-links/node_modules/write-file-atomic/LICENSE b/node_modules/bin-links/node_modules/write-file-atomic/LICENSE new file mode 100644 index 0000000000000..95e65a7706e0e --- /dev/null +++ b/node_modules/bin-links/node_modules/write-file-atomic/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/bin-links/node_modules/write-file-atomic/README.md b/node_modules/bin-links/node_modules/write-file-atomic/README.md new file mode 100644 index 0000000000000..ca28e99a2b08e --- /dev/null +++ b/node_modules/bin-links/node_modules/write-file-atomic/README.md @@ -0,0 +1,56 @@ +write-file-atomic +----------------- + +This is an extension for node's `fs.writeFile` that makes its operation +atomic and allows you set ownership (uid/gid of the file). + +### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) + +* filename **String** +* data **String** | **Buffer** +* options **Object** | **String** + * chown **Object** default, uid & gid of existing file, if any + * uid **Number** + * gid **Number** + * encoding **String** | **Null** default = 'utf8' + * fsync **Boolean** default = true + * mode **Number** default, from existing file, if any + * Promise **Object** default = native Promise object +* callback **Function** + +Atomically and asynchronously writes data to a file, replacing the file if it already +exists. data can be a string or a buffer. + +The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. +Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. +If writeFile completes successfully then, if passed the **chown** option it will change +the ownership of the file. Finally it renames the file back to the filename you specified. If +it encounters errors at any of these steps it will attempt to unlink the temporary file and then +pass the error back to the caller. +If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. + +If provided, the **chown** option requires both **uid** and **gid** properties or else +you'll get an error. If **chown** is not specified it will default to using +the owner of the previous file. To prevent chown from being ran you can +also pass `false`, in which case the file will be created with the current user's credentials. + +If **mode** is not specified, it will default to using the permissions from +an existing file, if any. Expicitly setting this to `false` remove this default, resulting +in a file created with the system default permissions. + +If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. + +If the **fsync** option is **false**, writeFile will skip the final fsync call. + +Example: + +```javascript +writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { + if (err) throw err; + console.log('It\'s saved!'); +}); +``` + +### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) + +The synchronous version of **writeFileAtomic**. diff --git a/node_modules/bin-links/node_modules/write-file-atomic/index.js b/node_modules/bin-links/node_modules/write-file-atomic/index.js new file mode 100644 index 0000000000000..64ae987c011a9 --- /dev/null +++ b/node_modules/bin-links/node_modules/write-file-atomic/index.js @@ -0,0 +1,238 @@ +'use strict' +module.exports = writeFile +module.exports.sync = writeFileSync +module.exports._getTmpname = getTmpname // for testing +module.exports._cleanupOnExit = cleanupOnExit + +var fs = require('graceful-fs') +var MurmurHash3 = require('imurmurhash') +var onExit = require('signal-exit') +var path = require('path') +var activeFiles = {} + +// if we run inside of a worker_thread, `process.pid` is not unique +/* istanbul ignore next */ +var threadId = (function getId () { + try { + var workerThreads = require('worker_threads') + + /// if we are in main thread, this is set to `0` + return workerThreads.threadId + } catch (e) { + // worker_threads are not available, fallback to 0 + return 0 + } +})() + +var invocations = 0 +function getTmpname (filename) { + return filename + '.' + + MurmurHash3(__filename) + .hash(String(process.pid)) + .hash(String(threadId)) + .hash(String(++invocations)) + .result() +} + +function cleanupOnExit (tmpfile) { + return function () { + try { + fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) + } catch (_) {} + } +} + +function writeFile (filename, data, options, callback) { + if (options) { + if (options instanceof Function) { + callback = options + options = {} + } else if (typeof options === 'string') { + options = { encoding: options } + } + } else { + options = {} + } + + var Promise = options.Promise || global.Promise + var truename + var fd + var tmpfile + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + var absoluteName = path.resolve(filename) + + new Promise(function serializeSameFile (resolve) { + // make a queue if it doesn't already exist + if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] + + activeFiles[absoluteName].push(resolve) // add this job to the queue + if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one + }).then(function getRealPath () { + return new Promise(function (resolve) { + fs.realpath(filename, function (_, realname) { + truename = realname || filename + tmpfile = getTmpname(truename) + resolve() + }) + }) + }).then(function stat () { + return new Promise(function stat (resolve) { + if (options.mode && options.chown) resolve() + else { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + fs.stat(truename, function (err, stats) { + if (err || !stats) resolve() + else { + options = Object.assign({}, options) + + if (options.mode == null) { + options.mode = stats.mode + } + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + resolve() + } + }) + } + }) + }).then(function thenWriteFile () { + return new Promise(function (resolve, reject) { + fs.open(tmpfile, 'w', options.mode, function (err, _fd) { + fd = _fd + if (err) reject(err) + else resolve() + }) + }) + }).then(function write () { + return new Promise(function (resolve, reject) { + if (Buffer.isBuffer(data)) { + fs.write(fd, data, 0, data.length, 0, function (err) { + if (err) reject(err) + else resolve() + }) + } else if (data != null) { + fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { + if (err) reject(err) + else resolve() + }) + } else resolve() + }) + }).then(function syncAndClose () { + return new Promise(function (resolve, reject) { + if (options.fsync !== false) { + fs.fsync(fd, function (err) { + if (err) fs.close(fd, () => reject(err)) + else fs.close(fd, resolve) + }) + } else { + fs.close(fd, resolve) + } + }) + }).then(function chown () { + fd = null + if (options.chown) { + return new Promise(function (resolve, reject) { + fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { + if (err) reject(err) + else resolve() + }) + }) + } + }).then(function chmod () { + if (options.mode) { + return new Promise(function (resolve, reject) { + fs.chmod(tmpfile, options.mode, function (err) { + if (err) reject(err) + else resolve() + }) + }) + } + }).then(function rename () { + return new Promise(function (resolve, reject) { + fs.rename(tmpfile, truename, function (err) { + if (err) reject(err) + else resolve() + }) + }) + }).then(function success () { + removeOnExitHandler() + callback() + }, function fail (err) { + return new Promise(resolve => { + return fd ? fs.close(fd, resolve) : resolve() + }).then(() => { + removeOnExitHandler() + fs.unlink(tmpfile, function () { + callback(err) + }) + }) + }).then(function checkQueue () { + activeFiles[absoluteName].shift() // remove the element added by serializeSameFile + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0]() // start next job if one is pending + } else delete activeFiles[absoluteName] + }) +} + +function writeFileSync (filename, data, options) { + if (typeof options === 'string') options = { encoding: options } + else if (!options) options = {} + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + var tmpfile = getTmpname(filename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + var stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + var fd + var cleanup = cleanupOnExit(tmpfile) + var removeOnExitHandler = onExit(cleanup) + + try { + fd = fs.openSync(tmpfile, 'w', options.mode) + if (Buffer.isBuffer(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + fs.closeSync(fd) + if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + if (options.mode) fs.chmodSync(tmpfile, options.mode) + fs.renameSync(tmpfile, filename) + removeOnExitHandler() + } catch (err) { + if (fd) { + try { + fs.closeSync(fd) + } catch (ex) { + // ignore close errors at this stage, error may have closed fd already. + } + } + removeOnExitHandler() + cleanup() + throw err + } +} diff --git a/node_modules/bin-links/node_modules/write-file-atomic/package.json b/node_modules/bin-links/node_modules/write-file-atomic/package.json new file mode 100644 index 0000000000000..bbb0fa23456eb --- /dev/null +++ b/node_modules/bin-links/node_modules/write-file-atomic/package.json @@ -0,0 +1,41 @@ +{ + "name": "write-file-atomic", + "version": "2.4.3", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "index.js", + "scripts": { + "test": "standard && tap --100 test/*.js", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git@github.com:iarna/write-file-atomic.git" + }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/write-file-atomic/issues" + }, + "homepage": "https://github.com/iarna/write-file-atomic", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "require-inject": "^1.4.0", + "rimraf": "^2.5.4", + "standard": "^12.0.1", + "tap": "^12.1.3" + }, + "files": [ + "index.js" + ] +} diff --git a/node_modules/typedarray-to-buffer/.airtap.yml b/node_modules/typedarray-to-buffer/.airtap.yml new file mode 100644 index 0000000000000..3417780255e8e --- /dev/null +++ b/node_modules/typedarray-to-buffer/.airtap.yml @@ -0,0 +1,15 @@ +sauce_connect: true +loopback: airtap.local +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: latest + - name: microsoftedge + version: latest + - name: ie + version: latest + - name: iphone + version: latest diff --git a/node_modules/typedarray-to-buffer/.travis.yml b/node_modules/typedarray-to-buffer/.travis.yml new file mode 100644 index 0000000000000..f25afbd2f19c7 --- /dev/null +++ b/node_modules/typedarray-to-buffer/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +node_js: + - lts/* +addons: + sauce_connect: true + hosts: + - airtap.local +env: + global: + - secure: i51rE9rZGHbcZWlL58j3H1qtL23OIV2r0X4TcQKNI3pw2mubdHFJmfPNNO19ItfReu8wwQMxOehKamwaNvqMiKWyHfn/QcThFQysqzgGZ6AgnUbYx9od6XFNDeWd1sVBf7QBAL07y7KWlYGWCwFwWjabSVySzQhEBdisPcskfkI= + - secure: BKq6/5z9LK3KDkTjs7BGeBZ1KsWgz+MsAXZ4P64NSeVGFaBdXU45+ww1mwxXFt5l22/mhyOQZfebQl+kGVqRSZ+DEgQeCymkNZ6CD8c6w6cLuOJXiXwuu/cDM2DD0tfGeu2YZC7yEikP7BqEFwH3D324rRzSGLF2RSAAwkOI7bE= diff --git a/node_modules/typedarray-to-buffer/LICENSE b/node_modules/typedarray-to-buffer/LICENSE new file mode 100644 index 0000000000000..0c068ceecbd48 --- /dev/null +++ b/node_modules/typedarray-to-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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/typedarray-to-buffer/README.md b/node_modules/typedarray-to-buffer/README.md new file mode 100644 index 0000000000000..35761fb5f8bbb --- /dev/null +++ b/node_modules/typedarray-to-buffer/README.md @@ -0,0 +1,85 @@ +# typedarray-to-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/typedarray-to-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/typedarray-to-buffer +[npm-image]: https://img.shields.io/npm/v/typedarray-to-buffer.svg +[npm-url]: https://npmjs.org/package/typedarray-to-buffer +[downloads-image]: https://img.shields.io/npm/dm/typedarray-to-buffer.svg +[downloads-url]: https://npmjs.org/package/typedarray-to-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Convert a typed array to a [Buffer](https://github.com/feross/buffer) without a copy. + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/typedarray-to-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/typedarray-to-buffer + +Say you're using the ['buffer'](https://github.com/feross/buffer) module on npm, or +[browserify](http://browserify.org/) and you're working with lots of binary data. + +Unfortunately, sometimes the browser or someone else's API gives you a typed array like +`Uint8Array` to work with and you need to convert it to a `Buffer`. What do you do? + +Of course: `Buffer.from(uint8array)` + +But, alas, every time you do `Buffer.from(uint8array)` **the entire array gets copied**. +The `Buffer` constructor does a copy; this is +defined by the [node docs](http://nodejs.org/api/buffer.html) and the 'buffer' module +matches the node API exactly. + +So, how can we avoid this expensive copy in +[performance critical applications](https://github.com/feross/buffer/issues/22)? + +***Simply use this module, of course!*** + +If you have an `ArrayBuffer`, you don't need this module, because +`Buffer.from(arrayBuffer)` +[is already efficient](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length). + +## install + +```bash +npm install typedarray-to-buffer +``` + +## usage + +To convert a typed array to a `Buffer` **without a copy**, do this: + +```js +var toBuffer = require('typedarray-to-buffer') + +var arr = new Uint8Array([1, 2, 3]) +arr = toBuffer(arr) + +// arr is a buffer now! + +arr.toString() // '\u0001\u0002\u0003' +arr.readUInt16BE(0) // 258 +``` + +## how it works + +If the browser supports typed arrays, then `toBuffer` will **augment the typed array** you +pass in with the `Buffer` methods and return it. See [how does Buffer +work?](https://github.com/feross/buffer#how-does-it-work) for more about how augmentation +works. + +This module uses the typed array's underlying `ArrayBuffer` to back the new `Buffer`. This +respects the "view" on the `ArrayBuffer`, i.e. `byteOffset` and `byteLength`. In other +words, if you do `toBuffer(new Uint32Array([1, 2, 3]))`, then the new `Buffer` will +contain `[1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]`, **not** `[1, 2, 3]`. And it still doesn't +require a copy. + +If the browser doesn't support typed arrays, then `toBuffer` will create a new `Buffer` +object, copy the data into it, and return it. There's no simple performance optimization +we can do for old browsers. Oh well. + +If this module is used in node, then it will just call `Buffer.from`. This is just for +the convenience of modules that work in both node and the browser. + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/typedarray-to-buffer/index.js b/node_modules/typedarray-to-buffer/index.js new file mode 100644 index 0000000000000..5fa394dd201d2 --- /dev/null +++ b/node_modules/typedarray-to-buffer/index.js @@ -0,0 +1,25 @@ +/** + * Convert a typed array to a Buffer without a copy + * + * Author: Feross Aboukhadijeh + * License: MIT + * + * `npm install typedarray-to-buffer` + */ + +var isTypedArray = require('is-typedarray').strict + +module.exports = function typedarrayToBuffer (arr) { + if (isTypedArray(arr)) { + // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer + var buf = Buffer.from(arr.buffer) + if (arr.byteLength !== arr.buffer.byteLength) { + // Respect the "view", i.e. byteOffset and byteLength, without doing a copy + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength) + } + return buf + } else { + // Pass through all other types to `Buffer.from` + return Buffer.from(arr) + } +} diff --git a/node_modules/typedarray-to-buffer/package.json b/node_modules/typedarray-to-buffer/package.json new file mode 100644 index 0000000000000..5ec5656157991 --- /dev/null +++ b/node_modules/typedarray-to-buffer/package.json @@ -0,0 +1,50 @@ +{ + "name": "typedarray-to-buffer", + "description": "Convert a typed array to a Buffer without a copy", + "version": "3.1.5", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org/" + }, + "bugs": { + "url": "https://github.com/feross/typedarray-to-buffer/issues" + }, + "dependencies": { + "is-typedarray": "^1.0.0" + }, + "devDependencies": { + "airtap": "0.0.4", + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "http://feross.org", + "keywords": [ + "buffer", + "typed array", + "convert", + "no copy", + "uint8array", + "uint16array", + "uint32array", + "int16array", + "int32array", + "float32array", + "float64array", + "browser", + "arraybuffer", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/typedarray-to-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + } +} diff --git a/node_modules/typedarray-to-buffer/test/basic.js b/node_modules/typedarray-to-buffer/test/basic.js new file mode 100644 index 0000000000000..352109682f5c1 --- /dev/null +++ b/node_modules/typedarray-to-buffer/test/basic.js @@ -0,0 +1,50 @@ +var test = require('tape') +var toBuffer = require('../') + +test('convert to buffer from Uint8Array', function (t) { + if (typeof Uint8Array !== 'undefined') { + var arr = new Uint8Array([1, 2, 3]) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([1, 2, 3]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt8(0), 1) + t.equal(arr.readUInt8(1), 2) + t.equal(arr.readUInt8(2), 3) + } else { + t.pass('browser lacks Uint8Array support, skip test') + } + t.end() +}) + +test('convert to buffer from another arrayview type (Uint32Array)', function (t) { + if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) { + var arr = new Uint32Array([1, 2, 3]) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt32LE(0), 1) + t.equal(arr.readUInt32LE(4), 2) + t.equal(arr.readUInt32LE(8), 3) + t.equal(arr instanceof Uint8Array, true) + } else { + t.pass('browser lacks Uint32Array support, skip test') + } + t.end() +}) + +test('convert to buffer from ArrayBuffer', function (t) { + if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) { + var arr = new Uint32Array([1, 2, 3]).subarray(1, 2) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([2, 0, 0, 0]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt32LE(0), 2) + t.equal(arr instanceof Uint8Array, true) + } else { + t.pass('browser lacks ArrayBuffer support, skip test') + } + t.end() +}) diff --git a/node_modules/write-file-atomic/CHANGELOG.md b/node_modules/write-file-atomic/CHANGELOG.md index 920ae2cb4d1fd..d1a6c1b862baa 100644 --- a/node_modules/write-file-atomic/CHANGELOG.md +++ b/node_modules/write-file-atomic/CHANGELOG.md @@ -1,3 +1,10 @@ +# 3.0.0 + +* Implement options.tmpfileCreated callback. +* Drop Node.js 6, modernize code, return Promise from async function. +* Support write TypedArray's like in node fs.writeFile. +* Remove graceful-fs dependency. + # 2.4.3 * Ignore errors raised by `fs.closeSync` when cleaning up after a write diff --git a/node_modules/write-file-atomic/README.md b/node_modules/write-file-atomic/README.md index ca28e99a2b08e..caea79956f858 100644 --- a/node_modules/write-file-atomic/README.md +++ b/node_modules/write-file-atomic/README.md @@ -4,7 +4,7 @@ write-file-atomic This is an extension for node's `fs.writeFile` that makes its operation atomic and allows you set ownership (uid/gid of the file). -### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) +### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], [callback]) * filename **String** * data **String** | **Buffer** @@ -15,7 +15,7 @@ atomic and allows you set ownership (uid/gid of the file). * encoding **String** | **Null** default = 'utf8' * fsync **Boolean** default = true * mode **Number** default, from existing file, if any - * Promise **Object** default = native Promise object + * tmpfileCreated **Function** called when the tmpfile is created * callback **Function** Atomically and asynchronously writes data to a file, replacing the file if it already @@ -27,7 +27,7 @@ If writeFile completes successfully then, if passed the **chown** option it will the ownership of the file. Finally it renames the file back to the filename you specified. If it encounters errors at any of these steps it will attempt to unlink the temporary file and then pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. +If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Writes to different files are still executed in parallel. If provided, the **chown** option requires both **uid** and **gid** properties or else you'll get an error. If **chown** is not specified it will default to using @@ -42,6 +42,8 @@ If options is a String, it's assumed to be the **encoding** option. The **encodi If the **fsync** option is **false**, writeFile will skip the final fsync call. +If the **tmpfileCreated** option is specified it will be called with the name of the tmpfile when created. + Example: ```javascript @@ -51,6 +53,20 @@ writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function }); ``` +This function also supports async/await: + +```javascript +(async () => { + try { + await writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}); + console.log('It\'s saved!'); + } catch (err) { + console.error(err); + process.exit(1); + } +})(); +``` + ### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) The synchronous version of **writeFileAtomic**. diff --git a/node_modules/write-file-atomic/index.js b/node_modules/write-file-atomic/index.js index 64ae987c011a9..df5b72a14f74a 100644 --- a/node_modules/write-file-atomic/index.js +++ b/node_modules/write-file-atomic/index.js @@ -4,17 +4,20 @@ module.exports.sync = writeFileSync module.exports._getTmpname = getTmpname // for testing module.exports._cleanupOnExit = cleanupOnExit -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} +const fs = require('fs') +const MurmurHash3 = require('imurmurhash') +const onExit = require('signal-exit') +const path = require('path') +const isTypedArray = require('is-typedarray') +const typedArrayToBuffer = require('typedarray-to-buffer') +const { promisify } = require('util') +const activeFiles = {} // if we run inside of a worker_thread, `process.pid` is not unique /* istanbul ignore next */ -var threadId = (function getId () { +const threadId = (function getId () { try { - var workerThreads = require('worker_threads') + const workerThreads = require('worker_threads') /// if we are in main thread, this is set to `0` return workerThreads.threadId @@ -24,7 +27,7 @@ var threadId = (function getId () { } })() -var invocations = 0 +let invocations = 0 function getTmpname (filename) { return filename + '.' + MurmurHash3(__filename) @@ -35,146 +38,135 @@ function getTmpname (filename) { } function cleanupOnExit (tmpfile) { - return function () { + return () => { try { fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) } catch (_) {} } } -function writeFile (filename, data, options, callback) { - if (options) { - if (options instanceof Function) { - callback = options - options = {} - } else if (typeof options === 'string') { - options = { encoding: options } - } - } else { - options = {} - } - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { +function serializeActiveFile (absoluteName) { + return new Promise(resolve => { // make a queue if it doesn't already exist if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] activeFiles[absoluteName].push(resolve) // add this job to the queue if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (options.mode == null) { - options.mode = stats.mode - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - return new Promise(function (resolve, reject) { - if (options.fsync !== false) { - fs.fsync(fd, function (err) { - if (err) fs.close(fd, () => reject(err)) - else fs.close(fd, resolve) - }) - } else { - fs.close(fd, resolve) + }) +} + +// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 +function isChownErrOk (err) { + if (err.code === 'ENOSYS') { + return true + } + + const nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (err.code === 'EINVAL' || err.code === 'EPERM') { + return true + } + } + + return false +} + +async function writeFileAsync (filename, data, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + let fd + let tmpfile + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + const absoluteName = path.resolve(filename) + + try { + await serializeActiveFile(absoluteName) + const truename = await promisify(fs.realpath)(filename).catch(() => filename) + tmpfile = getTmpname(truename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + const stats = await promisify(fs.stat)(truename).catch(() => {}) + if (stats) { + if (options.mode == null) { + options.mode = stats.mode + } + + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } } - }) - }).then(function chown () { + } + + fd = await promisify(fs.open)(tmpfile, 'w', options.mode) + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile) + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data) + } + if (Buffer.isBuffer(data)) { + await promisify(fs.write)(fd, data, 0, data.length, 0) + } else if (data != null) { + await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8')) + } + + if (options.fsync !== false) { + await promisify(fs.fsync)(fd) + } + + await promisify(fs.close)(fd) fd = null + if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) + await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => { + if (!isChownErrOk(err)) { + throw err + } }) } - }).then(function chmod () { + if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) + await promisify(fs.chmod)(tmpfile, options.mode).catch(err => { + if (!isChownErrOk(err)) { + throw err + } }) } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { + + await promisify(fs.rename)(tmpfile, truename) + } finally { + if (fd) { + await promisify(fs.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ) + } removeOnExitHandler() - callback() - }, function fail (err) { - return new Promise(resolve => { - return fd ? fs.close(fd, resolve) : resolve() - }).then(() => { - removeOnExitHandler() - fs.unlink(tmpfile, function () { - callback(err) - }) - }) - }).then(function checkQueue () { + await promisify(fs.unlink)(tmpfile).catch(() => {}) activeFiles[absoluteName].shift() // remove the element added by serializeSameFile if (activeFiles[absoluteName].length > 0) { activeFiles[absoluteName][0]() // start next job if one is pending } else delete activeFiles[absoluteName] - }) + } +} + +function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = {} + } + + const promise = writeFileAsync(filename, data, options) + if (callback) { + promise.then(callback, callback) + } + + return promise } function writeFileSync (filename, data, options) { @@ -185,13 +177,13 @@ function writeFileSync (filename, data, options) { } catch (ex) { // it's ok, it'll happen on a not yet existing file } - var tmpfile = getTmpname(filename) + const tmpfile = getTmpname(filename) if (!options.mode || !options.chown) { // Either mode or chown is not explicitly set // Default behavior is to copy it from original file try { - var stats = fs.statSync(filename) + const stats = fs.statSync(filename) options = Object.assign({}, options) if (!options.mode) { options.mode = stats.mode @@ -204,12 +196,19 @@ function writeFileSync (filename, data, options) { } } - var fd - var cleanup = cleanupOnExit(tmpfile) - var removeOnExitHandler = onExit(cleanup) + let fd + const cleanup = cleanupOnExit(tmpfile) + const removeOnExitHandler = onExit(cleanup) + let threw = true try { - fd = fs.openSync(tmpfile, 'w', options.mode) + fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile) + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data) + } if (Buffer.isBuffer(data)) { fs.writeSync(fd, data, 0, data.length, 0) } else if (data != null) { @@ -218,12 +217,33 @@ function writeFileSync (filename, data, options) { if (options.fsync !== false) { fs.fsyncSync(fd) } + fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) + fd = null + + if (options.chown) { + try { + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + if (options.mode) { + try { + fs.chmodSync(tmpfile, options.mode) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + fs.renameSync(tmpfile, filename) - removeOnExitHandler() - } catch (err) { + threw = false + } finally { if (fd) { try { fs.closeSync(fd) @@ -232,7 +252,8 @@ function writeFileSync (filename, data, options) { } } removeOnExitHandler() - cleanup() - throw err + if (threw) { + cleanup() + } } } diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json index bbb0fa23456eb..98a29a053453a 100644 --- a/node_modules/write-file-atomic/package.json +++ b/node_modules/write-file-atomic/package.json @@ -1,17 +1,20 @@ { "name": "write-file-atomic", - "version": "2.4.3", + "version": "3.0.3", "description": "Write files in an atomic fashion w/configurable ownership", "main": "index.js", "scripts": { - "test": "standard && tap --100 test/*.js", + "test": "tap", + "posttest": "npm run lint", + "lint": "standard", + "postlint": "rimraf chowncopy good nochmod nochown nofsync nofsyncopt noopen norename \"norename nounlink\" nowrite", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags" }, "repository": { "type": "git", - "url": "git@github.com:iarna/write-file-atomic.git" + "url": "git://github.com/npm/write-file-atomic.git" }, "keywords": [ "writeFile", @@ -20,22 +23,26 @@ "author": "Rebecca Turner (http://re-becca.org)", "license": "ISC", "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" + "url": "https://github.com/npm/write-file-atomic/issues" }, - "homepage": "https://github.com/iarna/write-file-atomic", + "homepage": "https://github.com/npm/write-file-atomic", "dependencies": { - "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" }, "devDependencies": { "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^12.0.1", - "tap": "^12.1.3" + "require-inject": "^1.4.4", + "rimraf": "^2.6.3", + "standard": "^14.3.1", + "tap": "^14.10.6" }, "files": [ "index.js" - ] + ], + "tap": { + "100": true + } } diff --git a/package-lock.json b/package-lock.json index b1ca09e8a650a..06deef27e1cf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -162,7 +162,7 @@ "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", "which": "^2.0.2", - "write-file-atomic": "^2.4.3" + "write-file-atomic": "^3.0.3" }, "bin": { "npm": "bin/npm-cli.js", @@ -929,6 +929,17 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/bin-links/node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "inBundle": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, "node_modules/binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -1051,6 +1062,17 @@ "node": ">=6" } }, + "node_modules/caching-transform/node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, "node_modules/caller": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/caller/-/caller-1.0.1.tgz", @@ -7782,18 +7804,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/tap/node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "node_modules/tap/node_modules/yaml": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", @@ -8147,7 +8157,7 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, + "inBundle": true, "dependencies": { "is-typedarray": "^1.0.0" } @@ -8404,14 +8414,15 @@ } }, "node_modules/write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "inBundle": true, "dependencies": { - "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, "node_modules/write/node_modules/mkdirp": { @@ -9247,6 +9258,16 @@ "requires": { "glob": "^7.1.3" } + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } } } }, @@ -9346,6 +9367,19 @@ "make-dir": "^2.0.0", "package-hash": "^3.0.0", "write-file-atomic": "^2.4.2" + }, + "dependencies": { + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + } } }, "caller": { @@ -14406,18 +14440,6 @@ } } }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "yaml": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", @@ -14723,7 +14745,6 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, "requires": { "is-typedarray": "^1.0.0" } @@ -14941,13 +14962,14 @@ } }, "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "requires": { - "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, "y18n": { diff --git a/package.json b/package.json index 10741f53cf094..f8ecc545b9e02 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", "which": "^2.0.2", - "write-file-atomic": "^2.4.3" + "write-file-atomic": "^3.0.3" }, "bundleDependencies": [ "@npmcli/arborist", From 4bdad5fdf6ef387e2159b529ba4652f0221433b5 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:16:14 -0400 Subject: [PATCH 14/39] bin-links@2.2.1 --- node_modules/bin-links/README.md | 16 ++ node_modules/bin-links/index.js | 2 + node_modules/bin-links/lib/check-bin.js | 71 ++++++ node_modules/bin-links/lib/check-bins.js | 16 ++ node_modules/bin-links/lib/fix-bin.js | 2 +- .../write-file-atomic/CHANGELOG.md | 25 -- .../node_modules/write-file-atomic/LICENSE | 6 - .../node_modules/write-file-atomic/README.md | 56 ----- .../node_modules/write-file-atomic/index.js | 238 ------------------ .../write-file-atomic/package.json | 41 --- node_modules/bin-links/package.json | 4 +- package-lock.json | 39 +-- package.json | 2 +- 13 files changed, 118 insertions(+), 400 deletions(-) create mode 100644 node_modules/bin-links/lib/check-bin.js create mode 100644 node_modules/bin-links/lib/check-bins.js delete mode 100644 node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md delete mode 100644 node_modules/bin-links/node_modules/write-file-atomic/LICENSE delete mode 100644 node_modules/bin-links/node_modules/write-file-atomic/README.md delete mode 100644 node_modules/bin-links/node_modules/write-file-atomic/index.js delete mode 100644 node_modules/bin-links/node_modules/write-file-atomic/package.json diff --git a/node_modules/bin-links/README.md b/node_modules/bin-links/README.md index 4e3a8b4070bc0..fb9d902109eb6 100644 --- a/node_modules/bin-links/README.md +++ b/node_modules/bin-links/README.md @@ -15,6 +15,7 @@ binaries and man pages for Javascript packages * [API](#api) * [`binLinks`](#binLinks) * [`binLinks.getPaths()`](#getPaths) + * [`binLinks.checkBins()`](#checkBins) ### Example @@ -67,6 +68,21 @@ created (assuming that they exist!) for the package at the specified path. Does not touch the filesystem. +#### `> binLinks.checkBins({path, pkg, global, top, force })` + +Checks if there are any conflicting bins which will prevent the linking of +bins for the given package. Returns a Promise that resolves with no value +if the way is clear, and rejects if there's something in the way. + +Always returns successfully if `global` or `top` are false, or if `force` +is true, or if the `pkg` object does not contain any bins to link. + +Note that changes to the file system _may_ still cause the `binLinks` +method to fail even if this method succeeds. Does not check for +conflicting `man` links. + +Reads from the filesystem but does not make any changes. + ##### Example ```javascript diff --git a/node_modules/bin-links/index.js b/node_modules/bin-links/index.js index c15b222f5fa77..2e8519737220a 100644 --- a/node_modules/bin-links/index.js +++ b/node_modules/bin-links/index.js @@ -33,9 +33,11 @@ const resetSeen = () => { linkGently.resetSeen() } +const checkBins = require('./lib/check-bins.js') const getPaths = require('./lib/get-paths.js') module.exports = Object.assign(binLinks, { + checkBins, resetSeen, getPaths, }) diff --git a/node_modules/bin-links/lib/check-bin.js b/node_modules/bin-links/lib/check-bin.js new file mode 100644 index 0000000000000..45eec8affc92a --- /dev/null +++ b/node_modules/bin-links/lib/check-bin.js @@ -0,0 +1,71 @@ +// check to see if a bin is allowed to be overwritten +// either rejects or resolves to nothing. return value not relevant. +const isWindows = require('./is-windows.js') +const binTarget = require('./bin-target.js') +const {resolve, dirname} = require('path') +const readCmdShim = require('read-cmd-shim') +const fs = require('fs') +const {promisify} = require('util') +const readlink = promisify(fs.readlink) + +const checkBin = async ({bin, path, top, global, force}) => { + // always ok to clobber when forced + // always ok to clobber local bins, or when forced + if (force || !global || !top) + return + + // ok, need to make sure, then + const target = resolve(binTarget({path, top}), bin) + path = resolve(path) + return isWindows ? checkShim({target, path}) : checkLink({target, path}) +} + +// only enoent is allowed. anything else is a problem. +const handleReadLinkError = async ({er, target}) => + er.code === 'ENOENT' ? null + : failEEXIST({target}) + +const checkLink = async ({target, path}) => { + const current = await readlink(target) + .catch(er => handleReadLinkError({er, target})) + + if (!current) + return + + const resolved = resolve(dirname(target), current) + + if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) + return failEEXIST({target}) +} + +const handleReadCmdShimError = ({er, target}) => + er.code === 'ENOENT' ? null + : failEEXIST({target}) + +const failEEXIST = ({target}) => + Promise.reject(Object.assign(new Error('EEXIST: file already exists'), { + path: target, + code: 'EEXIST', + })) + +const checkShim = async ({target, path}) => { + const shims = [ + target, + target + '.cmd', + target + '.ps1', + ] + await Promise.all(shims.map(async target => { + const current = await readCmdShim(target) + .catch(er => handleReadCmdShimError({er, target})) + + if (!current) + return + + const resolved = resolve(dirname(target), current.replace(/\\/g, '/')) + + if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) + return failEEXIST({target}) + })) +} + +module.exports = checkBin diff --git a/node_modules/bin-links/lib/check-bins.js b/node_modules/bin-links/lib/check-bins.js new file mode 100644 index 0000000000000..0addbffe55abb --- /dev/null +++ b/node_modules/bin-links/lib/check-bins.js @@ -0,0 +1,16 @@ +const checkBin = require('./check-bin.js') +const normalize = require('npm-normalize-package-bin') +const checkBins = async ({ pkg, path, top, global, force }) => { + // always ok to clobber when forced + // always ok to clobber local bins, or when forced + if (force || !global || !top) + return + + pkg = normalize(pkg) + if (!pkg.bin) + return + + await Promise.all(Object.keys(pkg.bin) + .map(bin => checkBin({bin, path, top, global, force}))) +} +module.exports = checkBins diff --git a/node_modules/bin-links/lib/fix-bin.js b/node_modules/bin-links/lib/fix-bin.js index 0f4d5fa02b7c5..a87a4d6945f69 100644 --- a/node_modules/bin-links/lib/fix-bin.js +++ b/node_modules/bin-links/lib/fix-bin.js @@ -5,7 +5,7 @@ const { promisify } = require('util') const execMode = 0o777 & (~process.umask()) -const writeFileAtomic = promisify(require('write-file-atomic')) +const writeFileAtomic = require('write-file-atomic') const open = promisify(fs.open) const close = promisify(fs.close) const read = promisify(fs.read) diff --git a/node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md b/node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md deleted file mode 100644 index 920ae2cb4d1fd..0000000000000 --- a/node_modules/bin-links/node_modules/write-file-atomic/CHANGELOG.md +++ /dev/null @@ -1,25 +0,0 @@ -# 2.4.3 - -* Ignore errors raised by `fs.closeSync` when cleaning up after a write - error. - -# 2.4.2 - -* A pair of patches to fix some fd leaks. We would leak fds with sync use - when errors occured and with async use any time fsync was not in use. (#34) - -# 2.4.1 - -* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35. - -# 2.4.0 - -## Features - -* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20) -* Support passing encoding strings in options slot for compat with Node.js API. (#31) -* Add support for running inside of worker threads (#37) - -## Fixes - -* Remove unneeded call when returning success (#36) diff --git a/node_modules/bin-links/node_modules/write-file-atomic/LICENSE b/node_modules/bin-links/node_modules/write-file-atomic/LICENSE deleted file mode 100644 index 95e65a7706e0e..0000000000000 --- a/node_modules/bin-links/node_modules/write-file-atomic/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - diff --git a/node_modules/bin-links/node_modules/write-file-atomic/README.md b/node_modules/bin-links/node_modules/write-file-atomic/README.md deleted file mode 100644 index ca28e99a2b08e..0000000000000 --- a/node_modules/bin-links/node_modules/write-file-atomic/README.md +++ /dev/null @@ -1,56 +0,0 @@ -write-file-atomic ------------------ - -This is an extension for node's `fs.writeFile` that makes its operation -atomic and allows you set ownership (uid/gid of the file). - -### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) - -* filename **String** -* data **String** | **Buffer** -* options **Object** | **String** - * chown **Object** default, uid & gid of existing file, if any - * uid **Number** - * gid **Number** - * encoding **String** | **Null** default = 'utf8' - * fsync **Boolean** default = true - * mode **Number** default, from existing file, if any - * Promise **Object** default = native Promise object -* callback **Function** - -Atomically and asynchronously writes data to a file, replacing the file if it already -exists. data can be a string or a buffer. - -The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. -Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. -If writeFile completes successfully then, if passed the **chown** option it will change -the ownership of the file. Finally it renames the file back to the filename you specified. If -it encounters errors at any of these steps it will attempt to unlink the temporary file and then -pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. - -If provided, the **chown** option requires both **uid** and **gid** properties or else -you'll get an error. If **chown** is not specified it will default to using -the owner of the previous file. To prevent chown from being ran you can -also pass `false`, in which case the file will be created with the current user's credentials. - -If **mode** is not specified, it will default to using the permissions from -an existing file, if any. Expicitly setting this to `false` remove this default, resulting -in a file created with the system default permissions. - -If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. - -If the **fsync** option is **false**, writeFile will skip the final fsync call. - -Example: - -```javascript -writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) - -The synchronous version of **writeFileAtomic**. diff --git a/node_modules/bin-links/node_modules/write-file-atomic/index.js b/node_modules/bin-links/node_modules/write-file-atomic/index.js deleted file mode 100644 index 64ae987c011a9..0000000000000 --- a/node_modules/bin-links/node_modules/write-file-atomic/index.js +++ /dev/null @@ -1,238 +0,0 @@ -'use strict' -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} - -// if we run inside of a worker_thread, `process.pid` is not unique -/* istanbul ignore next */ -var threadId = (function getId () { - try { - var workerThreads = require('worker_threads') - - /// if we are in main thread, this is set to `0` - return workerThreads.threadId - } catch (e) { - // worker_threads are not available, fallback to 0 - return 0 - } -})() - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(threadId)) - .hash(String(++invocations)) - .result() -} - -function cleanupOnExit (tmpfile) { - return function () { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} - } -} - -function writeFile (filename, data, options, callback) { - if (options) { - if (options instanceof Function) { - callback = options - options = {} - } else if (typeof options === 'string') { - options = { encoding: options } - } - } else { - options = {} - } - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] - - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (options.mode == null) { - options.mode = stats.mode - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - return new Promise(function (resolve, reject) { - if (options.fsync !== false) { - fs.fsync(fd, function (err) { - if (err) fs.close(fd, () => reject(err)) - else fs.close(fd, resolve) - }) - } else { - fs.close(fd, resolve) - } - }) - }).then(function chown () { - fd = null - if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function chmod () { - if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { - removeOnExitHandler() - callback() - }, function fail (err) { - return new Promise(resolve => { - return fd ? fs.close(fd, resolve) : resolve() - }).then(() => { - removeOnExitHandler() - fs.unlink(tmpfile, function () { - callback(err) - }) - }) - }).then(function checkQueue () { - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] - }) -} - -function writeFileSync (filename, data, options) { - if (typeof options === 'string') options = { encoding: options } - else if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) - - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - var fd - var cleanup = cleanupOnExit(tmpfile) - var removeOnExitHandler = onExit(cleanup) - - try { - fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - removeOnExitHandler() - } catch (err) { - if (fd) { - try { - fs.closeSync(fd) - } catch (ex) { - // ignore close errors at this stage, error may have closed fd already. - } - } - removeOnExitHandler() - cleanup() - throw err - } -} diff --git a/node_modules/bin-links/node_modules/write-file-atomic/package.json b/node_modules/bin-links/node_modules/write-file-atomic/package.json deleted file mode 100644 index bbb0fa23456eb..0000000000000 --- a/node_modules/bin-links/node_modules/write-file-atomic/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "write-file-atomic", - "version": "2.4.3", - "description": "Write files in an atomic fashion w/configurable ownership", - "main": "index.js", - "scripts": { - "test": "standard && tap --100 test/*.js", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" - }, - "repository": { - "type": "git", - "url": "git@github.com:iarna/write-file-atomic.git" - }, - "keywords": [ - "writeFile", - "atomic" - ], - "author": "Rebecca Turner (http://re-becca.org)", - "license": "ISC", - "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" - }, - "homepage": "https://github.com/iarna/write-file-atomic", - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^12.0.1", - "tap": "^12.1.3" - }, - "files": [ - "index.js" - ] -} diff --git a/node_modules/bin-links/package.json b/node_modules/bin-links/package.json index 696acc95c2dd7..b126fa16fa46b 100644 --- a/node_modules/bin-links/package.json +++ b/node_modules/bin-links/package.json @@ -1,6 +1,6 @@ { "name": "bin-links", - "version": "2.1.4", + "version": "2.2.1", "description": "JavaScript package binary linker", "main": "index.js", "scripts": { @@ -26,7 +26,7 @@ "npm-normalize-package-bin": "^1.0.0", "read-cmd-shim": "^2.0.0", "rimraf": "^3.0.0", - "write-file-atomic": "^2.3.0" + "write-file-atomic": "^3.0.3" }, "devDependencies": { "require-inject": "^1.4.4", diff --git a/package-lock.json b/package-lock.json index 06deef27e1cf3..6b51ce48f4b79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -96,7 +96,7 @@ "ansistyles": "~0.1.3", "aproba": "^2.0.0", "archy": "~1.0.0", - "bin-links": "^2.1.3", + "bin-links": "^2.2.1", "byte-size": "^7.0.0", "cacache": "^15.0.5", "chalk": "^4.1.0", @@ -898,9 +898,9 @@ } }, "node_modules/bin-links": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-2.1.4.tgz", - "integrity": "sha512-NIi7OWd1FelUfgNERBLpgSaRbbm6+wkMRfURuvfui31N0i9jmQYFXhPxL0d8rcnnbUB2Rw+DiCY4nU1Egdrugg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-2.2.1.tgz", + "integrity": "sha512-wFzVTqavpgCCYAh8SVBdnZdiQMxTkGR+T3b14CNpBXIBe2neJWaMGAZ55XWWHELJJ89dscuq0VCBqcVaIOgCMg==", "inBundle": true, "dependencies": { "cmd-shim": "^4.0.1", @@ -908,7 +908,7 @@ "npm-normalize-package-bin": "^1.0.0", "read-cmd-shim": "^2.0.0", "rimraf": "^3.0.0", - "write-file-atomic": "^2.3.0" + "write-file-atomic": "^3.0.3" }, "engines": { "node": ">=10" @@ -929,17 +929,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/bin-links/node_modules/write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "inBundle": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, "node_modules/binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -9239,16 +9228,16 @@ } }, "bin-links": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-2.1.4.tgz", - "integrity": "sha512-NIi7OWd1FelUfgNERBLpgSaRbbm6+wkMRfURuvfui31N0i9jmQYFXhPxL0d8rcnnbUB2Rw+DiCY4nU1Egdrugg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-2.2.1.tgz", + "integrity": "sha512-wFzVTqavpgCCYAh8SVBdnZdiQMxTkGR+T3b14CNpBXIBe2neJWaMGAZ55XWWHELJJ89dscuq0VCBqcVaIOgCMg==", "requires": { "cmd-shim": "^4.0.1", "mkdirp": "^1.0.3", "npm-normalize-package-bin": "^1.0.0", "read-cmd-shim": "^2.0.0", "rimraf": "^3.0.0", - "write-file-atomic": "^2.3.0" + "write-file-atomic": "^3.0.3" }, "dependencies": { "rimraf": { @@ -9258,16 +9247,6 @@ "requires": { "glob": "^7.1.3" } - }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } } } }, diff --git a/package.json b/package.json index f8ecc545b9e02..1a15bc35c409e 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "ansistyles": "~0.1.3", "aproba": "^2.0.0", "archy": "~1.0.0", - "bin-links": "^2.1.3", + "bin-links": "^2.2.1", "byte-size": "^7.0.0", "cacache": "^15.0.5", "chalk": "^4.1.0", From a07b421f708c13d8239e7283ad89611b24b23d0a Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:27:51 -0400 Subject: [PATCH 15/39] chore: removed unused lincesee dev-dep --- package-lock.json | 376 ---------------------------------------------- package.json | 1 - 2 files changed, 377 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b51ce48f4b79..6f3516dc18f62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,7 +174,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "licensee": "^8.1.0", "marked": "^0.6.3", "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", @@ -384,12 +383,6 @@ "to-fast-properties": "^2.0.0" } }, - "node_modules/@blueoak/list": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@blueoak/list/-/list-1.0.2.tgz", - "integrity": "sha512-KyqT0kkdxgbGys9mvo/1Mgdt/LGvUFPCZIK9pWPIfOM2mYzMDd/eVYy4sMP1YqvVI129k0alxRyM53H2MAs/Nw==", - "dev": true - }, "node_modules/@eslint/eslintrc": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", @@ -777,15 +770,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "node_modules/array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -1411,15 +1395,6 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "inBundle": true }, - "node_modules/correct-license-metadata": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/correct-license-metadata/-/correct-license-metadata-1.4.0.tgz", - "integrity": "sha512-nvbNpK/aYCbztZWGi9adIPqR+ZcQmZTWNT7eMYLvkaVGroN1nTHiVuuNPl7pK6ZNx1mvDztlRBJtfUdrVwKJ5A==", - "dev": true, - "dependencies": { - "spdx-expression-validate": "^2.0.0" - } - }, "node_modules/coveralls": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", @@ -1608,15 +1583,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/docopt": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", - "integrity": "sha1-so6eIiDaXsSffqW7JKR3h0Be6xE=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2435,19 +2401,6 @@ "node": "*" } }, - "node_modules/fs-access": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-2.0.0.tgz", - "integrity": "sha512-Vt45hBKJrYDQeAD9ja43liw8JfK75uB7XexIXWEtDKwFLQNmzmvuulh28hRxexxuFm0zsGGq7nISGQSK6KnGrA==", - "deprecated": "This package is no longer relevant as Node.js 0.12 is unmaintained.", - "dev": true, - "dependencies": { - "null-check": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fs-exists-cached": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", @@ -3403,12 +3356,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "node_modules/json-parse-errback": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/json-parse-errback/-/json-parse-errback-2.0.1.tgz", - "integrity": "sha1-x6nCvjqFWzQvgqv8ibyFk1tYhPo=", - "dev": true - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -3635,41 +3582,6 @@ "stringify-package": "^1.0.1" } }, - "node_modules/licensee": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/licensee/-/licensee-8.1.0.tgz", - "integrity": "sha512-rnXUmUuLzZrGfm3bfWNl71Emw/OJqwUyIrIRq5D06Ct9EbiFnZtiydA5ryf4FDPikdneJ0l1Q+g6TuMjpWGfrA==", - "dev": true, - "dependencies": { - "@blueoak/list": "^1.0.2", - "correct-license-metadata": "^1.0.1", - "docopt": "^0.6.2", - "fs-access": "^2.0.0", - "has": "^1.0.3", - "json-parse-errback": "^2.0.1", - "npm-license-corrections": "^1.0.0", - "read-package-tree": "^5.3.1", - "run-parallel": "^1.1.9", - "semver": "^6.3.0", - "simple-concat": "^1.0.0", - "spdx-expression-parse": "^3.0.0", - "spdx-expression-validate": "^2.0.0", - "spdx-osi": "^3.0.0", - "spdx-whitelisted": "^1.0.0" - }, - "bin": { - "licensee": "licensee" - } - }, - "node_modules/licensee/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -4207,12 +4119,6 @@ "node": ">=10" } }, - "node_modules/npm-license-corrections": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/npm-license-corrections/-/npm-license-corrections-1.3.1.tgz", - "integrity": "sha512-Uf3e0YizcUlEjvj9d13eeoJ7FKevsssia9XZFPiJCbNxFj7EnvS6GeGaGwF4zjEu0MuHptrUNoJuD86Px6HWdQ==", - "dev": true - }, "node_modules/npm-normalize-package-bin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", @@ -4322,15 +4228,6 @@ "set-blocking": "~2.0.0" } }, - "node_modules/null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -4512,22 +4409,6 @@ "node": ">= 0.4" } }, - "node_modules/object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object.values": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", @@ -5061,17 +4942,6 @@ "npm-normalize-package-bin": "^1.0.1" } }, - "node_modules/read-package-tree": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", - "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", - "dev": true, - "dependencies": { - "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0", - "util-promisify": "^2.1.0" - } - }, "node_modules/read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -5286,12 +5156,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5358,26 +5222,6 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "inBundle": true }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -5550,17 +5394,6 @@ "which": "bin/which" } }, - "node_modules/spdx-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", - "integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==", - "dev": true, - "dependencies": { - "array-find-index": "^1.0.2", - "spdx-expression-parse": "^3.0.0", - "spdx-ranges": "^2.0.0" - } - }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -5587,43 +5420,12 @@ "spdx-license-ids": "^3.0.0" } }, - "node_modules/spdx-expression-validate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz", - "integrity": "sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "inBundle": true }, - "node_modules/spdx-osi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-osi/-/spdx-osi-3.0.0.tgz", - "integrity": "sha512-7DZMaD/rNHWGf82qWOazBsLXQsaLsoJb9RRjhEUQr5o86kw3A1ErGzSdvaXl+KalZyKkkU5T2a5NjCCutAKQSw==", - "dev": true - }, - "node_modules/spdx-ranges": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz", - "integrity": "sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==", - "dev": true - }, - "node_modules/spdx-whitelisted": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spdx-whitelisted/-/spdx-whitelisted-1.0.0.tgz", - "integrity": "sha512-X4FOpUCvZuo42MdB1zAZ/wdX4N0lLcWDozf2KYFVDgtLv8Lx+f31LOYLP2/FcwTzsPi64bS/VwKqklI4RBletg==", - "dev": true, - "dependencies": { - "spdx-compare": "^1.0.0", - "spdx-ranges": "^2.0.0" - } - }, "node_modules/sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", @@ -8228,15 +8030,6 @@ "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", "dev": true }, - "node_modules/util-promisify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", - "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", - "dev": true, - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3" - } - }, "node_modules/uuid": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", @@ -8826,12 +8619,6 @@ "to-fast-properties": "^2.0.0" } }, - "@blueoak/list": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@blueoak/list/-/list-1.0.2.tgz", - "integrity": "sha512-KyqT0kkdxgbGys9mvo/1Mgdt/LGvUFPCZIK9pWPIfOM2mYzMDd/eVYy4sMP1YqvVI129k0alxRyM53H2MAs/Nw==", - "dev": true - }, "@eslint/eslintrc": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", @@ -9139,12 +8926,6 @@ } } }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, "array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -9614,15 +9395,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "correct-license-metadata": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/correct-license-metadata/-/correct-license-metadata-1.4.0.tgz", - "integrity": "sha512-nvbNpK/aYCbztZWGi9adIPqR+ZcQmZTWNT7eMYLvkaVGroN1nTHiVuuNPl7pK6ZNx1mvDztlRBJtfUdrVwKJ5A==", - "dev": true, - "requires": { - "spdx-expression-validate": "^2.0.0" - } - }, "coveralls": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", @@ -9763,12 +9535,6 @@ "integrity": "sha512-6/v2PC/6UTGcWPPetb9acL8foberUg/CtPdALeJUdD1B/weHNvzftoo00gYznqHGRhHEbykUGzqfG9RWOSr5yw==", "dev": true }, - "docopt": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", - "integrity": "sha1-so6eIiDaXsSffqW7JKR3h0Be6xE=", - "dev": true - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -10418,15 +10184,6 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, - "fs-access": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-2.0.0.tgz", - "integrity": "sha512-Vt45hBKJrYDQeAD9ja43liw8JfK75uB7XexIXWEtDKwFLQNmzmvuulh28hRxexxuFm0zsGGq7nISGQSK6KnGrA==", - "dev": true, - "requires": { - "null-check": "^1.0.0" - } - }, "fs-exists-cached": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", @@ -11139,12 +10896,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-parse-errback": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/json-parse-errback/-/json-parse-errback-2.0.1.tgz", - "integrity": "sha1-x6nCvjqFWzQvgqv8ibyFk1tYhPo=", - "dev": true - }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -11313,37 +11064,6 @@ "stringify-package": "^1.0.1" } }, - "licensee": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/licensee/-/licensee-8.1.0.tgz", - "integrity": "sha512-rnXUmUuLzZrGfm3bfWNl71Emw/OJqwUyIrIRq5D06Ct9EbiFnZtiydA5ryf4FDPikdneJ0l1Q+g6TuMjpWGfrA==", - "dev": true, - "requires": { - "@blueoak/list": "^1.0.2", - "correct-license-metadata": "^1.0.1", - "docopt": "^0.6.2", - "fs-access": "^2.0.0", - "has": "^1.0.3", - "json-parse-errback": "^2.0.1", - "npm-license-corrections": "^1.0.0", - "read-package-tree": "^5.3.1", - "run-parallel": "^1.1.9", - "semver": "^6.3.0", - "simple-concat": "^1.0.0", - "spdx-expression-parse": "^3.0.0", - "spdx-expression-validate": "^2.0.0", - "spdx-osi": "^3.0.0", - "spdx-whitelisted": "^1.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -11744,12 +11464,6 @@ "semver": "^7.1.1" } }, - "npm-license-corrections": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/npm-license-corrections/-/npm-license-corrections-1.3.1.tgz", - "integrity": "sha512-Uf3e0YizcUlEjvj9d13eeoJ7FKevsssia9XZFPiJCbNxFj7EnvS6GeGaGwF4zjEu0MuHptrUNoJuD86Px6HWdQ==", - "dev": true - }, "npm-normalize-package-bin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", @@ -11836,12 +11550,6 @@ "set-blocking": "~2.0.0" } }, - "null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", - "dev": true - }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -11974,16 +11682,6 @@ "object-keys": "^1.0.11" } }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, "object.values": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", @@ -12379,17 +12077,6 @@ "npm-normalize-package-bin": "^1.0.1" } }, - "read-package-tree": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", - "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", - "dev": true, - "requires": { - "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0", - "util-promisify": "^2.1.0" - } - }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -12552,12 +12239,6 @@ "glob": "^7.1.3" } }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -12606,12 +12287,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, - "simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true - }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -12750,17 +12425,6 @@ } } }, - "spdx-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", - "integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==", - "dev": true, - "requires": { - "array-find-index": "^1.0.2", - "spdx-expression-parse": "^3.0.0", - "spdx-ranges": "^2.0.0" - } - }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -12784,42 +12448,11 @@ "spdx-license-ids": "^3.0.0" } }, - "spdx-expression-validate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz", - "integrity": "sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0" - } - }, "spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" }, - "spdx-osi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-osi/-/spdx-osi-3.0.0.tgz", - "integrity": "sha512-7DZMaD/rNHWGf82qWOazBsLXQsaLsoJb9RRjhEUQr5o86kw3A1ErGzSdvaXl+KalZyKkkU5T2a5NjCCutAKQSw==", - "dev": true - }, - "spdx-ranges": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz", - "integrity": "sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==", - "dev": true - }, - "spdx-whitelisted": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spdx-whitelisted/-/spdx-whitelisted-1.0.0.tgz", - "integrity": "sha512-X4FOpUCvZuo42MdB1zAZ/wdX4N0lLcWDozf2KYFVDgtLv8Lx+f31LOYLP2/FcwTzsPi64bS/VwKqklI4RBletg==", - "dev": true, - "requires": { - "spdx-compare": "^1.0.0", - "spdx-ranges": "^2.0.0" - } - }, "sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", @@ -14789,15 +14422,6 @@ "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", "dev": true }, - "util-promisify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", - "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3" - } - }, "uuid": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", diff --git a/package.json b/package.json index 1a15bc35c409e..d42962088eea3 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "licensee": "^8.1.0", "marked": "^0.6.3", "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", From ea8dfe553db06fcaa99bfe0314303d0c07ab2974 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:29:21 -0400 Subject: [PATCH 16/39] chore: marked is a peer dep of marked-man --- package-lock.json | 8 ++++---- package.json | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f3516dc18f62..314942f8cd377 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,7 +174,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "marked": "^0.6.3", "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", "npm-registry-mock": "^1.3.0", @@ -3738,6 +3737,7 @@ "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.3.tgz", "integrity": "sha512-Fqa7eq+UaxfMriqzYLayfqAE40WN03jf+zHjT18/uXNuzjq3TY0XTbrAoPeqSJrAmPz11VuUA+kBPYOhHt9oOQ==", "dev": true, + "peer": true, "bin": { "marked": "bin/marked" }, @@ -11187,10 +11187,10 @@ } }, "marked": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.3.tgz", + "version": "https://registry.npmjs.org/marked/-/marked-0.6.3.tgz", "integrity": "sha512-Fqa7eq+UaxfMriqzYLayfqAE40WN03jf+zHjT18/uXNuzjq3TY0XTbrAoPeqSJrAmPz11VuUA+kBPYOhHt9oOQ==", - "dev": true + "dev": true, + "peer": true }, "marked-man": { "version": "0.7.0", diff --git a/package.json b/package.json index d42962088eea3..db65ef32b0460 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "marked": "^0.6.3", "marked-man": "^0.7.0", "npm-cache-filename": "^1.0.2", "npm-registry-mock": "^1.3.0", From 41126e165d3d5625a55e140b84fdd02052520146 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:30:45 -0400 Subject: [PATCH 17/39] chore: remove unused npm-cache-filename dev-dep --- package-lock.json | 13 ------------- package.json | 1 - 2 files changed, 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 314942f8cd377..3181f14bdb93b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -175,7 +175,6 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", - "npm-cache-filename": "^1.0.2", "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", @@ -4101,12 +4100,6 @@ "npm-normalize-package-bin": "^1.0.1" } }, - "node_modules/npm-cache-filename": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz", - "integrity": "sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE=", - "dev": true - }, "node_modules/npm-install-checks": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", @@ -11450,12 +11443,6 @@ "npm-normalize-package-bin": "^1.0.1" } }, - "npm-cache-filename": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz", - "integrity": "sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE=", - "dev": true - }, "npm-install-checks": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", diff --git a/package.json b/package.json index db65ef32b0460..4ba43f0469445 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,6 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", - "npm-cache-filename": "^1.0.2", "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", From 130da51b553e550584f31e2a8a961f4338f2a0cd Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:32:18 -0400 Subject: [PATCH 18/39] chore: remove unused npm-registry-mock dev-dep --- node_modules/.gitignore | 23 -------------- package-lock.json | 70 ----------------------------------------- package.json | 1 - 3 files changed, 94 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 012498eedd4fc..8da9176e5608a 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -12,7 +12,6 @@ package-lock.json /@babel/template /@babel/traverse /@babel/types -/@blueoak/list /@eslint/eslintrc /@types/json5 /acorn @@ -22,7 +21,6 @@ package-lock.json /append-transform /arg /argparse -/array-find-index /array-includes /array.prototype.flat /astral-regex @@ -41,7 +39,6 @@ package-lock.json /commondir /contains-path /convert-source-map -/correct-license-metadata /coveralls /cp-file /cross-spawn @@ -51,7 +48,6 @@ package-lock.json /define-properties /diff /diff-frag -/docopt /doctrine /emoji-regex /enquirer @@ -90,7 +86,6 @@ package-lock.json /flow-parser /flow-remove-types /foreground-child -/fs-access /fs-exists-cached /fsevents /function-bind @@ -102,7 +97,6 @@ package-lock.json /has /has-symbols /hasha -/hock /html-escaper /ignore /import-fresh @@ -129,11 +123,9 @@ package-lock.json /js-yaml /jsesc /json-parse-better-errors -/json-parse-errback /json-stable-stringify-without-jsonify /lcov-parse /levn -/licensee /load-json-file /locate-path /lodash @@ -151,15 +143,10 @@ package-lock.json /nice-try /node-modules-regexp /normalize-path -/npm-cache-filename -/npm-license-corrections -/npm-registry-mock -/null-check /nyc /object-inspect /object-keys /object.assign -/object.getownpropertydescriptors /object.values /optionator /own-or @@ -183,7 +170,6 @@ package-lock.json /pseudomap /react /react-is -/read-package-tree /read-pkg /read-pkg-up /readdirp @@ -193,19 +179,12 @@ package-lock.json /require-inject /require-main-filename /resolve-from -/run-parallel /shebang-command /shebang-regex -/simple-concat /slice-ansi /source-map /source-map-support /spawn-wrap -/spdx-compare -/spdx-expression-validate -/spdx-osi -/spdx-ranges -/spdx-whitelisted /sprintf-js /stack-utils /string.prototype.trimend @@ -228,8 +207,6 @@ package-lock.json /type-fest /typescript /unicode-length -/util-extend -/util-promisify /v8-compile-cache /vlq /which-module diff --git a/package-lock.json b/package-lock.json index 3181f14bdb93b..996f95dd944ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -175,7 +175,6 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", - "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", "tap": "^14.10.8" @@ -2648,24 +2647,6 @@ "node": ">=4" } }, - "node_modules/hock": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/hock/-/hock-0.2.5.tgz", - "integrity": "sha1-Fk+wUFRMRqM27RmRby8GMAhY0/8=", - "dev": true, - "dependencies": { - "deep-equal": "0.2.1" - }, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/hock/node_modules/deep-equal": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.1.tgz", - "integrity": "sha1-+tenkyJMvww8d4b5LveA5PyMyHg=", - "dev": true - }, "node_modules/hosted-git-info": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.5.tgz", @@ -4192,17 +4173,6 @@ "node": ">=10" } }, - "node_modules/npm-registry-mock": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/npm-registry-mock/-/npm-registry-mock-1.3.1.tgz", - "integrity": "sha512-UWg3QEnW/sQbQ6/esApzSkEWzuXJUCz8VDgZWfnKmMPG5KTlvfLqDm1x0rP08w3XvzuZWte1JaNOaHzjILgMfg==", - "dev": true, - "dependencies": { - "hock": "~0.2.5", - "readdir-scoped-modules": "^1.1.0", - "util-extend": "^1.0.3" - } - }, "node_modules/npm-user-validate": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.0.tgz", @@ -8017,12 +7987,6 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "inBundle": true }, - "node_modules/util-extend": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", - "dev": true - }, "node_modules/uuid": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", @@ -10359,23 +10323,6 @@ "is-stream": "^1.0.1" } }, - "hock": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/hock/-/hock-0.2.5.tgz", - "integrity": "sha1-Fk+wUFRMRqM27RmRby8GMAhY0/8=", - "dev": true, - "requires": { - "deep-equal": "0.2.1" - }, - "dependencies": { - "deep-equal": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.1.tgz", - "integrity": "sha1-+tenkyJMvww8d4b5LveA5PyMyHg=", - "dev": true - } - } - }, "hosted-git-info": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.5.tgz", @@ -11510,17 +11457,6 @@ "npm-package-arg": "^8.0.0" } }, - "npm-registry-mock": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/npm-registry-mock/-/npm-registry-mock-1.3.1.tgz", - "integrity": "sha512-UWg3QEnW/sQbQ6/esApzSkEWzuXJUCz8VDgZWfnKmMPG5KTlvfLqDm1x0rP08w3XvzuZWte1JaNOaHzjILgMfg==", - "dev": true, - "requires": { - "hock": "~0.2.5", - "readdir-scoped-modules": "^1.1.0", - "util-extend": "^1.0.3" - } - }, "npm-user-validate": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.0.tgz", @@ -14403,12 +14339,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "util-extend": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", - "dev": true - }, "uuid": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", diff --git a/package.json b/package.json index 4ba43f0469445..aabedbf7d37be 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,6 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", - "npm-registry-mock": "^1.3.0", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", "tap": "^14.10.8" From b355af48696bb5001c6d2b938974d9ab9f5e2360 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:34:26 -0400 Subject: [PATCH 19/39] chore: remove unused sprintf-js dev-dep --- node_modules/.gitignore | 1 - package-lock.json | 13 ------------- package.json | 1 - 3 files changed, 15 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 8da9176e5608a..1d56c819934b1 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -185,7 +185,6 @@ package-lock.json /source-map /source-map-support /spawn-wrap -/sprintf-js /stack-utils /string.prototype.trimend /string.prototype.trimstart diff --git a/package-lock.json b/package-lock.json index 996f95dd944ea..fa3cb383ac988 100644 --- a/package-lock.json +++ b/package-lock.json @@ -176,7 +176,6 @@ "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", "require-inject": "^1.4.4", - "sprintf-js": "^1.1.2", "tap": "^14.10.8" }, "engines": { @@ -5389,12 +5388,6 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "inBundle": true }, - "node_modules/sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true - }, "node_modules/sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -12376,12 +12369,6 @@ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" }, - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true - }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", diff --git a/package.json b/package.json index aabedbf7d37be..63c355888802b 100644 --- a/package.json +++ b/package.json @@ -205,7 +205,6 @@ "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", "require-inject": "^1.4.4", - "sprintf-js": "^1.1.2", "tap": "^14.10.8" }, "scripts": { From 721c0a8736f3cd0a0e75e0b89518a431553843c6 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:38:26 -0400 Subject: [PATCH 20/39] chore: remove unused uid-number dep --- node_modules/uid-number/LICENSE | 15 ------- node_modules/uid-number/README.md | 17 -------- node_modules/uid-number/get-uid-gid.js | 24 ----------- node_modules/uid-number/package.json | 18 -------- node_modules/uid-number/uid-number.js | 59 -------------------------- package-lock.json | 16 ------- package.json | 2 - 7 files changed, 151 deletions(-) delete mode 100644 node_modules/uid-number/LICENSE delete mode 100644 node_modules/uid-number/README.md delete mode 100755 node_modules/uid-number/get-uid-gid.js delete mode 100644 node_modules/uid-number/package.json delete mode 100644 node_modules/uid-number/uid-number.js diff --git a/node_modules/uid-number/LICENSE b/node_modules/uid-number/LICENSE deleted file mode 100644 index 05eeeb88c2ef4..0000000000000 --- a/node_modules/uid-number/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/uid-number/README.md b/node_modules/uid-number/README.md deleted file mode 100644 index 81166753aba55..0000000000000 --- a/node_modules/uid-number/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Use this module to convert a username/groupname to a uid/gid number. - -Usage: - -``` -npm install uid-number -``` - -Then, in your node program: - -```javascript -var uidNumber = require("uid-number") -uidNumber("isaacs", function (er, uid, gid) { - // gid is null because we didn't ask for a group name - // uid === 24561 because that's my number. -}) -``` diff --git a/node_modules/uid-number/get-uid-gid.js b/node_modules/uid-number/get-uid-gid.js deleted file mode 100755 index 0b391748a9327..0000000000000 --- a/node_modules/uid-number/get-uid-gid.js +++ /dev/null @@ -1,24 +0,0 @@ -if (module !== require.main) { - throw new Error("This file should not be loaded with require()") -} - -if (!process.getuid || !process.getgid) { - throw new Error("this file should not be called without uid/gid support") -} - -var argv = process.argv.slice(2) - , user = argv[0] || process.getuid() - , group = argv[1] || process.getgid() - -if (!isNaN(user)) user = +user -if (!isNaN(group)) group = +group - -console.error([user, group]) - -try { - process.setgid(group) - process.setuid(user) - console.log(JSON.stringify({uid:+process.getuid(), gid:+process.getgid()})) -} catch (ex) { - console.log(JSON.stringify({error:ex.message,errno:ex.errno})) -} diff --git a/node_modules/uid-number/package.json b/node_modules/uid-number/package.json deleted file mode 100644 index 616223f68bcc9..0000000000000 --- a/node_modules/uid-number/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "name": "uid-number", - "description": "Convert a username/group name to a uid/gid number", - "version": "0.0.6", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/uid-number.git" - }, - "main": "uid-number.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "license": "ISC" -} diff --git a/node_modules/uid-number/uid-number.js b/node_modules/uid-number/uid-number.js deleted file mode 100644 index bd62184fda7a9..0000000000000 --- a/node_modules/uid-number/uid-number.js +++ /dev/null @@ -1,59 +0,0 @@ -module.exports = uidNumber - -// This module calls into get-uid-gid.js, which sets the -// uid and gid to the supplied argument, in order to find out their -// numeric value. This can't be done in the main node process, -// because otherwise node would be running as that user from this -// point on. - -var child_process = require("child_process") - , path = require("path") - , uidSupport = process.getuid && process.setuid - , uidCache = {} - , gidCache = {} - -function uidNumber (uid, gid, cb) { - if (!uidSupport) return cb() - if (typeof cb !== "function") cb = gid, gid = null - if (typeof cb !== "function") cb = uid, uid = null - if (gid == null) gid = process.getgid() - if (uid == null) uid = process.getuid() - if (!isNaN(gid)) gid = gidCache[gid] = +gid - if (!isNaN(uid)) uid = uidCache[uid] = +uid - - if (uidCache.hasOwnProperty(uid)) uid = uidCache[uid] - if (gidCache.hasOwnProperty(gid)) gid = gidCache[gid] - - if (typeof gid === "number" && typeof uid === "number") { - return process.nextTick(cb.bind(null, null, uid, gid)) - } - - var getter = require.resolve("./get-uid-gid.js") - - child_process.execFile( process.execPath - , [getter, uid, gid] - , function (code, out, stderr) { - if (code) { - var er = new Error("could not get uid/gid\n" + stderr) - er.code = code - return cb(er) - } - - try { - out = JSON.parse(out+"") - } catch (ex) { - return cb(ex) - } - - if (out.error) { - var er = new Error(out.error) - er.errno = out.errno - return cb(er) - } - - if (isNaN(out.uid) || isNaN(out.gid)) return cb(new Error( - "Could not get uid/gid: "+JSON.stringify(out))) - - cb(null, uidCache[uid] = +out.uid, gidCache[gid] = +out.gid) - }) -} diff --git a/package-lock.json b/package-lock.json index fa3cb383ac988..8b42fe9d0fdf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,6 @@ "tar", "text-table", "tiny-relative-date", - "uid-number", "umask", "uuid", "validate-npm-package-name", @@ -157,7 +156,6 @@ "tar": "^6.0.5", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "uid-number": "0.0.6", "umask": "~1.1.0", "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", @@ -7922,15 +7920,6 @@ "node": ">=4.2.0" } }, - "node_modules/uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", - "inBundle": true, - "engines": { - "node": "*" - } - }, "node_modules/umask": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", @@ -14277,11 +14266,6 @@ "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, - "uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=" - }, "umask": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", diff --git a/package.json b/package.json index 63c355888802b..9e01314557199 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "tar": "^6.0.5", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "uid-number": "0.0.6", "umask": "~1.1.0", "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", @@ -190,7 +189,6 @@ "tar", "text-table", "tiny-relative-date", - "uid-number", "umask", "uuid", "validate-npm-package-name", From 9c920e5f584e4d912aabc6e412693f7142242a89 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:44:30 -0400 Subject: [PATCH 21/39] chore: remove unused umask dep --- lib/utils/umask.js | 17 --- node_modules/umask/.npmignore | 28 ----- node_modules/umask/ChangeLog | 9 -- node_modules/umask/LICENSE | 22 ---- node_modules/umask/README.md | 78 -------------- node_modules/umask/index.js | 77 -------------- node_modules/umask/package.json | 28 ----- node_modules/umask/test/simple.js | 166 ------------------------------ package-lock.json | 13 --- package.json | 2 - 10 files changed, 440 deletions(-) delete mode 100644 lib/utils/umask.js delete mode 100644 node_modules/umask/.npmignore delete mode 100644 node_modules/umask/ChangeLog delete mode 100644 node_modules/umask/LICENSE delete mode 100644 node_modules/umask/README.md delete mode 100644 node_modules/umask/index.js delete mode 100644 node_modules/umask/package.json delete mode 100644 node_modules/umask/test/simple.js diff --git a/lib/utils/umask.js b/lib/utils/umask.js deleted file mode 100644 index 2dde1befa69dc..0000000000000 --- a/lib/utils/umask.js +++ /dev/null @@ -1,17 +0,0 @@ -var umask = require('umask') -var npmlog = require('npmlog') -var _fromString = umask.fromString - -module.exports = umask - -// fromString with logging callback -umask.fromString = function (val) { - _fromString(val, function (err, result) { - if (err) { - npmlog.warn('invalid umask', err.message) - } - val = result - }) - - return val -} diff --git a/node_modules/umask/.npmignore b/node_modules/umask/.npmignore deleted file mode 100644 index 59d842baa84c8..0000000000000 --- a/node_modules/umask/.npmignore +++ /dev/null @@ -1,28 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript diff --git a/node_modules/umask/ChangeLog b/node_modules/umask/ChangeLog deleted file mode 100644 index 1254674513b6f..0000000000000 --- a/node_modules/umask/ChangeLog +++ /dev/null @@ -1,9 +0,0 @@ -2015-01-15 Sam Mikes - - * index.js: (convert_fromString) accept decimal strings provided they - don't begin with '0' - -2015-01-14 Sam Mikes - - * index.js: initial rev - diff --git a/node_modules/umask/LICENSE b/node_modules/umask/LICENSE deleted file mode 100644 index e637724b3bc59..0000000000000 --- a/node_modules/umask/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Sam Mikes - -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/umask/README.md b/node_modules/umask/README.md deleted file mode 100644 index 80009ae709b2c..0000000000000 --- a/node_modules/umask/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# umask - -Convert umask from string <-> number. - -## Installation & Use - -``` -$ npm install -S umask - -var umask = require('umask'); - -console.log(umask.toString(18)); // 0022 - -console.log(umask.fromString('0777')) // 511 -``` - -## API - -### `toString( val )` - -Converts `val` to a 0-padded octal string. `val` is assumed to be a -Number in the correct range (0..511) - -### `fromString( val, [cb] )` - -Converts `val` to a Number that can be used as a umask. `val` can -be of the following forms: - - * String containing octal number (leading 0) - * String containing decimal number - * Number - -In all cases above, the value obtained is then converted to an integer and -checked against the legal `umask` range 0..511 - -`fromString` can be used as a simple converter, with no error feedback, by -omitting the optional callback argument `cb`: - -``` - var mask = umask.fromString(val); - - // mask is now the umask descibed by val or - // the default, 0022 (18 dec) -``` - -The callback arguments are `(err, val)` where `err` is either `null` or an -Error object and `val` is either the converted umask or the default umask, `0022`. - -``` - umask.fromString(val, function (err, val) { - if (err) { - console.error("invalid umask: " + err.message) - } - - /* do something with val */ - }); -``` - -The callback, if provided, is always called **synchronously**. - -### `validate( data, k, val )` - -This is a validation function of the form expected by `nopt`. If -`val` is a valid umask, the function returns true and sets `data[k]`. -If `val` is not a valid umask, the function returns false. - -The `validate` function is stricter than `fromString`: it only accepts -Number or octal String values, and the String value must begin with `0`. -The `validate` function does **not** accept Strings containing decimal -numbers. - -# Maintainer - -Sam Mikes - -# License - -MIT \ No newline at end of file diff --git a/node_modules/umask/index.js b/node_modules/umask/index.js deleted file mode 100644 index 501c0e0c05cb5..0000000000000 --- a/node_modules/umask/index.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var util = require("util"); - -function toString(val) { - val = val.toString(8); - while (val.length < 4) { - val = "0" + val; - } - return val; -} - -var defaultUmask = 18; // 0022; -var defaultUmaskString = toString(defaultUmask); - -function validate(data, k, val) { - // must be either an integer or an octal string. - if (typeof val === "number" && !isNaN(val)) { - data[k] = val; - return true; - } - - if (typeof val === "string") { - if (val.charAt(0) !== "0") { - return false; - } - data[k] = parseInt(val, 8); - return true; - } - - return false; -} - -function convert_fromString(val, cb) { - if (typeof val === "string") { - // check for octal string first - if (val.charAt(0) === '0' && /^[0-7]+$/.test(val)) { - val = parseInt(val, 8); - } else if (val.charAt(0) !== '0' && /^[0-9]+$/.test(val)) { - // legacy support for decimal strings - val = parseInt(val, 10); - } else { - return cb(new Error(util.format("Expected octal string, got %j, defaulting to %j", - val, defaultUmaskString)), - defaultUmask); - } - } else if (typeof val !== "number") { - return cb(new Error(util.format("Expected number or octal string, got %j, defaulting to %j", - val, defaultUmaskString)), - defaultUmask); - } - - val = Math.floor(val); - - if ((val < 0) || (val > 511)) { - return cb(new Error(util.format("Must be in range 0..511 (0000..0777), got %j", val)), - defaultUmask); - } - - cb(null, val); -} - -function fromString(val, cb) { - - // synchronous callback, no zalgo - convert_fromString(val, cb || function (err, result) { - /*jslint unparam:true*/ - val = result; - }); - - return val; -} - -exports.toString = toString; -exports.fromString = fromString; -exports.validate = validate; - diff --git a/node_modules/umask/package.json b/node_modules/umask/package.json deleted file mode 100644 index a59835a0b5d02..0000000000000 --- a/node_modules/umask/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "umask", - "version": "1.1.0", - "description": "convert umask from string <-> number", - "main": "index.js", - "scripts": { - "test": "lab -ct 100", - "lint": "jslint --terse --latest *.js test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/smikes/umask.git" - }, - "keywords": [ - "umask" - ], - "author": "Sam Mikes ", - "license": "MIT", - "bugs": { - "url": "https://github.com/smikes/umask/issues" - }, - "homepage": "https://github.com/smikes/umask", - "devDependencies": { - "code": "^1.2.1", - "jslint": "^0.7.2", - "lab": "^5.2.0" - } -} diff --git a/node_modules/umask/test/simple.js b/node_modules/umask/test/simple.js deleted file mode 100644 index 8f29ae745a47f..0000000000000 --- a/node_modules/umask/test/simple.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; - -var umask = require('..'); - -var Code = require('code'); -var Lab = require('lab'); -var lab = Lab.script(); -exports.lab = lab; - -var describe = lab.describe; -var it = lab.it; -var expect = Code.expect; - -describe('validates umask', function () { - // signature of validator: validate(obj, key, val) - // store valid value in obj[key] - // return false if invalid - - it('accepts numbers', function (done) { - var o = {}, - result = false; - - result = umask.validate(o, 'umask', 0); - expect(result).to.equal(true); - expect(o.umask).to.equal(0); - - result = umask.validate(o, 'umask', 511); - expect(result).to.equal(true); - expect(o.umask).to.equal(511); - done(); - }); - - it('accepts strings', function (done) { - var o = {}, - result; - - result = umask.validate(o, 'umask', "0"); - expect(result).to.equal(true); - expect(o.umask).to.equal(0); - - result = umask.validate(o, 'umask', "0777"); - expect(result).to.equal(true); - expect(o.umask).to.equal(511); - - done(); - }); - - it('rejects other types', function (done) { - expect(umask.validate(undefined, undefined, false)).to.equal(false); - expect(umask.validate(undefined, undefined, {})).to.equal(false); - - done(); - }); - - it('rejects non-octalish strings', function (done) { - expect(umask.validate(undefined, undefined, "1")).to.equal(false); - - done(); - }); - - it('rejects NaN strings', function (done) { - expect(umask.validate(undefined, undefined, NaN)).to.equal(false); - - done(); - }); -}); - -describe('umask to string', function () { - it("converts umask to string", function (done) { - expect(umask.toString(0)).to.equal("0000"); - expect(umask.toString(1)).to.equal("0001"); - expect(umask.toString(7)).to.equal("0007"); - expect(umask.toString(8)).to.equal("0010"); - expect(umask.toString(511)).to.equal("0777"); - expect(umask.toString(18)).to.equal("0022"); - expect(umask.toString(16)).to.equal("0020"); - done(); - }); -}); - -describe('umask from string', function () { - it('converts valid values', function (done) { - expect(umask.fromString("0000")).to.equal(0); - expect(umask.fromString("0")).to.equal(0); - expect(umask.fromString("0777")).to.equal(511); - expect(umask.fromString("0024")).to.equal(20); - - expect(umask.fromString(0)).to.equal(0); - expect(umask.fromString(20)).to.equal(20); - expect(umask.fromString(21)).to.equal(21); - expect(umask.fromString(511)).to.equal(511); - - done(); - }); - - it('converts valid values', function (done) { - expect(umask.fromString("0000")).to.equal(0); - expect(umask.fromString("0")).to.equal(0); - expect(umask.fromString("010")).to.equal(8); - expect(umask.fromString("0777")).to.equal(511); - expect(umask.fromString("0024")).to.equal(20); - - expect(umask.fromString("8")).to.equal(8); - expect(umask.fromString("9")).to.equal(9); - expect(umask.fromString("18")).to.equal(18); - expect(umask.fromString("16")).to.equal(16); - - expect(umask.fromString(0)).to.equal(0); - expect(umask.fromString(20)).to.equal(20); - expect(umask.fromString(21)).to.equal(21); - expect(umask.fromString(511)).to.equal(511); - - expect(umask.fromString(0.1)).to.equal(0); - expect(umask.fromString(511.1)).to.equal(511); - - done(); - }); - - it('errors on empty string', function (done) { - umask.fromString("", function (err, val) { - expect(err.message).to.equal('Expected octal string, got "", defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors on invalid octal string', function (done) { - umask.fromString("099", function (err, val) { - expect(err.message).to.equal('Expected octal string, got "099", defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when non-string, non-number (boolean)', function (done) { - umask.fromString(false, function (err, val) { - expect(err.message).to.equal('Expected number or octal string, got false, defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when non-string, non-number (object)', function (done) { - umask.fromString({}, function (err, val) { - expect(err.message).to.equal('Expected number or octal string, got {}, defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when out of range (<0)', function (done) { - umask.fromString(-1, function (err, val) { - expect(err.message).to.equal('Must be in range 0..511 (0000..0777), got -1'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when out of range (>511)', function (done) { - umask.fromString(512, function (err, val) { - expect(err.message).to.equal('Must be in range 0..511 (0000..0777), got 512'); - expect(val).to.equal(18); - done(); - }); - }); -}); diff --git a/package-lock.json b/package-lock.json index 8b42fe9d0fdf7..ef61f907bdb5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,6 @@ "tar", "text-table", "tiny-relative-date", - "umask", "uuid", "validate-npm-package-name", "which", @@ -156,7 +155,6 @@ "tar": "^6.0.5", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "umask": "~1.1.0", "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", "which": "^2.0.2", @@ -7920,12 +7918,6 @@ "node": ">=4.2.0" } }, - "node_modules/umask": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", - "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", - "inBundle": true - }, "node_modules/unicode-length": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-2.0.2.tgz", @@ -14266,11 +14258,6 @@ "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, - "umask": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", - "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=" - }, "unicode-length": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-2.0.2.tgz", diff --git a/package.json b/package.json index 9e01314557199..75ce52d467abc 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "tar": "^6.0.5", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "umask": "~1.1.0", "uuid": "^8.3.0", "validate-npm-package-name": "~3.0.0", "which": "^2.0.2", @@ -189,7 +188,6 @@ "tar", "text-table", "tiny-relative-date", - "umask", "uuid", "validate-npm-package-name", "which", From aae1c38bbb983cf40e9b3df012b18bebba5e5400 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:49:38 -0400 Subject: [PATCH 22/39] chore: remove unused config-chain dep --- node_modules/config-chain/LICENCE | 22 -- node_modules/config-chain/index.js | 282 ---------------------- node_modules/config-chain/package.json | 30 --- node_modules/config-chain/readme.markdown | 257 -------------------- node_modules/proto-list/LICENSE | 15 -- node_modules/proto-list/README.md | 3 - node_modules/proto-list/package.json | 18 -- node_modules/proto-list/proto-list.js | 88 ------- node_modules/proto-list/test/basic.js | 61 ----- package-lock.json | 32 --- package.json | 2 - 11 files changed, 810 deletions(-) delete mode 100644 node_modules/config-chain/LICENCE delete mode 100755 node_modules/config-chain/index.js delete mode 100644 node_modules/config-chain/package.json delete mode 100644 node_modules/config-chain/readme.markdown delete mode 100644 node_modules/proto-list/LICENSE delete mode 100644 node_modules/proto-list/README.md delete mode 100644 node_modules/proto-list/package.json delete mode 100644 node_modules/proto-list/proto-list.js delete mode 100644 node_modules/proto-list/test/basic.js diff --git a/node_modules/config-chain/LICENCE b/node_modules/config-chain/LICENCE deleted file mode 100644 index 171dd970053ce..0000000000000 --- a/node_modules/config-chain/LICENCE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011 Dominic Tarr - -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. \ No newline at end of file diff --git a/node_modules/config-chain/index.js b/node_modules/config-chain/index.js deleted file mode 100755 index 0ef3a91f73580..0000000000000 --- a/node_modules/config-chain/index.js +++ /dev/null @@ -1,282 +0,0 @@ -var ProtoList = require('proto-list') - , path = require('path') - , fs = require('fs') - , ini = require('ini') - , EE = require('events').EventEmitter - , url = require('url') - , http = require('http') - -var exports = module.exports = function () { - var args = [].slice.call(arguments) - , conf = new ConfigChain() - - while(args.length) { - var a = args.shift() - if(a) conf.push - ( 'string' === typeof a - ? json(a) - : a ) - } - - return conf -} - -//recursively find a file... - -var find = exports.find = function () { - var rel = path.join.apply(null, [].slice.call(arguments)) - - function find(start, rel) { - var file = path.join(start, rel) - try { - fs.statSync(file) - return file - } catch (err) { - if(path.dirname(start) !== start) // root - return find(path.dirname(start), rel) - } - } - return find(__dirname, rel) -} - -var parse = exports.parse = function (content, file, type) { - content = '' + content - // if we don't know what it is, try json and fall back to ini - // if we know what it is, then it must be that. - if (!type) { - try { return JSON.parse(content) } - catch (er) { return ini.parse(content) } - } else if (type === 'json') { - if (this.emit) { - try { return JSON.parse(content) } - catch (er) { this.emit('error', er) } - } else { - return JSON.parse(content) - } - } else { - return ini.parse(content) - } -} - -var json = exports.json = function () { - var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) - var file = path.join.apply(null, args) - var content - try { - content = fs.readFileSync(file,'utf-8') - } catch (err) { - return - } - return parse(content, file, 'json') -} - -var env = exports.env = function (prefix, env) { - env = env || process.env - var obj = {} - var l = prefix.length - for(var k in env) { - if(k.indexOf(prefix) === 0) - obj[k.substring(l)] = env[k] - } - - return obj -} - -exports.ConfigChain = ConfigChain -function ConfigChain () { - EE.apply(this) - ProtoList.apply(this, arguments) - this._awaiting = 0 - this._saving = 0 - this.sources = {} -} - -// multi-inheritance-ish -var extras = { - constructor: { value: ConfigChain } -} -Object.keys(EE.prototype).forEach(function (k) { - extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) -}) -ConfigChain.prototype = Object.create(ProtoList.prototype, extras) - -ConfigChain.prototype.del = function (key, where) { - // if not specified where, then delete from the whole chain, scorched - // earth style - if (where) { - var target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - delete target[key] - } else { - for (var i = 0, l = this.list.length; i < l; i ++) { - delete this.list[i][key] - } - } - return this -} - -ConfigChain.prototype.set = function (key, value, where) { - var target - - if (where) { - target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - } else { - target = this.list[0] - if (!target) { - return this.emit('error', new Error('cannot set, no confs!')) - } - } - target[key] = value - return this -} - -ConfigChain.prototype.get = function (key, where) { - if (where) { - where = this.sources[where] - if (where) where = where.data - if (where && Object.hasOwnProperty.call(where, key)) return where[key] - return undefined - } - return this.list[0][key] -} - -ConfigChain.prototype.save = function (where, type, cb) { - if (typeof type === 'function') cb = type, type = null - var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) { - // TODO: maybe save() to a url target could be a PUT or something? - // would be easy to swap out with a reddis type thing, too - return this.emit('error', new Error('bad save target: '+where)) - } - - if (target.source) { - var pref = target.prefix || '' - Object.keys(target.data).forEach(function (k) { - target.source[pref + k] = target.data[k] - }) - return this - } - - var type = type || target.type - var data = target.data - if (target.type === 'json') { - data = JSON.stringify(data) - } else { - data = ini.stringify(data) - } - - this._saving ++ - fs.writeFile(target.path, data, 'utf8', function (er) { - this._saving -- - if (er) { - if (cb) return cb(er) - else return this.emit('error', er) - } - if (this._saving === 0) { - if (cb) cb() - this.emit('save') - } - }.bind(this)) - return this -} - -ConfigChain.prototype.addFile = function (file, type, name) { - name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: type } - this.push(marker) - this._await() - fs.readFile(file, 'utf8', function (er, data) { - if (er) this.emit('error', er) - this.addString(data, file, type, marker) - }.bind(this)) - return this -} - -ConfigChain.prototype.addEnv = function (prefix, env, name) { - name = name || 'env' - var data = exports.env(prefix, env) - this.sources[name] = { data: data, source: env, prefix: prefix } - return this.add(data, name) -} - -ConfigChain.prototype.addUrl = function (req, type, name) { - this._await() - var href = url.format(req) - name = name || href - var marker = {__source__:name} - this.sources[name] = { href: href, type: type } - this.push(marker) - http.request(req, function (res) { - var c = [] - var ct = res.headers['content-type'] - if (!type) { - type = ct.indexOf('json') !== -1 ? 'json' - : ct.indexOf('ini') !== -1 ? 'ini' - : href.match(/\.json$/) ? 'json' - : href.match(/\.ini$/) ? 'ini' - : null - marker.type = type - } - - res.on('data', c.push.bind(c)) - .on('end', function () { - this.addString(Buffer.concat(c), href, type, marker) - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) - - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) - .end() - - return this -} - -ConfigChain.prototype.addString = function (data, file, type, marker) { - data = this.parse(data, file, type) - this.add(data, marker) - return this -} - -ConfigChain.prototype.add = function (data, marker) { - if (marker && typeof marker === 'object') { - var i = this.list.indexOf(marker) - if (i === -1) { - return this.emit('error', new Error('bad marker')) - } - this.splice(i, 1, data) - marker = marker.__source__ - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - // we were waiting for this. maybe emit 'load' - this._resolve() - } else { - if (typeof marker === 'string') { - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - } - // trigger the load event if nothing was already going to do so. - this._await() - this.push(data) - process.nextTick(this._resolve.bind(this)) - } - return this -} - -ConfigChain.prototype.parse = exports.parse - -ConfigChain.prototype._await = function () { - this._awaiting++ -} - -ConfigChain.prototype._resolve = function () { - this._awaiting-- - if (this._awaiting === 0) this.emit('load', this) -} diff --git a/node_modules/config-chain/package.json b/node_modules/config-chain/package.json deleted file mode 100644 index e6a1a70b4ace4..0000000000000 --- a/node_modules/config-chain/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "config-chain", - "version": "1.1.12", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.githubusercontent.com/dominictarr/config-chain/master/LICENCE" - } - ], - "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", - "homepage": "http://github.com/dominictarr/config-chain", - "repository": { - "type": "git", - "url": "https://github.com/dominictarr/config-chain.git" - }, - "files": [ - "index.js" - ], - "dependencies": { - "proto-list": "~1.2.1", - "ini": "^1.3.4" - }, - "devDependencies": { - "tap": "0.3.0" - }, - "author": "Dominic Tarr (http://dominictarr.com)", - "scripts": { - "test": "tap test/*" - } -} diff --git a/node_modules/config-chain/readme.markdown b/node_modules/config-chain/readme.markdown deleted file mode 100644 index 47f894c79884f..0000000000000 --- a/node_modules/config-chain/readme.markdown +++ /dev/null @@ -1,257 +0,0 @@ -# config-chain - -A module for loading custom configurations - -## NOTE: Feature Freeze - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -This module is frozen. - -In general, we recommend using [rc](https://github.com/dominictarr/rc) instead, -but as [npm](https://github.com/npmjs/npm) depends on this, it cannot be changed. - - -## Install - -```sh -yarn add config-chain - -# npm users -npm install --save config-chain -``` - -## Usage - -```js -const cc = require('config-chain'); - -console.log(cc.env('TERM_', process.env)); -/* -{ SESSION_ID: 'w1:5F38', - PROGRAM_VERSION: '3.1.2', - PROGRAM: 'iTerm.app' } -*/ -``` - -The `.env` function gets all the keys on the provided object which are -prefixed by the specified prefix, removes the prefix, and puts the values on a new object. - -
- -## Full Usage - -``` js - - // npm install config-chain - - var cc = require('config-chain') - , opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS. - , env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS. - - // EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN - // EARLIER ITEMS OVERIDE LATER ITEMS - // PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST! - - //strings are interpereted as filenames. - //will be loaded synchronously - - var conf = - cc( - //OVERRIDE SETTINGS WITH COMMAND LINE OPTS - opts, - - //ENV VARS IF PREFIXED WITH 'myApp_' - - cc.env('myApp_'), //myApp_foo = 'like this' - - //FILE NAMED BY ENV - path.join(__dirname, 'config.' + env + '.json'), - - //IF `env` is PRODUCTION - env === 'prod' - ? path.join(__dirname, 'special.json') //load a special file - : null //NULL IS IGNORED! - - //SUBDIR FOR ENV CONFIG - path.join(__dirname, 'config', env, 'config.json'), - - //SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE - cc.find('config.json'), - - //PUT DEFAULTS LAST - { - host: 'localhost' - port: 8000 - }) - - var host = conf.get('host') - - // or - - var host = conf.store.host - -``` - -Finally, flexible configurations! 👌 - -## Custom Configuations - -```javascript -var cc = require('config-chain') - -// all the stuff you did before -var config = cc({ - some: 'object' - }, - cc.find('config.json'), - cc.env('myApp_') - ) - // CONFIGS AS A SERVICE, aka "CaaS", aka EVERY DEVOPS DREAM OMG! - .addUrl('http://configurator:1234/my-configs') - // ASYNC FTW! - .addFile('/path/to/file.json') - - // OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT - // BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST - // ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE - .add({ another: 'object' }) - - // DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!! - .on('error', function (er) { - // IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW - // MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\ - throw er - }) - - // THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!! - .on('load', function (config) { - console.awesome('HOLY SHIT!') - }) -``` - -# API Docs - -## cc(...args) - -MAKE A CHAIN AND ADD ALL THE ARGS. - -If the arg is a STRING, then it shall be a JSON FILENAME. - -RETURN THE CHAIN! - -## cc.json(...args) - -Join the args into a JSON filename! - -SYNC I/O! - -## cc.find(relativePath) - -SEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES. - -RETURN THE FOUND PATH! - -SYNC I/O! - -## cc.parse(content, file, type) - -Parse the content string, and guess the type from either the -specified type or the filename. - -RETURN THE RESULTING OBJECT! - -NO I/O! - -## cc.env(prefix, env=process.env) - -Get all the keys on the provided object which are -prefixed by the specified prefix, removes the prefix, and puts the values on a new object. - -RETURN THE RESULTING OBJECT! - -NO I/O! - -## cc.ConfigChain() - -The ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING! - -One of these is returned by the main exported function, as well. - -It inherits (prototypically) from -[ProtoList](https://github.com/isaacs/proto-list/), and also inherits -(parasitically) from -[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter) - -It has all the methods from both, and except where noted, they are -unchanged. - -### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain. - -## chain.sources - -A list of all the places where it got stuff. The keys are the names -passed to addFile or addUrl etc, and the value is an object with some -info about the data source. - -## chain.addFile(filename, type, [name=filename]) - -Filename is the name of the file. Name is an arbitrary string to be -used later if you desire. Type is either 'ini' or 'json', and will -try to guess intelligently if omitted. - -Loaded files can be saved later. - -## chain.addUrl(url, type, [name=url]) - -Same as the filename thing, but with a url. - -Can't be saved later. - -## chain.addEnv(prefix, env, [name='env']) - -Add all the keys from the env object that start with the prefix. - -## chain.addString(data, file, type, [name]) - -Parse the string and add it to the set. (Mainly used internally.) - -## chain.add(object, [name]) - -Add the object to the set. - -## chain.root {Object} - -The root from which all the other config objects in the set descend -prototypically. - -Put your defaults here. - -## chain.set(key, value, name) - -Set the key to the value on the named config object. If name is -unset, then set it on the first config object in the set. (That is, -the one with the highest priority, which was added first.) - -## chain.get(key, [name]) - -Get the key from the named config object explicitly, or from the -resolved configs if not specified. - -## chain.save(name, type) - -Write the named config object back to its origin. - -Currently only supported for env and file config types. - -For files, encode the data according to the type. - -## chain.on('save', function () {}) - -When one or more files are saved, emits `save` event when they're all -saved. - -## chain.on('load', function (chain) {}) - -When the config chain has loaded all the specified files and urls and -such, the 'load' event fires. diff --git a/node_modules/proto-list/LICENSE b/node_modules/proto-list/LICENSE deleted file mode 100644 index 19129e315fe59..0000000000000 --- a/node_modules/proto-list/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/proto-list/README.md b/node_modules/proto-list/README.md deleted file mode 100644 index 43cfa35893d8b..0000000000000 --- a/node_modules/proto-list/README.md +++ /dev/null @@ -1,3 +0,0 @@ -A list of objects, bound by their prototype chain. - -Used in npm's config stuff. diff --git a/node_modules/proto-list/package.json b/node_modules/proto-list/package.json deleted file mode 100644 index c65b406feec92..0000000000000 --- a/node_modules/proto-list/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "proto-list", - "version": "1.2.4", - "description": "A utility for managing a prototype chain", - "main": "./proto-list.js", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/isaacs/proto-list" - }, - "license": "ISC", - "devDependencies": { - "tap": "0" - } -} diff --git a/node_modules/proto-list/proto-list.js b/node_modules/proto-list/proto-list.js deleted file mode 100644 index b55c25c052f22..0000000000000 --- a/node_modules/proto-list/proto-list.js +++ /dev/null @@ -1,88 +0,0 @@ - -module.exports = ProtoList - -function setProto(obj, proto) { - if (typeof Object.setPrototypeOf === "function") - return Object.setPrototypeOf(obj, proto) - else - obj.__proto__ = proto -} - -function ProtoList () { - this.list = [] - var root = null - Object.defineProperty(this, 'root', { - get: function () { return root }, - set: function (r) { - root = r - if (this.list.length) { - setProto(this.list[this.list.length - 1], r) - } - }, - enumerable: true, - configurable: true - }) -} - -ProtoList.prototype = - { get length () { return this.list.length } - , get keys () { - var k = [] - for (var i in this.list[0]) k.push(i) - return k - } - , get snapshot () { - var o = {} - this.keys.forEach(function (k) { o[k] = this.get(k) }, this) - return o - } - , get store () { - return this.list[0] - } - , push : function (obj) { - if (typeof obj !== "object") obj = {valueOf:obj} - if (this.list.length >= 1) { - setProto(this.list[this.list.length - 1], obj) - } - setProto(obj, this.root) - return this.list.push(obj) - } - , pop : function () { - if (this.list.length >= 2) { - setProto(this.list[this.list.length - 2], this.root) - } - return this.list.pop() - } - , unshift : function (obj) { - setProto(obj, this.list[0] || this.root) - return this.list.unshift(obj) - } - , shift : function () { - if (this.list.length === 1) { - setProto(this.list[0], this.root) - } - return this.list.shift() - } - , get : function (key) { - return this.list[0][key] - } - , set : function (key, val, save) { - if (!this.length) this.push({}) - if (save && this.list[0].hasOwnProperty(key)) this.push({}) - return this.list[0][key] = val - } - , forEach : function (fn, thisp) { - for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) - } - , slice : function () { - return this.list.slice.apply(this.list, arguments) - } - , splice : function () { - // handle injections - var ret = this.list.splice.apply(this.list, arguments) - for (var i = 0, l = this.list.length; i < l; i++) { - setProto(this.list[i], this.list[i + 1] || this.root) - } - return ret - } - } diff --git a/node_modules/proto-list/test/basic.js b/node_modules/proto-list/test/basic.js deleted file mode 100644 index 5cd66bef15704..0000000000000 --- a/node_modules/proto-list/test/basic.js +++ /dev/null @@ -1,61 +0,0 @@ -var tap = require("tap") - , test = tap.test - , ProtoList = require("../proto-list.js") - -tap.plan(1) - -tap.test("protoList tests", function (t) { - var p = new ProtoList - p.push({foo:"bar"}) - p.push({}) - p.set("foo", "baz") - t.equal(p.get("foo"), "baz") - - var p = new ProtoList - p.push({foo:"bar"}) - p.set("foo", "baz") - t.equal(p.get("foo"), "baz") - t.equal(p.length, 1) - p.pop() - t.equal(p.length, 0) - p.set("foo", "asdf") - t.equal(p.length, 1) - t.equal(p.get("foo"), "asdf") - p.push({bar:"baz"}) - t.equal(p.length, 2) - t.equal(p.get("foo"), "asdf") - p.shift() - t.equal(p.length, 1) - t.equal(p.get("foo"), undefined) - - - p.unshift({foo:"blo", bar:"rab"}) - p.unshift({foo:"boo"}) - t.equal(p.length, 3) - t.equal(p.get("foo"), "boo") - t.equal(p.get("bar"), "rab") - - var ret = p.splice(1, 1, {bar:"bar"}) - t.same(ret, [{foo:"blo", bar:"rab"}]) - t.equal(p.get("bar"), "bar") - - // should not inherit default object properties - t.equal(p.get('hasOwnProperty'), undefined) - - // unless we give it those. - p.root = {} - t.equal(p.get('hasOwnProperty'), {}.hasOwnProperty) - - p.root = {default:'monkey'} - t.equal(p.get('default'), 'monkey') - - p.push({red:'blue'}) - p.push({red:'blue'}) - p.push({red:'blue'}) - while (p.length) { - t.equal(p.get('default'), 'monkey') - p.shift() - } - - t.end() -}) diff --git a/package-lock.json b/package-lock.json index ef61f907bdb5b..4c869b09f5f2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,6 @@ "cli-columns", "cli-table3", "columnify", - "config-chain", "editor", "find-npm-prefix", "glob", @@ -102,7 +101,6 @@ "cli-columns": "^3.1.2", "cli-table3": "^0.6.0", "columnify": "~1.5.4", - "config-chain": "^1.1.12", "editor": "~1.0.0", "find-npm-prefix": "^1.0.2", "glob": "^7.1.4", @@ -1347,16 +1345,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "inBundle": true }, - "node_modules/config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "inBundle": true, - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -4795,12 +4783,6 @@ "react-is": "^16.8.1" } }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", - "inBundle": true - }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -9292,15 +9274,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -11893,11 +11866,6 @@ "react-is": "^16.8.1" } }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", diff --git a/package.json b/package.json index 75ce52d467abc..bb0bcd9448bbe 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "cli-columns": "^3.1.2", "cli-table3": "^0.6.0", "columnify": "~1.5.4", - "config-chain": "^1.1.12", "editor": "~1.0.0", "find-npm-prefix": "^1.0.2", "glob": "^7.1.4", @@ -135,7 +134,6 @@ "cli-columns", "cli-table3", "columnify", - "config-chain", "editor", "find-npm-prefix", "glob", From 450845eaceb7e178c8ec7867a67e5cc948986904 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:50:58 -0400 Subject: [PATCH 23/39] chore: remove unused find-npm-prefix dep --- node_modules/find-npm-prefix/LICENSE | 15 ---- node_modules/find-npm-prefix/README.md | 28 ------- node_modules/find-npm-prefix/find-prefix.js | 56 ------------- node_modules/find-npm-prefix/package.json | 29 ------- .../find-npm-prefix/test/find-prefix.js | 79 ------------------- package-lock.json | 13 --- package.json | 2 - 7 files changed, 222 deletions(-) delete mode 100644 node_modules/find-npm-prefix/LICENSE delete mode 100644 node_modules/find-npm-prefix/README.md delete mode 100644 node_modules/find-npm-prefix/find-prefix.js delete mode 100644 node_modules/find-npm-prefix/package.json delete mode 100644 node_modules/find-npm-prefix/test/find-prefix.js diff --git a/node_modules/find-npm-prefix/LICENSE b/node_modules/find-npm-prefix/LICENSE deleted file mode 100644 index 7953647e7760b..0000000000000 --- a/node_modules/find-npm-prefix/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright npm, Inc - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/find-npm-prefix/README.md b/node_modules/find-npm-prefix/README.md deleted file mode 100644 index 26d3337065df8..0000000000000 --- a/node_modules/find-npm-prefix/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# find-npm-prefix - -Find the npm project directory associated with for a given directory - -## USAGE - -``` -const findPrefix = require('find-npm-prefix') - -findPrefix(process.cwd).then(prefix => { - … -}) -``` - -## findPrefix(dir) → Promise(prefix) - -This computes the npm prefix, that is, the directory that npm adds and -removes modules from for a given path. - -It takes a directory as an argument and returns a promise of the associated -prefix directory. - -## Algorithm - -1. If the directory is a `node_modules` folder, scan up the tree till you find a non-`node_modules` directory and return that. -2. Else, look for the first parent directory that contains a `node_modules` or a `package.json` - 1. If one is found, that's the prefix. - 2. If none are found, return the original directory we were given diff --git a/node_modules/find-npm-prefix/find-prefix.js b/node_modules/find-npm-prefix/find-prefix.js deleted file mode 100644 index d5e271322be22..0000000000000 --- a/node_modules/find-npm-prefix/find-prefix.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' -// try to find the most reasonable prefix to use - -module.exports = findPrefix - -const fs = require('fs') -const path = require('path') - -function findPrefix (dir) { - return new Promise((resolve, reject) => { - dir = path.resolve(dir) - - // this is a weird special case where an infinite recurse of - // node_modules folders resolves to the level that contains the - // very first node_modules folder - let walkedUp = false - while (path.basename(dir) === 'node_modules') { - dir = path.dirname(dir) - walkedUp = true - } - if (walkedUp) { - resolve(dir) - } else { - resolve(findPrefix_(dir)) - } - }) -} - -function findPrefix_ (dir, original) { - if (!original) original = dir - - const parent = path.dirname(dir) - // this is a platform independent way of checking if we're in the root - // directory - if (parent === dir) return Promise.resolve(original) - - return new Promise((resolve, reject) => { - fs.readdir(dir, (err, files) => { - if (err) { - // an error right away is a bad sign. - // unless the prefix was simply a non - // existent directory. - if (err && dir === original && err.code !== 'ENOENT') { - reject(err) - } else { - resolve(original) - } - } else if (files.indexOf('node_modules') !== -1 || - files.indexOf('package.json') !== -1) { - resolve(dir) - } else { - resolve(findPrefix_(parent, original)) - } - }) - }) -} diff --git a/node_modules/find-npm-prefix/package.json b/node_modules/find-npm-prefix/package.json deleted file mode 100644 index 48823546d0c4e..0000000000000 --- a/node_modules/find-npm-prefix/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "find-npm-prefix", - "version": "1.0.2", - "description": "Find the npm project directory associated with for a given directory", - "main": "find-prefix.js", - "scripts": { - "test": "standard && tap --100 test" - }, - "keywords": [], - "author": "Rebecca Turner (http://re-becca.org/)", - "license": "ISC", - "devDependencies": { - "require-inject": "^1.4.2", - "standard": "^10.0.3", - "tap": "^10.7.3" - }, - "directories": { - "test": "test" - }, - "dependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/find-npm-prefix.git" - }, - "bugs": { - "url": "https://github.com/npm/find-npm-prefix/issues" - }, - "homepage": "https://github.com/npm/find-npm-prefix#readme" -} diff --git a/node_modules/find-npm-prefix/test/find-prefix.js b/node_modules/find-npm-prefix/test/find-prefix.js deleted file mode 100644 index de2ab41cb9df1..0000000000000 --- a/node_modules/find-npm-prefix/test/find-prefix.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -const Bluebird = require('bluebird') -const test = require('tap').test -const requireInject = require('require-inject') -const findPrefix = requireInject('../find-prefix.js', { - fs: { - readdir: mockReaddir - } -}) - -test('find-prefix', t => { - const tests = { - '/Users/example/code/test1/node_modules': '/Users/example/code/test1', - '/Users/example/code/test1/node_modules/node_modules': '/Users/example/code/test1', - '/Users/example/code/test1/sub1': '/Users/example/code/test1', - '/Users/example/code/test1/sub1/sub1a': '/Users/example/code/test1', - '/Users/example/code/test2': '/Users/example/code/test2', - '/Users/example/code/test2/sub2': '/Users/example/code/test2', - '/Users/example/code': '/Users/example/code', - '/Users/example': '/Users/example', - '/does/not/exist': '/does/not/exist' - } - t.plan(Object.keys(tests).length) - return Bluebird.map(Object.keys(tests), dir => { - return findPrefix(dir).then(pre => { - t.is(pre, tests[dir], dir) - }) - }) -}) - -test('fail-prefix', t => { - return findPrefix('/Users/example/eperm').then(pre => { - t.fail('no eperm') - }).catch(err => { - t.is(err.code, 'EPERM', 'got perm error') - }) -}) - -const fixture = { - 'Users': { - 'example': { - 'code': { - 'test1': { - 'node_modules': { - 'node_modules': {} - }, - 'sub1': { - 'sub1a': {} - } - }, - 'test2': { - 'package.json': {}, - 'sub2': {} - } - } - } - } -} - -function mockReaddir (dir, cb) { - if (/eperm/.test(dir)) { - const err = new Error('Can not read: ' + dir) - err.code = 'EPERM' - return cb(err) - } - const parts = dir.split(/\//).slice(1) - let cwd = fixture - let part - while ((part = parts.shift())) { - if (part in cwd) { - cwd = cwd[part] - } else { - const err = new Error('Does not exist: ' + dir + ' * ' + part) - err.code = 'ENOENT' - return cb(err) - } - } - return cb(null, Object.keys(cwd)) -} diff --git a/package-lock.json b/package-lock.json index 4c869b09f5f2d..c708452435d72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ "cli-table3", "columnify", "editor", - "find-npm-prefix", "glob", "graceful-fs", "has-unicode", @@ -102,7 +101,6 @@ "cli-table3": "^0.6.0", "columnify": "~1.5.4", "editor": "~1.0.0", - "find-npm-prefix": "^1.0.2", "glob": "^7.1.4", "graceful-fs": "^4.2.3", "has-unicode": "~2.0.1", @@ -2241,12 +2239,6 @@ "node": ">=6" } }, - "node_modules/find-npm-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz", - "integrity": "sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA==", - "inBundle": true - }, "node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -9971,11 +9963,6 @@ } } }, - "find-npm-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz", - "integrity": "sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA==" - }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", diff --git a/package.json b/package.json index bb0bcd9448bbe..81b32f806f815 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "cli-table3": "^0.6.0", "columnify": "~1.5.4", "editor": "~1.0.0", - "find-npm-prefix": "^1.0.2", "glob": "^7.1.4", "graceful-fs": "^4.2.3", "has-unicode": "~2.0.1", @@ -135,7 +134,6 @@ "cli-table3", "columnify", "editor", - "find-npm-prefix", "glob", "graceful-fs", "has-unicode", From 963d542d385c7fe26830a885fe40d96010d01862 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:52:47 -0400 Subject: [PATCH 24/39] chore: remove unused has-unicode dep --- package-lock.json | 2 -- package.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c708452435d72..5a6a86878aa68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,6 @@ "editor", "glob", "graceful-fs", - "has-unicode", "hosted-git-info", "infer-owner", "inherits", @@ -103,7 +102,6 @@ "editor": "~1.0.0", "glob": "^7.1.4", "graceful-fs": "^4.2.3", - "has-unicode": "~2.0.1", "hosted-git-info": "^3.0.5", "infer-owner": "^1.0.4", "inherits": "^2.0.4", diff --git a/package.json b/package.json index 81b32f806f815..b38591c8fc5c2 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "editor": "~1.0.0", "glob": "^7.1.4", "graceful-fs": "^4.2.3", - "has-unicode": "~2.0.1", "hosted-git-info": "^3.0.5", "infer-owner": "^1.0.4", "inherits": "^2.0.4", @@ -136,7 +135,6 @@ "editor", "glob", "graceful-fs", - "has-unicode", "hosted-git-info", "infer-owner", "inherits", From cad9cbc70561c8638ed6e56286f753693f411000 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:54:17 -0400 Subject: [PATCH 25/39] chore: remove unused infer-owner dep --- package-lock.json | 2 -- package.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a6a86878aa68..65b2dd3238d35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,6 @@ "glob", "graceful-fs", "hosted-git-info", - "infer-owner", "inherits", "ini", "init-package-json", @@ -103,7 +102,6 @@ "glob": "^7.1.4", "graceful-fs": "^4.2.3", "hosted-git-info": "^3.0.5", - "infer-owner": "^1.0.4", "inherits": "^2.0.4", "ini": "^1.3.5", "init-package-json": "^1.10.3", diff --git a/package.json b/package.json index b38591c8fc5c2..358843feda1a9 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ "glob": "^7.1.4", "graceful-fs": "^4.2.3", "hosted-git-info": "^3.0.5", - "infer-owner": "^1.0.4", "inherits": "^2.0.4", "ini": "^1.3.5", "init-package-json": "^1.10.3", @@ -136,7 +135,6 @@ "glob", "graceful-fs", "hosted-git-info", - "infer-owner", "inherits", "ini", "init-package-json", From 3ae02914d49f3302d25c85d2242096bb2291f9f4 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 14:58:14 -0400 Subject: [PATCH 26/39] chore: remove unused lockfile dep --- node_modules/lockfile/.travis.yml | 11 - node_modules/lockfile/CHANGELOG.md | 109 ------ node_modules/lockfile/LICENSE | 15 - node_modules/lockfile/README.md | 86 ----- node_modules/lockfile/gen-changelog.sh | 9 - node_modules/lockfile/lockfile.js | 320 ------------------ node_modules/lockfile/package.json | 34 -- node_modules/lockfile/sockets.md | 27 -- node_modules/lockfile/speedtest.js | 63 ---- node_modules/lockfile/test/basic.js | 292 ---------------- .../lockfile/test/fixtures/bad-child.js | 5 - node_modules/lockfile/test/fixtures/child.js | 3 - node_modules/lockfile/test/retry-time.js | 67 ---- .../lockfile/test/stale-contention.js | 85 ----- node_modules/lockfile/test/unlock-no-cb.js | 10 - package-lock.json | 19 -- package.json | 2 - 17 files changed, 1157 deletions(-) delete mode 100644 node_modules/lockfile/.travis.yml delete mode 100644 node_modules/lockfile/CHANGELOG.md delete mode 100644 node_modules/lockfile/LICENSE delete mode 100644 node_modules/lockfile/README.md delete mode 100644 node_modules/lockfile/gen-changelog.sh delete mode 100644 node_modules/lockfile/lockfile.js delete mode 100644 node_modules/lockfile/package.json delete mode 100644 node_modules/lockfile/sockets.md delete mode 100644 node_modules/lockfile/speedtest.js delete mode 100644 node_modules/lockfile/test/basic.js delete mode 100644 node_modules/lockfile/test/fixtures/bad-child.js delete mode 100644 node_modules/lockfile/test/fixtures/child.js delete mode 100644 node_modules/lockfile/test/retry-time.js delete mode 100644 node_modules/lockfile/test/stale-contention.js delete mode 100644 node_modules/lockfile/test/unlock-no-cb.js diff --git a/node_modules/lockfile/.travis.yml b/node_modules/lockfile/.travis.yml deleted file mode 100644 index 85318e47f48db..0000000000000 --- a/node_modules/lockfile/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -sudo: false -node_js: - - 8 - - 6 - - 4 -notifications: - email: false -cache: - directories: - - $HOME/.npm diff --git a/node_modules/lockfile/CHANGELOG.md b/node_modules/lockfile/CHANGELOG.md deleted file mode 100644 index 82cb74655206c..0000000000000 --- a/node_modules/lockfile/CHANGELOG.md +++ /dev/null @@ -1,109 +0,0 @@ -# Changes - - -## 1.0.4 - -* test parallel -* upgrade tap -* upgrade node versions in travis.yml -* Use signal-exit package to detect exit instead of process.on('exit') -* added some debugging lines - -## v1.0.3 - -* handle the case where callback is not passed by user - -## v1.0.2 - -* git ignore coverage and node_modules -* update tap to v7 -* build a changelog -* package: fix repository link -* pass tests on 0.8 -* before_script needs to be before_install -* tap 1.2.0 and travis - -## v1.0.1 - -* isc license -* updated README.md - -## v1.0.0 - -* Simulate staleness instead of waiting excessively -* whitespace -* manage 'retries' so it does not clash with 'wait' polling -* manage 'wait' timer properly -* Get rid of the excessive Object.create opts shadowing stuff -* failing test for the time taken for retries + wait options -* doc: add pollPeriod, correct opts.wait -* Fixed #6: polling period should be configurable - -## v0.4.3 - -* Implement race-resistant stale lock detection -* set req id to 1 to start out - -## v0.4.2 - -* stale option fix for windows file tunneling - -## v0.4.1 - -* Fix version parsing - -## v0.4.0 - -* Don't keep lockfiles open - -## v0.3.4 - -* retry more aggressively - -## v0.3.3 - -* Add debugging function - -## v0.3.2 - -* remove console.error - -## v0.3.1 - -* Support lack of subsecond fs precision -* Fix error closure overwriting in notStale - -## v0.3.0 - -* Use polling instead of watchers -* Add more overhead buffer to contention test - -## v0.2.2 - -* Fix wait calculation -* fixup -* Style: prefer early return to giant if/else -* unlock: Close before unlinking -* Don't get tripped up by locks named 'hasOwnProperty' -* test: Pathological extreme lock contention -* refactor license - -## 0.2.1 - -* Handle race conditions more thoroughly - -## 0.2.0 - -* Rename to 'lockfile' - -## 0.0.2 - -* Add retries -* bsd - -## 0.0.1 - -* tests -* package.json -* the code -* first diff --git a/node_modules/lockfile/LICENSE b/node_modules/lockfile/LICENSE deleted file mode 100644 index 19129e315fe59..0000000000000 --- a/node_modules/lockfile/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/lockfile/README.md b/node_modules/lockfile/README.md deleted file mode 100644 index 3960194f068d6..0000000000000 --- a/node_modules/lockfile/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# lockfile - -A very polite lock file utility, which endeavors to not litter, and to -wait patiently for others. - -## Usage - -```javascript -var lockFile = require('lockfile') - -// opts is optional, and defaults to {} -lockFile.lock('some-file.lock', opts, function (er) { - // if the er happens, then it failed to acquire a lock. - // if there was not an error, then the file was created, - // and won't be deleted until we unlock it. - - // do my stuff, free of interruptions - // then, some time later, do: - lockFile.unlock('some-file.lock', function (er) { - // er means that an error happened, and is probably bad. - }) -}) -``` - -## Methods - -Sync methods return the value/throw the error, others don't. Standard -node fs stuff. - -All known locks are removed when the process exits. Of course, it's -possible for certain types of failures to cause this to fail, but a best -effort is made to not be a litterbug. - -### lockFile.lock(path, [opts], cb) - -Acquire a file lock on the specified path - -### lockFile.lockSync(path, [opts]) - -Acquire a file lock on the specified path - -### lockFile.unlock(path, cb) - -Close and unlink the lockfile. - -### lockFile.unlockSync(path) - -Close and unlink the lockfile. - -### lockFile.check(path, [opts], cb) - -Check if the lockfile is locked and not stale. - -Callback is called with `cb(error, isLocked)`. - -### lockFile.checkSync(path, [opts]) - -Check if the lockfile is locked and not stale. - -Returns boolean. - -## Options - -### opts.wait - -A number of milliseconds to wait for locks to expire before giving up. -Only used by lockFile.lock. Poll for `opts.wait` ms. If the lock is -not cleared by the time the wait expires, then it returns with the -original error. - -### opts.pollPeriod - -When using `opts.wait`, this is the period in ms in which it polls to -check if the lock has expired. Defaults to `100`. - -### opts.stale - -A number of milliseconds before locks are considered to have expired. - -### opts.retries - -Used by lock and lockSync. Retry `n` number of times before giving up. - -### opts.retryWait - -Used by lock. Wait `n` milliseconds before retrying. diff --git a/node_modules/lockfile/gen-changelog.sh b/node_modules/lockfile/gen-changelog.sh deleted file mode 100644 index 360e54af40f6a..0000000000000 --- a/node_modules/lockfile/gen-changelog.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -( - echo '# Changes' - echo '' - git log --first-parent --pretty=format:'%s' \ - | grep -v '^update changelog' \ - | perl -p -e 's/^((v?[0-9]+\.?)+)$/\n## \1\n/g' \ - | perl -p -e 's/^([^#\s].*)$/* \1/g' -)> CHANGELOG.md diff --git a/node_modules/lockfile/lockfile.js b/node_modules/lockfile/lockfile.js deleted file mode 100644 index f037bec55e73c..0000000000000 --- a/node_modules/lockfile/lockfile.js +++ /dev/null @@ -1,320 +0,0 @@ -var fs = require('fs') - -var wx = 'wx' -if (process.version.match(/^v0\.[0-6]/)) { - var c = require('constants') - wx = c.O_TRUNC | c.O_CREAT | c.O_WRONLY | c.O_EXCL -} - -var os = require('os') -exports.filetime = 'ctime' -if (os.platform() == "win32") { - exports.filetime = 'mtime' -} - -var debug -var util = require('util') -if (util.debuglog) - debug = util.debuglog('LOCKFILE') -else if (/\blockfile\b/i.test(process.env.NODE_DEBUG)) - debug = function() { - var msg = util.format.apply(util, arguments) - console.error('LOCKFILE %d %s', process.pid, msg) - } -else - debug = function() {} - -var locks = {} - -function hasOwnProperty (obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop) -} - -var onExit = require('signal-exit') -onExit(function () { - debug('exit listener') - // cleanup - Object.keys(locks).forEach(exports.unlockSync) -}) - -// XXX https://github.com/joyent/node/issues/3555 -// Remove when node 0.8 is deprecated. -if (/^v0\.[0-8]\./.test(process.version)) { - debug('uncaughtException, version = %s', process.version) - process.on('uncaughtException', function H (er) { - debug('uncaughtException') - var l = process.listeners('uncaughtException').filter(function (h) { - return h !== H - }) - if (!l.length) { - // cleanup - try { Object.keys(locks).forEach(exports.unlockSync) } catch (e) {} - process.removeListener('uncaughtException', H) - throw er - } - }) -} - -exports.unlock = function (path, cb) { - debug('unlock', path) - // best-effort. unlocking an already-unlocked lock is a noop - delete locks[path] - fs.unlink(path, function (unlinkEr) { cb && cb() }) -} - -exports.unlockSync = function (path) { - debug('unlockSync', path) - // best-effort. unlocking an already-unlocked lock is a noop - try { fs.unlinkSync(path) } catch (er) {} - delete locks[path] -} - - -// if the file can be opened in readonly mode, then it's there. -// if the error is something other than ENOENT, then it's not. -exports.check = function (path, opts, cb) { - if (typeof opts === 'function') cb = opts, opts = {} - debug('check', path, opts) - fs.open(path, 'r', function (er, fd) { - if (er) { - if (er.code !== 'ENOENT') return cb(er) - return cb(null, false) - } - - if (!opts.stale) { - return fs.close(fd, function (er) { - return cb(er, true) - }) - } - - fs.fstat(fd, function (er, st) { - if (er) return fs.close(fd, function (er2) { - return cb(er) - }) - - fs.close(fd, function (er) { - var age = Date.now() - st[exports.filetime].getTime() - return cb(er, age <= opts.stale) - }) - }) - }) -} - -exports.checkSync = function (path, opts) { - opts = opts || {} - debug('checkSync', path, opts) - if (opts.wait) { - throw new Error('opts.wait not supported sync for obvious reasons') - } - - try { - var fd = fs.openSync(path, 'r') - } catch (er) { - if (er.code !== 'ENOENT') throw er - return false - } - - if (!opts.stale) { - try { fs.closeSync(fd) } catch (er) {} - return true - } - - // file exists. however, might be stale - if (opts.stale) { - try { - var st = fs.fstatSync(fd) - } finally { - fs.closeSync(fd) - } - var age = Date.now() - st[exports.filetime].getTime() - return (age <= opts.stale) - } -} - - - -var req = 1 -exports.lock = function (path, opts, cb) { - if (typeof opts === 'function') cb = opts, opts = {} - opts.req = opts.req || req++ - debug('lock', path, opts) - opts.start = opts.start || Date.now() - - if (typeof opts.retries === 'number' && opts.retries > 0) { - debug('has retries', opts.retries) - var retries = opts.retries - opts.retries = 0 - cb = (function (orig) { return function cb (er, fd) { - debug('retry-mutated callback') - retries -= 1 - if (!er || retries < 0) return orig(er, fd) - - debug('lock retry', path, opts) - - if (opts.retryWait) setTimeout(retry, opts.retryWait) - else retry() - - function retry () { - opts.start = Date.now() - debug('retrying', opts.start) - exports.lock(path, opts, cb) - } - }})(cb) - } - - // try to engage the lock. - // if this succeeds, then we're in business. - fs.open(path, wx, function (er, fd) { - if (!er) { - debug('locked', path, fd) - locks[path] = fd - return fs.close(fd, function () { - return cb() - }) - } - - debug('failed to acquire lock', er) - - // something other than "currently locked" - // maybe eperm or something. - if (er.code !== 'EEXIST') { - debug('not EEXIST error', er) - return cb(er) - } - - // someone's got this one. see if it's valid. - if (!opts.stale) return notStale(er, path, opts, cb) - - return maybeStale(er, path, opts, false, cb) - }) - debug('lock return') -} - - -// Staleness checking algorithm -// 1. acquire $lock, fail -// 2. stat $lock, find that it is stale -// 3. acquire $lock.STALE -// 4. stat $lock, assert that it is still stale -// 5. unlink $lock -// 6. link $lock.STALE $lock -// 7. unlink $lock.STALE -// On any failure, clean up whatever we've done, and raise the error. -function maybeStale (originalEr, path, opts, hasStaleLock, cb) { - fs.stat(path, function (statEr, st) { - if (statEr) { - if (statEr.code === 'ENOENT') { - // expired already! - opts.stale = false - debug('lock stale enoent retry', path, opts) - exports.lock(path, opts, cb) - return - } - return cb(statEr) - } - - var age = Date.now() - st[exports.filetime].getTime() - if (age <= opts.stale) return notStale(originalEr, path, opts, cb) - - debug('lock stale', path, opts) - if (hasStaleLock) { - exports.unlock(path, function (er) { - if (er) return cb(er) - debug('lock stale retry', path, opts) - fs.link(path + '.STALE', path, function (er) { - fs.unlink(path + '.STALE', function () { - // best effort. if the unlink fails, oh well. - cb(er) - }) - }) - }) - } else { - debug('acquire .STALE file lock', opts) - exports.lock(path + '.STALE', opts, function (er) { - if (er) return cb(er) - maybeStale(originalEr, path, opts, true, cb) - }) - } - }) -} - -function notStale (er, path, opts, cb) { - debug('notStale', path, opts) - - // if we can't wait, then just call it a failure - if (typeof opts.wait !== 'number' || opts.wait <= 0) { - debug('notStale, wait is not a number') - return cb(er) - } - - // poll for some ms for the lock to clear - var now = Date.now() - var start = opts.start || now - var end = start + opts.wait - - if (end <= now) - return cb(er) - - debug('now=%d, wait until %d (delta=%d)', start, end, end-start) - var wait = Math.min(end - start, opts.pollPeriod || 100) - var timer = setTimeout(poll, wait) - - function poll () { - debug('notStale, polling', path, opts) - exports.lock(path, opts, cb) - } -} - -exports.lockSync = function (path, opts) { - opts = opts || {} - opts.req = opts.req || req++ - debug('lockSync', path, opts) - if (opts.wait || opts.retryWait) { - throw new Error('opts.wait not supported sync for obvious reasons') - } - - try { - var fd = fs.openSync(path, wx) - locks[path] = fd - try { fs.closeSync(fd) } catch (er) {} - debug('locked sync!', path, fd) - return - } catch (er) { - if (er.code !== 'EEXIST') return retryThrow(path, opts, er) - - if (opts.stale) { - var st = fs.statSync(path) - var ct = st[exports.filetime].getTime() - if (!(ct % 1000) && (opts.stale % 1000)) { - // probably don't have subsecond resolution. - // round up the staleness indicator. - // Yes, this will be wrong 1/1000 times on platforms - // with subsecond stat precision, but that's acceptable - // in exchange for not mistakenly removing locks on - // most other systems. - opts.stale = 1000 * Math.ceil(opts.stale / 1000) - } - var age = Date.now() - ct - if (age > opts.stale) { - debug('lockSync stale', path, opts, age) - exports.unlockSync(path) - return exports.lockSync(path, opts) - } - } - - // failed to lock! - debug('failed to lock', path, opts, er) - return retryThrow(path, opts, er) - } -} - -function retryThrow (path, opts, er) { - if (typeof opts.retries === 'number' && opts.retries > 0) { - var newRT = opts.retries - 1 - debug('retryThrow', path, opts, newRT) - opts.retries = newRT - return exports.lockSync(path, opts) - } - throw er -} - diff --git a/node_modules/lockfile/package.json b/node_modules/lockfile/package.json deleted file mode 100644 index 625e91bcce69b..0000000000000 --- a/node_modules/lockfile/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "lockfile", - "version": "1.0.4", - "main": "lockfile.js", - "directories": { - "test": "test" - }, - "dependencies": { - "signal-exit": "^3.0.2" - }, - "devDependencies": { - "tap": "^11.1.3", - "touch": "0" - }, - "scripts": { - "test": "tap test/*.js --cov -J", - "changelog": "bash gen-changelog.sh", - "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/lockfile.git" - }, - "keywords": [ - "lockfile", - "lock", - "file", - "fs", - "O_EXCL" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others." -} diff --git a/node_modules/lockfile/sockets.md b/node_modules/lockfile/sockets.md deleted file mode 100644 index 89b60eebce8b1..0000000000000 --- a/node_modules/lockfile/sockets.md +++ /dev/null @@ -1,27 +0,0 @@ -to ACQUIRE(lockname) -- create server, listen on lockname - - if enotsock, WATCH(lockname) - - if eaddrinuse, - - CONNECT(lockname) - - unref server - - lock has been acquired via server - ! on connection, place sockets in queue - -to RELEASE(lockname) -- if acquired via connection - - disconnect -- if acquired via server - - send "OK" to front-most connection - - when connection disconnects, RELEASE(lockname) -- if acquired via filename - - unlink file - -to CONNECT(lockname) -- net.connect(lockname) - - if enoent or socket termination, ACQUIRE(lockname) - - when server says "OK", - - lock has been acquired via connection - -to WATCH(lockname) -- fs.watch(lockname) -- on change, ACQUIRE(lockname) diff --git a/node_modules/lockfile/speedtest.js b/node_modules/lockfile/speedtest.js deleted file mode 100644 index 4433dce1d9616..0000000000000 --- a/node_modules/lockfile/speedtest.js +++ /dev/null @@ -1,63 +0,0 @@ -const path = require('path'); -const async = require('async'); -const lf = require('lockfile'); -const fs = require('fs'); - -const n = +process.argv[3] || 300; -const a = Array.apply(null, {length: n}).map(function(_, i) { - return i -}) -const file = path.resolve(__dirname, 'speed-test.lock'); - -try{ - fs.unlinkSync(file); -} -catch(e){} - - -/// NOTE: this should run in about 30ms on a SSD Ubuntu 16.04, that is fast, because we are locking/unlocking 300 locks -/// *HOWEVER* if we change async.eachSeries to async.each, lockfile will barf immediately, and I can't get lockfile -/// to not barf, using any of the options {} available to lockfile#lock. - - -const parallel = process.argv[2] === 'parallel'; - -var fn, msg; - -if(parallel){ - msg = 'parallel'; - fn = async.each; -} -else{ - msg = 'series'; - fn = async.eachSeries; -} - - -const start = Date.now(); -console.log(' => locking/unlocking ' + a.length + ' times, in ' + msg); - -fn(a, function (val, cb) { - - console.log('try %d', val) - - lf.lock(file, { retries: n * 3 }, function (err) { - if (err) { - cb(err); - } - else { - console.log('complete %d', val) - lf.unlock(file, cb); - } - }); - -}, function complete(err) { - - if (err) { - throw err; - } - - console.log(' => Time required for lockfile => ', Date.now() - start, 'ms'); - process.exit(0); - -}); diff --git a/node_modules/lockfile/test/basic.js b/node_modules/lockfile/test/basic.js deleted file mode 100644 index bc66cc3531366..0000000000000 --- a/node_modules/lockfile/test/basic.js +++ /dev/null @@ -1,292 +0,0 @@ -var test = require('tap').test -var lockFile = require('../lockfile.js') -var path = require('path') -var fs = require('fs') -var touch = require('touch') - -// On Unix systems, it uses ctime by default for staleness checks, since it's -// the most reliable. However, because this test artificially sets some locks -// to an earlier time to simulate staleness, we use mtime here. -lockFile.filetime = 'mtime' - -test('setup', function (t) { - try { lockFile.unlockSync('basic-lock') } catch (er) {} - try { lockFile.unlockSync('sync-lock') } catch (er) {} - try { lockFile.unlockSync('never-forget') } catch (er) {} - try { lockFile.unlockSync('stale-lock') } catch (er) {} - try { lockFile.unlockSync('watch-lock') } catch (er) {} - try { lockFile.unlockSync('retry-lock') } catch (er) {} - try { lockFile.unlockSync('contentious-lock') } catch (er) {} - try { lockFile.unlockSync('stale-wait-lock') } catch (er) {} - try { lockFile.unlockSync('stale-windows-lock') } catch (er) {} - t.end() -}) - -test('lock contention', function (t) { - var gotlocks = 0; - var N = 200 - var delay = 10 - // allow for some time for each lock acquisition and release. - // note that raising N higher will mean that the overhead - // increases, because we're creating more and more watchers. - // irl, you should never have several hundred contenders for a - // single lock, so this situation is somewhat pathological. - var overhead = 200 - var wait = N * overhead + delay - - // first make it locked, so that everyone has to wait - lockFile.lock('contentious-lock', function(er, lock) { - t.ifError(er, 'acquiring starter') - if (er) throw er; - t.pass('acquired starter lock') - setTimeout(function() { - lockFile.unlock('contentious-lock', function (er) { - t.ifError(er, 'unlocking starter') - if (er) throw er - t.pass('unlocked starter') - }) - }, delay) - }) - - for (var i=0; i < N; i++) - lockFile.lock('contentious-lock', { wait: wait }, function(er, lock) { - if (er) throw er; - lockFile.unlock('contentious-lock', function(er) { - if (er) throw er - gotlocks++ - t.pass('locked and unlocked #' + gotlocks) - if (gotlocks === N) { - t.pass('got all locks') - t.end() - } - }) - }) -}) - -test('basic test', function (t) { - lockFile.check('basic-lock', function (er, locked) { - if (er) throw er - t.notOk(locked) - lockFile.lock('basic-lock', function (er) { - if (er) throw er - lockFile.lock('basic-lock', function (er) { - t.ok(er) - lockFile.check('basic-lock', function (er, locked) { - if (er) throw er - t.ok(locked) - lockFile.unlock('basic-lock', function (er) { - if (er) throw er - lockFile.check('basic-lock', function (er, locked) { - if (er) throw er - t.notOk(locked) - t.end() - }) - }) - }) - }) - }) - }) -}) - -test('sync test', function (t) { - var locked - locked = lockFile.checkSync('sync-lock') - t.notOk(locked) - lockFile.lockSync('sync-lock') - locked = lockFile.checkSync('sync-lock') - t.ok(locked) - lockFile.unlockSync('sync-lock') - locked = lockFile.checkSync('sync-lock') - t.notOk(locked) - t.end() -}) - -test('exit cleanup test', function (t) { - var child = require.resolve('./fixtures/child.js') - var node = process.execPath - var spawn = require('child_process').spawn - spawn(node, [child]).on('exit', function () { - setTimeout(function () { - var locked = lockFile.checkSync('never-forget') - t.notOk(locked) - t.end() - }, 100) - }) -}) - -test('error exit cleanup test', function (t) { - var child = require.resolve('./fixtures/bad-child.js') - var node = process.execPath - var spawn = require('child_process').spawn - spawn(node, [child]).on('exit', function () { - setTimeout(function () { - var locked = lockFile.checkSync('never-forget') - t.notOk(locked) - t.end() - }, 100) - }) -}) - - -test('staleness test', function (t) { - lockFile.lock('stale-lock', function (er) { - if (er) throw er - - // simulate 2s old - touch.sync('stale-lock', { time: new Date(Date.now() - 2000) }) - - var opts = { stale: 1 } - lockFile.check('stale-lock', opts, function (er, locked) { - if (er) throw er - t.notOk(locked) - lockFile.lock('stale-lock', opts, function (er) { - if (er) throw er - lockFile.unlock('stale-lock', function (er) { - if (er) throw er - t.end() - }) - }) - }) - }) -}) - -test('staleness sync test', function (t) { - var opts = { stale: 1 } - lockFile.lockSync('stale-lock') - // simulate 2s old - touch.sync('stale-lock', { time: new Date(Date.now() - 2000) }) - var locked - locked = lockFile.checkSync('stale-lock', opts) - t.notOk(locked) - lockFile.lockSync('stale-lock', opts) - lockFile.unlockSync('stale-lock') - t.end() -}) - -test('retries', function (t) { - // next 5 opens will fail. - var opens = 5 - fs._open = fs.open - fs.open = function (path, mode, cb) { - if (--opens === 0) { - fs.open = fs._open - return fs.open(path, mode, cb) - } - var er = new Error('bogus') - // to be, or not to be, that is the question. - er.code = opens % 2 ? 'EEXIST' : 'ENOENT' - process.nextTick(cb.bind(null, er)) - } - - lockFile.lock('retry-lock', { retries: opens }, function (er) { - if (er) throw er - t.equal(opens, 0) - lockFile.unlockSync('retry-lock') - t.end() - }) -}) - -test('retryWait', function (t) { - // next 5 opens will fail. - var opens = 5 - fs._open = fs.open - fs.open = function (path, mode, cb) { - if (--opens === 0) { - fs.open = fs._open - return fs.open(path, mode, cb) - } - var er = new Error('bogus') - // to be, or not to be, that is the question. - er.code = opens % 2 ? 'EEXIST' : 'ENOENT' - process.nextTick(cb.bind(null, er)) - } - - var opts = { retries: opens, retryWait: 100 } - lockFile.lock('retry-lock', opts, function (er) { - if (er) throw er - t.equal(opens, 0) - lockFile.unlockSync('retry-lock') - t.end() - }) -}) - -test('retry sync', function (t) { - // next 5 opens will fail. - var opens = 5 - fs._openSync = fs.openSync - fs.openSync = function (path, mode) { - if (--opens === 0) { - fs.openSync = fs._openSync - return fs.openSync(path, mode) - } - var er = new Error('bogus') - // to be, or not to be, that is the question. - er.code = opens % 2 ? 'EEXIST' : 'ENOENT' - throw er - } - - var opts = { retries: opens } - lockFile.lockSync('retry-lock', opts) - t.equal(opens, 0) - lockFile.unlockSync('retry-lock') - t.end() -}) - -test('wait and stale together', function (t) { - // first locker. - var interval - lockFile.lock('stale-wait-lock', function(er) { - // keep refreshing the lock, so we keep it forever - interval = setInterval(function() { - touch.sync('stale-wait-lock') - }, 10) - - // try to get another lock. this must fail! - var opt = { stale: 1000, wait: 2000, pollInterval: 1000 } - lockFile.lock('stale-wait-lock', opt, function (er) { - if (!er) - t.fail('got second lock? that unpossible!') - else - t.pass('second lock failed, as i have foreseen it') - clearInterval(interval) - t.end() - }) - }) -}) - - -test('stale windows file tunneling test', function (t) { - // for windows only - // nt file system tunneling feature will make file creation time not updated - var opts = { stale: 1000 } - lockFile.lockSync('stale-windows-lock') - touch.sync('stale-windows-lock', { time: new Date(Date.now() - 3000) }) - - var locked - lockFile.unlockSync('stale-windows-lock') - lockFile.lockSync('stale-windows-lock', opts) - locked = lockFile.checkSync('stale-windows-lock', opts) - t.ok(locked, "should be locked and not stale") - lockFile.lock('stale-windows-lock', opts, function (er) { - if (!er) - t.fail('got second lock? impossible, windows file tunneling problem!') - else - t.pass('second lock failed, windows file tunneling problem fixed') - t.end() - }) -}) - - -test('cleanup', function (t) { - try { lockFile.unlockSync('basic-lock') } catch (er) {} - try { lockFile.unlockSync('sync-lock') } catch (er) {} - try { lockFile.unlockSync('never-forget') } catch (er) {} - try { lockFile.unlockSync('stale-lock') } catch (er) {} - try { lockFile.unlockSync('watch-lock') } catch (er) {} - try { lockFile.unlockSync('retry-lock') } catch (er) {} - try { lockFile.unlockSync('contentious-lock') } catch (er) {} - try { lockFile.unlockSync('stale-wait-lock') } catch (er) {} - try { lockFile.unlockSync('stale-windows-lock') } catch (er) {} - t.end() -}) - diff --git a/node_modules/lockfile/test/fixtures/bad-child.js b/node_modules/lockfile/test/fixtures/bad-child.js deleted file mode 100644 index e65304542f49b..0000000000000 --- a/node_modules/lockfile/test/fixtures/bad-child.js +++ /dev/null @@ -1,5 +0,0 @@ -var lockFile = require('../../lockfile.js') - -lockFile.lockSync('never-forget') - -throw new Error('waaaaaaaaa') diff --git a/node_modules/lockfile/test/fixtures/child.js b/node_modules/lockfile/test/fixtures/child.js deleted file mode 100644 index 5b61d6c9110b3..0000000000000 --- a/node_modules/lockfile/test/fixtures/child.js +++ /dev/null @@ -1,3 +0,0 @@ -var lockFile = require('../../lockfile.js') - -lockFile.lock('never-forget', function () {}) diff --git a/node_modules/lockfile/test/retry-time.js b/node_modules/lockfile/test/retry-time.js deleted file mode 100644 index 7632901afa8b1..0000000000000 --- a/node_modules/lockfile/test/retry-time.js +++ /dev/null @@ -1,67 +0,0 @@ -// In these tests, we do the following: -// try for 200ms (rt=2) -// wait for 300ms -// try for 200ms (rt=1) -// wait for 300ms -// try for 200ms (rt=0) -// fail after 1200 -// Actual time will be more like 1220-ish for setTimeout irregularity -// But it should NOT be as slow as 2000. - -var lockFile = require('../') -var touch = require('touch') -var test = require('tap').test -var fs = require('fs') - -var RETRYWAIT = 100 -var WAIT = 100 -var RETRIES = 2 -var EXPECTTIME = (RETRYWAIT * RETRIES) + (WAIT * (RETRIES + 1)) -var TOOLONG = EXPECTTIME * 1.5 - -test('setup', function (t) { - touch.sync('file.lock') - t.end() -}) - -var pollPeriods = [10, 100, 10000] -pollPeriods.forEach(function (pp) { - test('retry+wait, poll=' + pp, function (t) { - var ended = false - var timer = setTimeout(function() { - t.fail('taking too long!') - ended = true - t.end() - }, 2000) - - if (timer.unref) - timer.unref() - - var start = Date.now() - lockFile.lock('file.lock', { - wait: WAIT, - retries: RETRIES, - retryWait: RETRYWAIT, - pollPeriod: pp - }, function (er) { - if (ended) return - var time = Date.now() - start - t.ok(time >= EXPECTTIME, 'should take at least ' + EXPECTTIME) - t.ok(time < TOOLONG, 'should take less than ' + TOOLONG) - clearTimeout(timer) - t.end() - }) - }) -}) - -test('cleanup', function (t) { - fs.unlinkSync('file.lock') - t.end() - var timer = setTimeout(function() { - process.exit(1) - }, 500) - if (timer.unref) - timer.unref() - else - clearTimeout(timer) -}) diff --git a/node_modules/lockfile/test/stale-contention.js b/node_modules/lockfile/test/stale-contention.js deleted file mode 100644 index 85cbf92e93849..0000000000000 --- a/node_modules/lockfile/test/stale-contention.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('fs') -var lockFile = require('../') -var test = require('tap').test -var path = require('path') -var lock = path.resolve(__dirname, 'stale.lock') -var touch = require('touch') -var spawn = require('child_process').spawn -var node = process.execPath - -// We're using a lockfile with an artificially old date, -// so make it use that instead of ctime. -// Probably you should never do this in production! -lockFile.filetime = 'mtime' - -if (process.argv[2] === 'child') { - return child() -} - -function child () { - // Make fs.stat take 100ms to return its data - // This is important because, in a test scenario where - // we're statting the same exact file rapid-fire like this, - // it'll end up being cached by the FS, and never trigger - // the race condition we're trying to expose. - fs.stat = function (stat) { return function () { - var args = [].slice.call(arguments) - var cb = args.pop() - stat.apply(fs, args.concat(function(er, st) { - setTimeout(function () { - cb(er, st) - }, 100) - })) - }}(fs.stat) - - lockFile.lock(lock, { stale: 100000 }, function (er) { - if (er && er.code !== 'EEXIST') - throw er - else if (er) - process.exit(17) - else - setTimeout(function(){}, 500) - }) -} - -test('create stale file', function (t) { - try { fs.unlinkSync(lock) } catch (er) {} - touch.sync(lock, { time: '1979-07-01T19:10:00.000Z' }) - t.end() -}) - -test('contenders', function (t) { - var n = 10 - var fails = 0 - var wins = 0 - var args = [ __filename, 'child' ] - var opt = { stdio: [0, "pipe", 2] } - for (var i = 0; i < n; i++) { - spawn(node, args, opt).on('close', then) - } - - function then (code) { - if (code === 17) { - fails ++ - } else if (code) { - t.fail("unexpected failure", code) - fails ++ - } else { - wins ++ - } - if (fails + wins === n) { - done() - } - } - - function done () { - t.equal(wins, 1, "should have 1 lock winner") - t.equal(fails, n - 1, "all others should lose") - t.end() - } -}) - -test('remove stale file', function (t) { - try { fs.unlinkSync(lock) } catch (er) {} - t.end() -}) diff --git a/node_modules/lockfile/test/unlock-no-cb.js b/node_modules/lockfile/test/unlock-no-cb.js deleted file mode 100644 index df160923ebc6d..0000000000000 --- a/node_modules/lockfile/test/unlock-no-cb.js +++ /dev/null @@ -1,10 +0,0 @@ -var t = require('tap') -if (/0\.(10|8)/.test(process.version)) { - t.pass('just a dummy test, no beforeExit in this node version') -} else { - process.on('beforeExit', function (code) { - t.equal(code, 0, 'did not throw') - }) -} -var lf = require('lockfile') -lf.unlock('no-file-no-cb') diff --git a/package-lock.json b/package-lock.json index 65b2dd3238d35..f9fd3a90e3421 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,6 @@ "libnpmsearch", "libnpmteam", "libnpmversion", - "lockfile", "make-fetch-happen", "mkdirp", "mkdirp-infer-owner", @@ -116,7 +115,6 @@ "libnpmsearch": "^3.0.0", "libnpmteam": "^2.0.1", "libnpmversion": "^1.0.5", - "lockfile": "^1.0.4", "make-fetch-happen": "^8.0.9", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", @@ -3560,15 +3558,6 @@ "node": ">=4" } }, - "node_modules/lockfile": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz", - "integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==", - "inBundle": true, - "dependencies": { - "signal-exit": "^3.0.2" - } - }, "node_modules/lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", @@ -10956,14 +10945,6 @@ "path-exists": "^3.0.0" } }, - "lockfile": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz", - "integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==", - "requires": { - "signal-exit": "^3.0.2" - } - }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", diff --git a/package.json b/package.json index 358843feda1a9..d8f73525f9376 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "libnpmsearch": "^3.0.0", "libnpmteam": "^2.0.1", "libnpmversion": "^1.0.5", - "lockfile": "^1.0.4", "make-fetch-happen": "^8.0.9", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", @@ -149,7 +148,6 @@ "libnpmsearch", "libnpmteam", "libnpmversion", - "lockfile", "make-fetch-happen", "mkdirp", "mkdirp-infer-owner", From 7bc474d7cb2e2e083fd8358d0648d7c5fb43707f Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 15:00:23 -0400 Subject: [PATCH 27/39] chore: remove unused once dep --- package-lock.json | 2 -- package.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f9fd3a90e3421..9b279f16b328c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,6 @@ "npm-registry-fetch", "npm-user-validate", "npmlog", - "once", "opener", "pacote", "parse-conflict-json", @@ -127,7 +126,6 @@ "npm-registry-fetch": "^8.1.4", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", - "once": "~1.4.0", "opener": "^1.5.2", "pacote": "^11.1.10", "parse-conflict-json": "^1.1.1", diff --git a/package.json b/package.json index d8f73525f9376..592e19f0b4a94 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,6 @@ "npm-registry-fetch": "^8.1.4", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", - "once": "~1.4.0", "opener": "^1.5.2", "pacote": "^11.1.10", "parse-conflict-json": "^1.1.1", @@ -160,7 +159,6 @@ "npm-registry-fetch", "npm-user-validate", "npmlog", - "once", "opener", "pacote", "parse-conflict-json", From 5c5e0099a4708ec84da3d2e427e16c4a9cfe3c8a Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 15:02:23 -0400 Subject: [PATCH 28/39] chore: removed unused retry dep --- node_modules/retry/.npmignore | 3 - node_modules/retry/.travis.yml | 15 - node_modules/retry/License | 21 -- node_modules/retry/Makefile | 18 -- node_modules/retry/Readme.md | 227 --------------- node_modules/retry/equation.gif | Bin 1209 -> 0 bytes node_modules/retry/example/dns.js | 31 --- node_modules/retry/example/stop.js | 40 --- node_modules/retry/index.js | 1 - node_modules/retry/lib/retry.js | 100 ------- node_modules/retry/lib/retry_operation.js | 158 ----------- node_modules/retry/package.json | 32 --- node_modules/retry/test/common.js | 10 - .../retry/test/integration/test-forever.js | 24 -- .../test/integration/test-retry-operation.js | 258 ------------------ .../retry/test/integration/test-retry-wrap.js | 101 ------- .../retry/test/integration/test-timeouts.js | 69 ----- package-lock.json | 16 -- package.json | 2 - 19 files changed, 1126 deletions(-) delete mode 100644 node_modules/retry/.npmignore delete mode 100644 node_modules/retry/.travis.yml delete mode 100644 node_modules/retry/License delete mode 100644 node_modules/retry/Makefile delete mode 100644 node_modules/retry/Readme.md delete mode 100644 node_modules/retry/equation.gif delete mode 100644 node_modules/retry/example/dns.js delete mode 100644 node_modules/retry/example/stop.js delete mode 100644 node_modules/retry/index.js delete mode 100644 node_modules/retry/lib/retry.js delete mode 100644 node_modules/retry/lib/retry_operation.js delete mode 100644 node_modules/retry/package.json delete mode 100644 node_modules/retry/test/common.js delete mode 100644 node_modules/retry/test/integration/test-forever.js delete mode 100644 node_modules/retry/test/integration/test-retry-operation.js delete mode 100644 node_modules/retry/test/integration/test-retry-wrap.js delete mode 100644 node_modules/retry/test/integration/test-timeouts.js diff --git a/node_modules/retry/.npmignore b/node_modules/retry/.npmignore deleted file mode 100644 index 432f2855d6839..0000000000000 --- a/node_modules/retry/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules/* -npm-debug.log -coverage diff --git a/node_modules/retry/.travis.yml b/node_modules/retry/.travis.yml deleted file mode 100644 index bcde2122b9006..0000000000000 --- a/node_modules/retry/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: node_js -node_js: - - "4" -before_install: - - pip install --user codecov -after_success: - - codecov --file coverage/lcov.info --disable search -# travis encrypt [subdomain]:[api token]@[room id] -# notifications: -# email: false -# campfire: -# rooms: -# secure: xyz -# on_failure: always -# on_success: always diff --git a/node_modules/retry/License b/node_modules/retry/License deleted file mode 100644 index 0b58de379fb30..0000000000000 --- a/node_modules/retry/License +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011: -Tim Koschützki (tim@debuggable.com) -Felix Geisendörfer (felix@debuggable.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/retry/Makefile b/node_modules/retry/Makefile deleted file mode 100644 index 1968d8ff8b07b..0000000000000 --- a/node_modules/retry/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -SHELL := /bin/bash - -release-major: test - npm version major -m "Release %s" - git push - npm publish - -release-minor: test - npm version minor -m "Release %s" - git push - npm publish - -release-patch: test - npm version patch -m "Release %s" - git push - npm publish - -.PHONY: test release-major release-minor release-patch diff --git a/node_modules/retry/Readme.md b/node_modules/retry/Readme.md deleted file mode 100644 index 16e28ec267d6d..0000000000000 --- a/node_modules/retry/Readme.md +++ /dev/null @@ -1,227 +0,0 @@ - -[![Build Status](https://secure.travis-ci.org/tim-kos/node-retry.png?branch=master)](http://travis-ci.org/tim-kos/node-retry "Check this project's build status on TravisCI") -[![codecov](https://codecov.io/gh/tim-kos/node-retry/branch/master/graph/badge.svg)](https://codecov.io/gh/tim-kos/node-retry) - - -# retry - -Abstraction for exponential and custom retry strategies for failed operations. - -## Installation - - npm install retry - -## Current Status - -This module has been tested and is ready to be used. - -## Tutorial - -The example below will retry a potentially failing `dns.resolve` operation -`10` times using an exponential backoff strategy. With the default settings, this -means the last attempt is made after `17 minutes and 3 seconds`. - -``` javascript -var dns = require('dns'); -var retry = require('retry'); - -function faultTolerantResolve(address, cb) { - var operation = retry.operation(); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(err ? operation.mainError() : null, addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, addresses) { - console.log(err, addresses); -}); -``` - -Of course you can also configure the factors that go into the exponential -backoff. See the API documentation below for all available settings. -currentAttempt is an int representing the number of attempts so far. - -``` javascript -var operation = retry.operation({ - retries: 5, - factor: 3, - minTimeout: 1 * 1000, - maxTimeout: 60 * 1000, - randomize: true, -}); -``` - -## API - -### retry.operation([options]) - -Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: - -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Whether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. -* `maxRetryTime`: The maximum time (in milliseconds) that the retried operation is allowed to run. Default is `Infinity`. - -### retry.timeouts([options]) - -Returns an array of timeouts. All time `options` and return values are in -milliseconds. If `options` is an array, a copy of that array is returned. - -`options` is a JS object that can contain any of the following keys: - -* `retries`: The maximum amount of times to retry the operation. Default is `10`. Seting this to `1` means `do it once, then retry it once`. -* `factor`: The exponential factor to use. Default is `2`. -* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. -* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. -* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. - -The formula used to calculate the individual timeouts is: - -``` -Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) -``` - -Have a look at [this article][article] for a better explanation of approach. - -If you want to tune your `factor` / `times` settings to attempt the last retry -after a certain amount of time, you can use wolfram alpha. For example in order -to tune for `10` attempts in `5 minutes`, you can use this equation: - -![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) - -Explaining the various values from left to right: - -* `k = 0 ... 9`: The `retries` value (10) -* `1000`: The `minTimeout` value in ms (1000) -* `x^k`: No need to change this, `x` will be your resulting factor -* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) - -To make this a little easier for you, use wolfram alpha to do the calculations: - - - -[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html - -### retry.createTimeout(attempt, opts) - -Returns a new `timeout` (integer in milliseconds) based on the given parameters. - -`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). - -`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. - -`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). - -### retry.wrap(obj, [options], [methodNames]) - -Wrap all functions of the `obj` with retry. Optionally you can pass operation options and -an array of method names which need to be wrapped. - -``` -retry.wrap(obj) - -retry.wrap(obj, ['method1', 'method2']) - -retry.wrap(obj, {retries: 3}) - -retry.wrap(obj, {retries: 3}, ['method1', 'method2']) -``` -The `options` object can take any options that the usual call to `retry.operation` can take. - -### new RetryOperation(timeouts, [options]) - -Creates a new `RetryOperation` where `timeouts` is an array where each value is -a timeout given in milliseconds. - -Available options: -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -If `forever` is true, the following changes happen: -* `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. - -#### retryOperation.errors() - -Returns an array of all errors that have been passed to `retryOperation.retry()` so far. The -returning array has the errors ordered chronologically based on when they were passed to -`retryOperation.retry()`, which means the first passed error is at index zero and the last is -at the last index. - -#### retryOperation.mainError() - -A reference to the error object that occured most frequently. Errors are -compared using the `error.message` property. - -If multiple error messages occured the same amount of time, the last error -object with that message is returned. - -If no errors occured so far, the value is `null`. - -#### retryOperation.attempt(fn, timeoutOps) - -Defines the function `fn` that is to be retried and executes it for the first -time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. - -Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. -Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. - - -#### retryOperation.try(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.start(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.retry(error) - -Returns `false` when no `error` value is given, or the maximum amount of retries -has been reached. - -Otherwise it returns `true`, and retries the operation after the timeout for -the current attempt number. - -#### retryOperation.stop() - -Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. - -#### retryOperation.reset() - -Resets the internal state of the operation object, so that you can call `attempt()` again as if this was a new operation object. - -#### retryOperation.attempts() - -Returns an int representing the number of attempts it took to call `fn` before it was successful. - -## License - -retry is licensed under the MIT license. - - -# Changelog - -0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. - -0.9.0 Adding `unref` functionality, thanks to @satazor. - -0.8.0 Implementing retry.wrap. - -0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). - -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. - -0.5.0 Some minor refactoring. - -0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. - -0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). - -0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/node_modules/retry/equation.gif b/node_modules/retry/equation.gif deleted file mode 100644 index 97107237ba19f51997d8d76135bc7d1486d856f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1209 zcmV;q1V;NuNk%w1VXpu&0M!5h000001ONyK2nY-a5D*X$6c88~7#JKFARr(hBp@j$ zDJd)|F)%SPG%-0iIXOHzK|n!4L_tbON=i&hQczM-RZ?16T3TINVqs!pWnyY+YHDq2 zb8&NXb#r@pdwYF*gMovCg@cQUi;Inml#!H_m6V*BoSdDUq@kpwrKGH?tgNoAw6e6c zwzR#vy}iD@#lpqK#>LIb&CSlu)za0~*45tH-rnBc=Hlk&=H~9|?(XjH_VV`j_V)k! z|NsC0EC2ui0IvWs000L6z@KnPEENVOfMTEH9c0Z7p9z3<`87kr4n!IH|Ew$buF^Tr6-3^@midQKv4UFk?fCD@~8E z@HgbfvLPrU7IV4gfp|8%C^H$l;qq zLJ;`y;|7BS2YlpEz->xcBQ#7@yHNtNkOmwQ1ek!X@sGzuLXR#jx2fyLw;309jQGe6 zL`?+$umPZ&50}J^BQGxGIN%{G2=u5hqw|pm*t2Ul0ssMk0vb%GI^lz~c)})l{~Qc?h2kCMJmBf=4KTfq+A}mV<6G&6wD3KiFu51s1j8f&fS0 zFaiqI41q&$@ZBIIl0*neBoe|cd1H+<3Zdf>DJ(#i62j@_f)Fj-_2my?IyGjQMd%>G z07WXH-J3lkxMd6n7?DE>JIL@P5d*{^#0>(>vA~&p4RL3ldlu2^8P z!OlGQ%z<|`+iWomtGr?~EJ7!(^wLZ>?ex=7N4-QZ)=BNMGD+xg!3P&;Y_%-ZByj;I zEWG$NFy8zC&JhLd@WT!ToDGaV{P^?c4^0Iv_b4i{ghbnK$GtZyTzMtL-DCey_TZ>w XwprD$S>S;MUNdg_<(OxVL=XTw-hl|W diff --git a/node_modules/retry/example/dns.js b/node_modules/retry/example/dns.js deleted file mode 100644 index 446729b6f9af6..0000000000000 --- a/node_modules/retry/example/dns.js +++ /dev/null @@ -1,31 +0,0 @@ -var dns = require('dns'); -var retry = require('../lib/retry'); - -function faultTolerantResolve(address, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, errors, addresses) { - console.warn('err:'); - console.log(err); - - console.warn('addresses:'); - console.log(addresses); -}); \ No newline at end of file diff --git a/node_modules/retry/example/stop.js b/node_modules/retry/example/stop.js deleted file mode 100644 index e1ceafeebafc5..0000000000000 --- a/node_modules/retry/example/stop.js +++ /dev/null @@ -1,40 +0,0 @@ -var retry = require('../lib/retry'); - -function attemptAsyncOperation(someInput, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - failingAsyncOperation(someInput, function(err, result) { - - if (err && err.message === 'A fatal error') { - operation.stop(); - return cb(err); - } - - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), result); - }); - }); -} - -attemptAsyncOperation('test input', function(err, errors, result) { - console.warn('err:'); - console.log(err); - - console.warn('result:'); - console.log(result); -}); - -function failingAsyncOperation(input, cb) { - return setImmediate(cb.bind(null, new Error('A fatal error'))); -} diff --git a/node_modules/retry/index.js b/node_modules/retry/index.js deleted file mode 100644 index ee62f3a112c28..0000000000000 --- a/node_modules/retry/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/node_modules/retry/lib/retry.js b/node_modules/retry/lib/retry.js deleted file mode 100644 index dcb5768072794..0000000000000 --- a/node_modules/retry/lib/retry.js +++ /dev/null @@ -1,100 +0,0 @@ -var RetryOperation = require('./retry_operation'); - -exports.operation = function(options) { - var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, { - forever: options && options.forever, - unref: options && options.unref, - maxRetryTime: options && options.maxRetryTime - }); -}; - -exports.timeouts = function(options) { - if (options instanceof Array) { - return [].concat(options); - } - - var opts = { - retries: 10, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: Infinity, - randomize: false - }; - for (var key in options) { - opts[key] = options[key]; - } - - if (opts.minTimeout > opts.maxTimeout) { - throw new Error('minTimeout is greater than maxTimeout'); - } - - var timeouts = []; - for (var i = 0; i < opts.retries; i++) { - timeouts.push(this.createTimeout(i, opts)); - } - - if (options && options.forever && !timeouts.length) { - timeouts.push(this.createTimeout(i, opts)); - } - - // sort the array numerically ascending - timeouts.sort(function(a,b) { - return a - b; - }); - - return timeouts; -}; - -exports.createTimeout = function(attempt, opts) { - var random = (opts.randomize) - ? (Math.random() + 1) - : 1; - - var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); - timeout = Math.min(timeout, opts.maxTimeout); - - return timeout; -}; - -exports.wrap = function(obj, options, methods) { - if (options instanceof Array) { - methods = options; - options = null; - } - - if (!methods) { - methods = []; - for (var key in obj) { - if (typeof obj[key] === 'function') { - methods.push(key); - } - } - } - - for (var i = 0; i < methods.length; i++) { - var method = methods[i]; - var original = obj[method]; - - obj[method] = function retryWrapper(original) { - var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments, 1); - var callback = args.pop(); - - args.push(function(err) { - if (op.retry(err)) { - return; - } - if (err) { - arguments[0] = op.mainError(); - } - callback.apply(this, arguments); - }); - - op.attempt(function() { - original.apply(obj, args); - }); - }.bind(obj, original); - obj[method].options = options; - } -}; diff --git a/node_modules/retry/lib/retry_operation.js b/node_modules/retry/lib/retry_operation.js deleted file mode 100644 index 1e564696fe7e0..0000000000000 --- a/node_modules/retry/lib/retry_operation.js +++ /dev/null @@ -1,158 +0,0 @@ -function RetryOperation(timeouts, options) { - // Compatibility for the old (timeouts, retryForever) signature - if (typeof options === 'boolean') { - options = { forever: options }; - } - - this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); - this._timeouts = timeouts; - this._options = options || {}; - this._maxRetryTime = options && options.maxRetryTime || Infinity; - this._fn = null; - this._errors = []; - this._attempts = 1; - this._operationTimeout = null; - this._operationTimeoutCb = null; - this._timeout = null; - this._operationStart = null; - - if (this._options.forever) { - this._cachedTimeouts = this._timeouts.slice(0); - } -} -module.exports = RetryOperation; - -RetryOperation.prototype.reset = function() { - this._attempts = 1; - this._timeouts = this._originalTimeouts; -} - -RetryOperation.prototype.stop = function() { - if (this._timeout) { - clearTimeout(this._timeout); - } - - this._timeouts = []; - this._cachedTimeouts = null; -}; - -RetryOperation.prototype.retry = function(err) { - if (this._timeout) { - clearTimeout(this._timeout); - } - - if (!err) { - return false; - } - var currentTime = new Date().getTime(); - if (err && currentTime - this._operationStart >= this._maxRetryTime) { - this._errors.unshift(new Error('RetryOperation timeout occurred')); - return false; - } - - this._errors.push(err); - - var timeout = this._timeouts.shift(); - if (timeout === undefined) { - if (this._cachedTimeouts) { - // retry forever, only keep last error - this._errors.splice(this._errors.length - 1, this._errors.length); - this._timeouts = this._cachedTimeouts.slice(0); - timeout = this._timeouts.shift(); - } else { - return false; - } - } - - var self = this; - var timer = setTimeout(function() { - self._attempts++; - - if (self._operationTimeoutCb) { - self._timeout = setTimeout(function() { - self._operationTimeoutCb(self._attempts); - }, self._operationTimeout); - - if (self._options.unref) { - self._timeout.unref(); - } - } - - self._fn(self._attempts); - }, timeout); - - if (this._options.unref) { - timer.unref(); - } - - return true; -}; - -RetryOperation.prototype.attempt = function(fn, timeoutOps) { - this._fn = fn; - - if (timeoutOps) { - if (timeoutOps.timeout) { - this._operationTimeout = timeoutOps.timeout; - } - if (timeoutOps.cb) { - this._operationTimeoutCb = timeoutOps.cb; - } - } - - var self = this; - if (this._operationTimeoutCb) { - this._timeout = setTimeout(function() { - self._operationTimeoutCb(); - }, self._operationTimeout); - } - - this._operationStart = new Date().getTime(); - - this._fn(this._attempts); -}; - -RetryOperation.prototype.try = function(fn) { - console.log('Using RetryOperation.try() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = function(fn) { - console.log('Using RetryOperation.start() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = RetryOperation.prototype.try; - -RetryOperation.prototype.errors = function() { - return this._errors; -}; - -RetryOperation.prototype.attempts = function() { - return this._attempts; -}; - -RetryOperation.prototype.mainError = function() { - if (this._errors.length === 0) { - return null; - } - - var counts = {}; - var mainError = null; - var mainErrorCount = 0; - - for (var i = 0; i < this._errors.length; i++) { - var error = this._errors[i]; - var message = error.message; - var count = (counts[message] || 0) + 1; - - counts[message] = count; - - if (count >= mainErrorCount) { - mainError = error; - mainErrorCount = count; - } - } - - return mainError; -}; diff --git a/node_modules/retry/package.json b/node_modules/retry/package.json deleted file mode 100644 index 73c7259707aee..0000000000000 --- a/node_modules/retry/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": "Tim Koschützki (http://debuggable.com/)", - "name": "retry", - "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "license": "MIT", - "version": "0.12.0", - "homepage": "https://github.com/tim-kos/node-retry", - "repository": { - "type": "git", - "url": "git://github.com/tim-kos/node-retry.git" - }, - "directories": { - "lib": "./lib" - }, - "main": "index", - "engines": { - "node": ">= 4" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "istanbul": "^0.4.5", - "tape": "^4.8.0" - }, - "scripts": { - "test": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./test/integration/*.js", - "release:major": "env SEMANTIC=major npm run release", - "release:minor": "env SEMANTIC=minor npm run release", - "release:patch": "env SEMANTIC=patch npm run release", - "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish" - } -} diff --git a/node_modules/retry/test/common.js b/node_modules/retry/test/common.js deleted file mode 100644 index 224720696ebac..0000000000000 --- a/node_modules/retry/test/common.js +++ /dev/null @@ -1,10 +0,0 @@ -var common = module.exports; -var path = require('path'); - -var rootDir = path.join(__dirname, '..'); -common.dir = { - lib: rootDir + '/lib' -}; - -common.assert = require('assert'); -common.fake = require('fake'); \ No newline at end of file diff --git a/node_modules/retry/test/integration/test-forever.js b/node_modules/retry/test/integration/test-forever.js deleted file mode 100644 index b41307cb529f1..0000000000000 --- a/node_modules/retry/test/integration/test-forever.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testForeverUsesFirstTimeout() { - var operation = retry.operation({ - retries: 0, - minTimeout: 100, - maxTimeout: 100, - forever: true - }); - - operation.attempt(function(numAttempt) { - console.log('>numAttempt', numAttempt); - var err = new Error("foo"); - if (numAttempt == 10) { - operation.stop(); - } - - if (operation.retry(err)) { - return; - } - }); -})(); diff --git a/node_modules/retry/test/integration/test-retry-operation.js b/node_modules/retry/test/integration/test-retry-operation.js deleted file mode 100644 index e351bb683ed44..0000000000000 --- a/node_modules/retry/test/integration/test-retry-operation.js +++ /dev/null @@ -1,258 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -(function testReset() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var expectedFinishes = 1; - var finishes = 0; - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (operation.retry(error)) { - return; - } - - finishes++ - assert.equal(expectedFinishes, finishes); - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - - if (finishes < 2) { - attempts = 0; - expectedFinishes++; - operation.reset(); - fn() - } else { - finalCallback(); - } - }); - }; - - fn(); -})(); - -(function testErrors() { - var operation = retry.operation(); - - var error = new Error('some error'); - var error2 = new Error('some other error'); - operation._errors.push(error); - operation._errors.push(error2); - - assert.deepEqual(operation.errors(), [error, error2]); -})(); - -(function testMainErrorReturnsMostFrequentError() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - operation._errors.push(error); - - assert.strictEqual(operation.mainError(), error); -})(); - -(function testMainErrorReturnsLastErrorOnEqualCount() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - - assert.strictEqual(operation.mainError(), error2); -})(); - -(function testAttempt() { - var operation = retry.operation(); - var fn = new Function(); - - var timeoutOpts = { - timeout: 1, - cb: function() {} - }; - operation.attempt(fn, timeoutOpts); - - assert.strictEqual(fn, operation._fn); - assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); - assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); -})(); - -(function testRetry() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForever() { - var error = new Error('some error'); - var operation = retry.operation({ retries: 3, forever: true }); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 6 && operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 6); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForeverNoRetries() { - var error = new Error('some error'); - var delay = 50 - var operation = retry.operation({ - retries: null, - forever: true, - minTimeout: delay, - maxTimeout: delay - }); - - var attempts = 0; - var startTime = new Date().getTime(); - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 4 && operation.retry(error)) { - return; - } - - var endTime = new Date().getTime(); - var minTime = startTime + (delay * 3); - var maxTime = minTime + 20 // add a little headroom for code execution time - assert(endTime >= minTime) - assert(endTime < maxTime) - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testStop() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - - if (attempts === 2) { - operation.stop(); - - assert.strictEqual(attempts, 2); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - } - - if (operation.retry(error)) { - return; - } - }); - }; - - fn(); -})(); - -(function testMaxRetryTime() { - var error = new Error('some error'); - var maxRetryTime = 30; - var operation = retry.operation({ - minTimeout: 1, - maxRetryTime: maxRetryTime - }); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var longAsyncFunction = function (wait, callback){ - setTimeout(callback, wait); - }; - - var fn = function() { - var startTime = new Date().getTime(); - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - - if (attempts !== 2) { - if (operation.retry(error)) { - return; - } - } else { - var curTime = new Date().getTime(); - longAsyncFunction(maxRetryTime - (curTime - startTime - 1), function(){ - if (operation.retry(error)) { - assert.fail('timeout should be occurred'); - return; - } - - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - } - }); - }; - - fn(); -})(); diff --git a/node_modules/retry/test/integration/test-retry-wrap.js b/node_modules/retry/test/integration/test-retry-wrap.js deleted file mode 100644 index 3d2b6bfa6436d..0000000000000 --- a/node_modules/retry/test/integration/test-retry-wrap.js +++ /dev/null @@ -1,101 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -function getLib() { - return { - fn1: function() {}, - fn2: function() {}, - fn3: function() {} - }; -} - -(function wrapAll() { - var lib = getLib(); - retry.wrap(lib); - assert.equal(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); -}()); - -(function wrapAllPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}); - assert.equal(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); - assert.equal(lib.fn1.options.retries, 2); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function wrapDefined() { - var lib = getLib(); - retry.wrap(lib, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); -}()); - -(function wrapDefinedAndPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function runWrappedWithoutError() { - var callbackCalled; - var lib = {method: function(a, b, callback) { - assert.equal(a, 1); - assert.equal(b, 2); - assert.equal(typeof callback, 'function'); - callback(); - }}; - retry.wrap(lib); - lib.method(1, 2, function() { - callbackCalled = true; - }); - assert.ok(callbackCalled); -}()); - -(function runWrappedSeveralWithoutError() { - var callbacksCalled = 0; - var lib = { - fn1: function (a, callback) { - assert.equal(a, 1); - assert.equal(typeof callback, 'function'); - callback(); - }, - fn2: function (a, callback) { - assert.equal(a, 2); - assert.equal(typeof callback, 'function'); - callback(); - } - }; - retry.wrap(lib, {}, ['fn1', 'fn2']); - lib.fn1(1, function() { - callbacksCalled++; - }); - lib.fn2(2, function() { - callbacksCalled++; - }); - assert.equal(callbacksCalled, 2); -}()); - -(function runWrappedWithError() { - var callbackCalled; - var lib = {method: function(callback) { - callback(new Error('Some error')); - }}; - retry.wrap(lib, {retries: 1}); - lib.method(function(err) { - callbackCalled = true; - assert.ok(err instanceof Error); - }); - assert.ok(!callbackCalled); -}()); diff --git a/node_modules/retry/test/integration/test-timeouts.js b/node_modules/retry/test/integration/test-timeouts.js deleted file mode 100644 index 7206b0fb0b01d..0000000000000 --- a/node_modules/retry/test/integration/test-timeouts.js +++ /dev/null @@ -1,69 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testDefaultValues() { - var timeouts = retry.timeouts(); - - assert.equal(timeouts.length, 10); - assert.equal(timeouts[0], 1000); - assert.equal(timeouts[1], 2000); - assert.equal(timeouts[2], 4000); -})(); - -(function testDefaultValuesWithRandomize() { - var minTimeout = 5000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - randomize: true - }); - - assert.equal(timeouts.length, 10); - assert.ok(timeouts[0] > minTimeout); - assert.ok(timeouts[1] > timeouts[0]); - assert.ok(timeouts[2] > timeouts[1]); -})(); - -(function testPassedTimeoutsAreUsed() { - var timeoutsArray = [1000, 2000, 3000]; - var timeouts = retry.timeouts(timeoutsArray); - assert.deepEqual(timeouts, timeoutsArray); - assert.notStrictEqual(timeouts, timeoutsArray); -})(); - -(function testTimeoutsAreWithinBoundaries() { - var minTimeout = 1000; - var maxTimeout = 10000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - maxTimeout: maxTimeout - }); - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] >= minTimeout); - assert.ok(timeouts[i] <= maxTimeout); - } -})(); - -(function testTimeoutsAreIncremental() { - var timeouts = retry.timeouts(); - var lastTimeout = timeouts[0]; - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] > lastTimeout); - lastTimeout = timeouts[i]; - } -})(); - -(function testTimeoutsAreIncrementalForFactorsLessThanOne() { - var timeouts = retry.timeouts({ - retries: 3, - factor: 0.5 - }); - - var expected = [250, 500, 1000]; - assert.deepEqual(expected, timeouts); -})(); - -(function testRetries() { - var timeouts = retry.timeouts({retries: 2}); - assert.strictEqual(timeouts.length, 2); -})(); diff --git a/package-lock.json b/package-lock.json index 9b279f16b328c..ba561f672f88a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,6 @@ "read", "read-package-json", "read-package-json-fast", - "retry", "rimraf", "semver", "sha", @@ -133,7 +132,6 @@ "read": "~1.0.7", "read-package-json": "^2.1.2", "read-package-json-fast": "^1.2.1", - "retry": "^0.12.0", "rimraf": "^3.0.2", "semver": "^7.3.2", "sha": "^3.0.0", @@ -5047,15 +5045,6 @@ "node": ">=4" } }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", - "inBundle": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -12053,11 +12042,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", diff --git a/package.json b/package.json index 592e19f0b4a94..855a199ea6770 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,6 @@ "read": "~1.0.7", "read-package-json": "^2.1.2", "read-package-json-fast": "^1.2.1", - "retry": "^0.12.0", "rimraf": "^3.0.2", "semver": "^7.3.2", "sha": "^3.0.0", @@ -166,7 +165,6 @@ "read", "read-package-json", "read-package-json-fast", - "retry", "rimraf", "semver", "sha", From cfaddd334b8b1eddcefa3cd2a9b823ec140271a4 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 15:03:27 -0400 Subject: [PATCH 29/39] chore: remove unused sha dep --- node_modules/sha/LICENSE | 46 --------------- node_modules/sha/README.md | 49 ---------------- node_modules/sha/index.js | 107 ---------------------------------- node_modules/sha/package.json | 22 ------- package-lock.json | 19 ------ package.json | 2 - 6 files changed, 245 deletions(-) delete mode 100644 node_modules/sha/LICENSE delete mode 100644 node_modules/sha/README.md delete mode 100644 node_modules/sha/index.js delete mode 100644 node_modules/sha/package.json diff --git a/node_modules/sha/LICENSE b/node_modules/sha/LICENSE deleted file mode 100644 index 048a6f99d223f..0000000000000 --- a/node_modules/sha/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -Copyright (c) 2013 Forbes Lindesay - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The MIT License (MIT) - -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. \ No newline at end of file diff --git a/node_modules/sha/README.md b/node_modules/sha/README.md deleted file mode 100644 index 43742bf479792..0000000000000 --- a/node_modules/sha/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# sha - -Check and get file hashes (using any algorithm) - -[![Build Status](https://img.shields.io/travis/ForbesLindesay/sha/master.svg)](https://travis-ci.org/ForbesLindesay/sha) -[![Dependency Status](https://img.shields.io/david/ForbesLindesay/sha.svg)](https://david-dm.org/ForbesLindesay/sha) -[![NPM version](https://img.shields.io/npm/v/sha.svg)](https://www.npmjs.com/package/sha) - -## Installation - - $ npm install sha - -## API - -### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options]) - -Asynchronously check that `fileName` has a "hash" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match). - -Options: - -- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` - -### get(fileName, [options,] cb) / getSync(filename, [options]) - -Asynchronously get the "hash" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash. - -Options: - -- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` - -### stream(expected, [options]) - -Check the hash of a stream without ever buffering it. This is a pass through stream so you can do things like: - -```js -fs.createReadStream('src') - .pipe(sha.stream('expected')) - .pipe(fs.createWriteStream('dest')) -``` - -`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`. - -Options: - -- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` - -## License - -You may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request. \ No newline at end of file diff --git a/node_modules/sha/index.js b/node_modules/sha/index.js deleted file mode 100644 index 3aed3e9ccf190..0000000000000 --- a/node_modules/sha/index.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' - -var Transform = require('stream').Transform -var crypto = require('crypto') -var fs = require('graceful-fs') - -exports.check = check -exports.checkSync = checkSync -exports.get = get -exports.getSync = getSync -exports.stream = stream - -function check(file, expected, options, cb) { - if (typeof options === 'function') { - cb = options - options = undefined - } - expected = expected.toLowerCase().trim() - get(file, options, function (er, actual) { - if (er) { - if (er.message) er.message += ' while getting shasum for ' + file - return cb(er) - } - if (actual === expected) return cb(null) - cb(new Error( - 'shasum check failed for ' + file + '\n' - + 'Expected: ' + expected + '\n' - + 'Actual: ' + actual)) - }) -} -function checkSync(file, expected, options) { - expected = expected.toLowerCase().trim() - var actual - try { - actual = getSync(file, options) - } catch (er) { - if (er.message) er.message += ' while getting shasum for ' + file - throw er - } - if (actual !== expected) { - var ex = new Error( - 'shasum check failed for ' + file + '\n' - + 'Expected: ' + expected + '\n' - + 'Actual: ' + actual) - throw ex - } -} - - -function get(file, options, cb) { - if (typeof options === 'function') { - cb = options - options = undefined - } - options = options || {} - var algorithm = options.algorithm || 'sha1' - var hash = crypto.createHash(algorithm) - var source = fs.createReadStream(file) - var errState = null - source - .on('error', function (er) { - if (errState) return - return cb(errState = er) - }) - .on('data', function (chunk) { - if (errState) return - hash.update(chunk) - }) - .on('end', function () { - if (errState) return - var actual = hash.digest("hex").toLowerCase().trim() - cb(null, actual) - }) -} - -function getSync(file, options) { - options = options || {} - var algorithm = options.algorithm || 'sha1' - var hash = crypto.createHash(algorithm) - var source = fs.readFileSync(file) - hash.update(source) - return hash.digest("hex").toLowerCase().trim() -} - -function stream(expected, options) { - expected = expected.toLowerCase().trim() - options = options || {} - var algorithm = options.algorithm || 'sha1' - var hash = crypto.createHash(algorithm) - - var stream = new Transform() - stream._transform = function (chunk, encoding, callback) { - hash.update(chunk) - stream.push(chunk) - callback() - } - stream._flush = function (cb) { - var actual = hash.digest("hex").toLowerCase().trim() - if (actual === expected) return cb(null) - cb(new Error( - 'shasum check failed for:\n' - + ' Expected: ' + expected + '\n' - + ' Actual: ' + actual)) - this.push(null) - } - return stream -} \ No newline at end of file diff --git a/node_modules/sha/package.json b/node_modules/sha/package.json deleted file mode 100644 index aca50948ec0d4..0000000000000 --- a/node_modules/sha/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "sha", - "version": "3.0.0", - "description": "Check and get file hashes", - "files": [ - "index.js" - ], - "scripts": { - "test": "mocha -R spec" - }, - "repository": { - "type": "git", - "url": "https://github.com/ForbesLindesay/sha.git" - }, - "license": "(BSD-2-Clause OR MIT)", - "dependencies": { - "graceful-fs": "^4.1.2" - }, - "devDependencies": { - "mocha": "~1.9.0" - } -} diff --git a/package-lock.json b/package-lock.json index ba561f672f88a..0a69a3fd72460 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,7 +64,6 @@ "read-package-json-fast", "rimraf", "semver", - "sha", "slide", "sorted-object", "ssri", @@ -134,7 +133,6 @@ "read-package-json-fast": "^1.2.1", "rimraf": "^3.0.2", "semver": "^7.3.2", - "sha": "^3.0.0", "slide": "~1.1.6", "sorted-object": "~2.0.1", "ssri": "^8.0.0", @@ -5090,15 +5088,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "inBundle": true }, - "node_modules/sha": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/sha/-/sha-3.0.0.tgz", - "integrity": "sha512-DOYnM37cNsLNSGIG/zZWch5CKIRNoLdYUQTQlcgkRkoYIUwDYjqDyye16YcDZg/OPdcbUgTKMjc4SY6TB7ZAPw==", - "inBundle": true, - "dependencies": { - "graceful-fs": "^4.1.2" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -12070,14 +12059,6 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "sha": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/sha/-/sha-3.0.0.tgz", - "integrity": "sha512-DOYnM37cNsLNSGIG/zZWch5CKIRNoLdYUQTQlcgkRkoYIUwDYjqDyye16YcDZg/OPdcbUgTKMjc4SY6TB7ZAPw==", - "requires": { - "graceful-fs": "^4.1.2" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", diff --git a/package.json b/package.json index 855a199ea6770..2f0f1c95de3fe 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ "read-package-json-fast": "^1.2.1", "rimraf": "^3.0.2", "semver": "^7.3.2", - "sha": "^3.0.0", "slide": "~1.1.6", "sorted-object": "~2.0.1", "ssri": "^8.0.0", @@ -167,7 +166,6 @@ "read-package-json-fast", "rimraf", "semver", - "sha", "slide", "sorted-object", "ssri", From 3a978ffc7fddd6802c81996a5710b2efd15edc11 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 15:04:24 -0400 Subject: [PATCH 30/39] chore: removed unused slide dep --- node_modules/slide/LICENSE | 15 -- node_modules/slide/README.md | 143 -------------------- node_modules/slide/index.js | 1 - node_modules/slide/lib/async-map-ordered.js | 65 --------- node_modules/slide/lib/async-map.js | 54 -------- node_modules/slide/lib/bind-actor.js | 16 --- node_modules/slide/lib/chain.js | 20 --- node_modules/slide/lib/slide.js | 3 - node_modules/slide/package.json | 20 --- package-lock.json | 16 --- package.json | 2 - 11 files changed, 355 deletions(-) delete mode 100644 node_modules/slide/LICENSE delete mode 100644 node_modules/slide/README.md delete mode 100644 node_modules/slide/index.js delete mode 100644 node_modules/slide/lib/async-map-ordered.js delete mode 100644 node_modules/slide/lib/async-map.js delete mode 100644 node_modules/slide/lib/bind-actor.js delete mode 100644 node_modules/slide/lib/chain.js delete mode 100644 node_modules/slide/lib/slide.js delete mode 100644 node_modules/slide/package.json diff --git a/node_modules/slide/LICENSE b/node_modules/slide/LICENSE deleted file mode 100644 index 05eeeb88c2ef4..0000000000000 --- a/node_modules/slide/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/slide/README.md b/node_modules/slide/README.md deleted file mode 100644 index 59ad738bca2e5..0000000000000 --- a/node_modules/slide/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# Controlling Flow: callbacks are easy - -## What's actually hard? - -- Doing a bunch of things in a specific order. -- Knowing when stuff is done. -- Handling failures. -- Breaking up functionality into parts (avoid nested inline callbacks) - - -## Common Mistakes - -- Abandoning convention and consistency. -- Putting all callbacks inline. -- Using libraries without grokking them. -- Trying to make async code look sync. - -## Define Conventions - -- Two kinds of functions: *actors* take action, *callbacks* get results. -- Essentially the continuation pattern. Resulting code *looks* similar - to fibers, but is *much* simpler to implement. -- Node works this way in the lowlevel APIs already, and it's very flexible. - -## Callbacks - -- Simple responders -- Must always be prepared to handle errors, that's why it's the first argument. -- Often inline anonymous, but not always. -- Can trap and call other callbacks with modified data, or pass errors upwards. - -## Actors - -- Last argument is a callback. -- If any error occurs, and can't be handled, pass it to the callback and return. -- Must not throw. Return value ignored. -- return x ==> return cb(null, x) -- throw er ==> return cb(er) - -```javascript -// return true if a path is either -// a symlink or a directory. -function isLinkOrDir (path, cb) { - fs.lstat(path, function (er, s) { - if (er) return cb(er) - return cb(null, s.isDirectory() || s.isSymbolicLink()) - }) -} -``` - -# asyncMap - -## Usecases - -- I have a list of 10 files, and need to read all of them, and then continue when they're all done. -- I have a dozen URLs, and need to fetch them all, and then continue when they're all done. -- I have 4 connected users, and need to send a message to all of them, and then continue when that's done. -- I have a list of n things, and I need to dosomething with all of them, in parallel, and get the results once they're all complete. - - -## Solution - -```javascript -var asyncMap = require("slide").asyncMap -function writeFiles (files, what, cb) { - asyncMap(files, function (f, cb) { - fs.writeFile(f, what, cb) - }, cb) -} -writeFiles([my, file, list], "foo", cb) -``` - -# chain - -## Usecases - -- I have to do a bunch of things, in order. Get db credentials out of a file, - read the data from the db, write that data to another file. -- If anything fails, do not continue. -- I still have to provide an array of functions, which is a lot of boilerplate, - and a pita if your functions take args like - -```javascript -function (cb) { - blah(a, b, c, cb) -} -``` - -- Results are discarded, which is a bit lame. -- No way to branch. - -## Solution - -- reduces boilerplate by converting an array of [fn, args] to an actor - that takes no arguments (except cb) -- A bit like Function#bind, but tailored for our use-case. -- bindActor(obj, "method", a, b, c) -- bindActor(fn, a, b, c) -- bindActor(obj, fn, a, b, c) -- branching, skipping over falsey arguments - -```javascript -chain([ - doThing && [thing, a, b, c] -, isFoo && [doFoo, "foo"] -, subChain && [chain, [one, two]] -], cb) -``` - -- tracking results: results are stored in an optional array passed as argument, - last result is always in results[results.length - 1]. -- treat chain.first and chain.last as placeholders for the first/last - result up until that point. - - -## Non-trivial example - -- Read number files in a directory -- Add the results together -- Ping a web service with the result -- Write the response to a file -- Delete the number files - -```javascript -var chain = require("slide").chain -function myProgram (cb) { - var res = [], last = chain.last, first = chain.first - chain([ - [fs, "readdir", "the-directory"] - , [readFiles, "the-directory", last] - , [sum, last] - , [ping, "POST", "example.com", 80, "/foo", last] - , [fs, "writeFile", "result.txt", last] - , [rmFiles, "./the-directory", first] - ], res, cb) -} -``` - -# Conclusion: Convention Profits - -- Consistent API from top to bottom. -- Sneak in at any point to inject functionality. Testable, reusable, ... -- When ruby and python users whine, you can smile condescendingly. diff --git a/node_modules/slide/index.js b/node_modules/slide/index.js deleted file mode 100644 index 0a9277f6eef52..0000000000000 --- a/node_modules/slide/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=require("./lib/slide") diff --git a/node_modules/slide/lib/async-map-ordered.js b/node_modules/slide/lib/async-map-ordered.js deleted file mode 100644 index 5cca79a82c330..0000000000000 --- a/node_modules/slide/lib/async-map-ordered.js +++ /dev/null @@ -1,65 +0,0 @@ - -throw new Error("TODO: Not yet implemented.") - -/* -usage: - -Like asyncMap, but only can take a single cb, and guarantees -the order of the results. -*/ - -module.exports = asyncMapOrdered - -function asyncMapOrdered (list, fn, cb_) { - if (typeof cb_ !== "function") throw new Error( - "No callback provided to asyncMapOrdered") - - if (typeof fn !== "function") throw new Error( - "No map function provided to asyncMapOrdered") - - if (list === undefined || list === null) return cb_(null, []) - if (!Array.isArray(list)) list = [list] - if (!list.length) return cb_(null, []) - - var errState = null - , l = list.length - , a = l - , res = [] - , resCount = 0 - , maxArgLen = 0 - - function cb (index) { return function () { - if (errState) return - var er = arguments[0] - var argLen = arguments.length - maxArgLen = Math.max(maxArgLen, argLen) - res[index] = argLen === 1 ? [er] : Array.apply(null, arguments) - - // see if any new things have been added. - if (list.length > l) { - var newList = list.slice(l) - a += (list.length - l) - var oldLen = l - l = list.length - process.nextTick(function () { - newList.forEach(function (ar, i) { fn(ar, cb(i + oldLen)) }) - }) - } - - if (er || --a === 0) { - errState = er - cb_.apply(null, [errState].concat(flip(res, resCount, maxArgLen))) - } - }} - // expect the supplied cb function to be called - // "n" times for each thing in the array. - list.forEach(function (ar) { - steps.forEach(function (fn, i) { fn(ar, cb(i)) }) - }) -} - -function flip (res, resCount, argLen) { - var flat = [] - // res = [[er, x, y], [er, x1, y1], [er, x2, y2, z2]] - // return [[x, x1, x2], [y, y1, y2], [undefined, undefined, z2]] - diff --git a/node_modules/slide/lib/async-map.js b/node_modules/slide/lib/async-map.js deleted file mode 100644 index ccf345f3c7815..0000000000000 --- a/node_modules/slide/lib/async-map.js +++ /dev/null @@ -1,54 +0,0 @@ - -/* -usage: - -// do something to a list of things -asyncMap(myListOfStuff, function (thing, cb) { doSomething(thing.foo, cb) }, cb) -// do more than one thing to each item -asyncMap(list, fooFn, barFn, cb) - -*/ - -module.exports = asyncMap - -function asyncMap () { - var steps = Array.prototype.slice.call(arguments) - , list = steps.shift() || [] - , cb_ = steps.pop() - if (typeof cb_ !== "function") throw new Error( - "No callback provided to asyncMap") - if (!list) return cb_(null, []) - if (!Array.isArray(list)) list = [list] - var n = steps.length - , data = [] // 2d array - , errState = null - , l = list.length - , a = l * n - if (!a) return cb_(null, []) - function cb (er) { - if (er && !errState) errState = er - - var argLen = arguments.length - for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) { - data[i - 1] = (data[i - 1] || []).concat(arguments[i]) - } - // see if any new things have been added. - if (list.length > l) { - var newList = list.slice(l) - a += (list.length - l) * n - l = list.length - process.nextTick(function () { - newList.forEach(function (ar) { - steps.forEach(function (fn) { fn(ar, cb) }) - }) - }) - } - - if (--a === 0) cb_.apply(null, [errState].concat(data)) - } - // expect the supplied cb function to be called - // "n" times for each thing in the array. - list.forEach(function (ar) { - steps.forEach(function (fn) { fn(ar, cb) }) - }) -} diff --git a/node_modules/slide/lib/bind-actor.js b/node_modules/slide/lib/bind-actor.js deleted file mode 100644 index 6a370727494a3..0000000000000 --- a/node_modules/slide/lib/bind-actor.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = bindActor -function bindActor () { - var args = - Array.prototype.slice.call - (arguments) // jswtf. - , obj = null - , fn - if (typeof args[0] === "object") { - obj = args.shift() - fn = args.shift() - if (typeof fn === "string") - fn = obj[ fn ] - } else fn = args.shift() - return function (cb) { - fn.apply(obj, args.concat(cb)) } -} diff --git a/node_modules/slide/lib/chain.js b/node_modules/slide/lib/chain.js deleted file mode 100644 index 17b37114940b9..0000000000000 --- a/node_modules/slide/lib/chain.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = chain -var bindActor = require("./bind-actor.js") -chain.first = {} ; chain.last = {} -function chain (things, cb) { - var res = [] - ;(function LOOP (i, len) { - if (i >= len) return cb(null,res) - if (Array.isArray(things[i])) - things[i] = bindActor.apply(null, - things[i].map(function(i){ - return (i===chain.first) ? res[0] - : (i===chain.last) - ? res[res.length - 1] : i })) - if (!things[i]) return LOOP(i + 1, len) - things[i](function (er, data) { - if (er) return cb(er, res) - if (data !== undefined) res = res.concat(data) - LOOP(i + 1, len) - }) - })(0, things.length) } diff --git a/node_modules/slide/lib/slide.js b/node_modules/slide/lib/slide.js deleted file mode 100644 index 6e9ec2327ae39..0000000000000 --- a/node_modules/slide/lib/slide.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.asyncMap = require("./async-map") -exports.bindActor = require("./bind-actor") -exports.chain = require("./chain") diff --git a/node_modules/slide/package.json b/node_modules/slide/package.json deleted file mode 100644 index 77991847916ea..0000000000000 --- a/node_modules/slide/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "slide", - "version": "1.1.6", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "contributors": [ - "S. Sriram (http://www.565labs.com)" - ], - "description": "A flow control lib small enough to fit on in a slide presentation. Derived live at Oak.JS", - "main": "./lib/slide.js", - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/slide-flow-control.git" - }, - "license": "ISC" -} diff --git a/package-lock.json b/package-lock.json index 0a69a3fd72460..ee890c7e77125 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,7 +64,6 @@ "read-package-json-fast", "rimraf", "semver", - "slide", "sorted-object", "ssri", "tar", @@ -133,7 +132,6 @@ "read-package-json-fast": "^1.2.1", "rimraf": "^3.0.2", "semver": "^7.3.2", - "slide": "~1.1.6", "sorted-object": "~2.0.1", "ssri": "^8.0.0", "tar": "^6.0.5", @@ -5156,15 +5154,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "node_modules/slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "inBundle": true, - "engines": { - "node": "*" - } - }, "node_modules/smart-buffer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", @@ -12116,11 +12105,6 @@ } } }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" - }, "smart-buffer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", diff --git a/package.json b/package.json index 2f0f1c95de3fe..9569cb24d409d 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ "read-package-json-fast": "^1.2.1", "rimraf": "^3.0.2", "semver": "^7.3.2", - "slide": "~1.1.6", "sorted-object": "~2.0.1", "ssri": "^8.0.0", "tar": "^6.0.5", @@ -166,7 +165,6 @@ "read-package-json-fast", "rimraf", "semver", - "slide", "sorted-object", "ssri", "tar", From fef2646347bbb8ccfa9239cc9d99debae002552b Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 15:07:22 -0400 Subject: [PATCH 31/39] chore: refresh transitive deps --- node_modules/.gitignore | 4 +- node_modules/aggregate-error/index.d.ts | 6 +- node_modules/aggregate-error/package.json | 2 +- node_modules/aws4/.github/FUNDING.yml | 3 + node_modules/aws4/README.md | 23 +- node_modules/aws4/aws4.js | 2 +- node_modules/aws4/package.json | 6 +- .../bin-links/node_modules/.bin/rimraf | 1 - .../node_modules/rimraf/CHANGELOG.md | 65 - .../bin-links/node_modules/rimraf/LICENSE | 15 - .../bin-links/node_modules/rimraf/README.md | 101 -- .../bin-links/node_modules/rimraf/bin.js | 68 -- .../node_modules/rimraf/package.json | 32 - .../bin-links/node_modules/rimraf/rimraf.js | 360 ------ node_modules/cacache/node_modules/.bin/rimraf | 1 - .../cacache/node_modules/rimraf/CHANGELOG.md | 65 - .../cacache/node_modules/rimraf/LICENSE | 15 - .../cacache/node_modules/rimraf/README.md | 101 -- .../cacache/node_modules/rimraf/bin.js | 68 -- .../cacache/node_modules/rimraf/package.json | 32 - .../cacache/node_modules/rimraf/rimraf.js | 360 ------ .../console-control-strings/README.md~ | 140 +++ node_modules/debug/CHANGELOG.md | 395 ------- node_modules/debug/dist/debug.js | 912 --------------- node_modules/debug/package.json | 40 +- node_modules/debug/src/browser.js | 15 +- node_modules/debug/src/common.js | 6 +- .../emoji-regex/LICENSE-MIT.txt | 0 .../node_modules => }/emoji-regex/README.md | 0 .../emoji-regex/es2015/index.js | 0 .../emoji-regex/es2015/text.js | 0 .../node_modules => }/emoji-regex/index.d.ts | 0 .../node_modules => }/emoji-regex/index.js | 0 .../emoji-regex/package.json | 0 .../node_modules => }/emoji-regex/text.js | 0 .../node_modules => }/form-data/License | 0 .../node_modules => }/form-data/README.md | 0 .../node_modules => }/form-data/README.md.bak | 0 .../form-data/lib/browser.js | 0 .../form-data/lib/form_data.js | 0 .../form-data/lib/populate.js | 0 .../node_modules => }/form-data/package.json | 0 .../node_modules => }/form-data/yarn.lock | 0 node_modules/minipass-fetch/lib/body.js | 6 + node_modules/minipass-fetch/package.json | 5 +- node_modules/pacote/node_modules/.bin/rimraf | 1 - .../pacote/node_modules/rimraf/CHANGELOG.md | 65 - .../pacote/node_modules/rimraf/LICENSE | 15 - .../pacote/node_modules/rimraf/README.md | 101 -- .../pacote/node_modules/rimraf/bin.js | 68 -- .../pacote/node_modules/rimraf/package.json | 32 - .../pacote/node_modules/rimraf/rimraf.js | 360 ------ .../node_modules => }/retry/.npmignore | 0 .../node_modules => }/retry/License | 0 .../node_modules => }/retry/Makefile | 0 .../node_modules => }/retry/README.md | 0 .../node_modules => }/retry/equation.gif | Bin .../node_modules => }/retry/example/dns.js | 0 .../node_modules => }/retry/example/stop.js | 0 .../node_modules => }/retry/index.js | 0 .../node_modules => }/retry/lib/retry.js | 0 .../retry/lib/retry_operation.js | 0 .../node_modules => }/retry/package.json | 0 .../node_modules => }/retry/test/common.js | 0 .../retry/test/integration/test-forever.js | 0 .../test/integration/test-retry-operation.js | 0 .../retry/test/integration/test-retry-wrap.js | 0 .../retry/test/integration/test-timeouts.js | 0 .../node_modules => }/retry/test/runner.js | 0 node_modules/socks/.travis.yml | 4 +- .../socks/build/client/socksclient.js | 8 +- .../socks/build/client/socksclient.js.map | 2 +- node_modules/socks/build/index.js | 2 +- node_modules/socks/package.json | 20 +- node_modules/spdx-license-ids/deprecated.json | 2 + node_modules/spdx-license-ids/index.json | 48 +- node_modules/spdx-license-ids/package.json | 4 +- node_modules/supports-color/index.js | 6 +- node_modules/supports-color/package.json | 2 +- node_modules/uri-js/LICENSE | 11 + node_modules/uri-js/README.md | 36 +- node_modules/uri-js/bower.json | 47 - node_modules/uri-js/dist/es5/uri.all.d.ts | 118 +- node_modules/uri-js/dist/es5/uri.all.js | 68 +- node_modules/uri-js/dist/es5/uri.all.js.map | 2 +- node_modules/uri-js/dist/es5/uri.all.min.d.ts | 118 +- node_modules/uri-js/dist/es5/uri.all.min.js | 4 +- .../uri-js/dist/es5/uri.all.min.js.map | 2 +- node_modules/uri-js/dist/esnext/index.d.ts | 2 +- node_modules/uri-js/dist/esnext/index.js | 28 +- node_modules/uri-js/dist/esnext/index.js.map | 2 +- .../uri-js/dist/esnext/regexps-iri.d.ts | 6 +- .../uri-js/dist/esnext/regexps-iri.js | 4 +- .../uri-js/dist/esnext/regexps-iri.js.map | 0 .../uri-js/dist/esnext/regexps-uri.d.ts | 8 +- .../uri-js/dist/esnext/regexps-uri.js | 82 +- .../uri-js/dist/esnext/regexps-uri.js.map | 0 .../uri-js/dist/esnext/schemes/http.d.ts | 6 +- .../uri-js/dist/esnext/schemes/http.js | 53 +- .../uri-js/dist/esnext/schemes/http.js.map | 2 +- .../uri-js/dist/esnext/schemes/https.d.ts | 6 +- .../uri-js/dist/esnext/schemes/https.js | 16 +- .../uri-js/dist/esnext/schemes/https.js.map | 0 .../uri-js/dist/esnext/schemes/mailto.d.ts | 24 +- .../uri-js/dist/esnext/schemes/mailto.js | 0 .../uri-js/dist/esnext/schemes/mailto.js.map | 0 .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 14 +- .../uri-js/dist/esnext/schemes/urn-uuid.js | 44 +- .../dist/esnext/schemes/urn-uuid.js.map | 0 .../uri-js/dist/esnext/schemes/urn.d.ts | 20 +- .../uri-js/dist/esnext/schemes/urn.js | 96 +- .../uri-js/dist/esnext/schemes/urn.js.map | 0 .../uri-js/dist/esnext/schemes/ws.d.ts | 7 + node_modules/uri-js/dist/esnext/schemes/ws.js | 41 + .../uri-js/dist/esnext/schemes/ws.js.map | 1 + .../uri-js/dist/esnext/schemes/wss.d.ts | 3 + .../uri-js/dist/esnext/schemes/wss.js | 9 + .../uri-js/dist/esnext/schemes/wss.js.map | 1 + node_modules/uri-js/dist/esnext/uri.d.ts | 118 +- node_modules/uri-js/dist/esnext/uri.js | 4 +- node_modules/uri-js/dist/esnext/uri.js.map | 2 +- node_modules/uri-js/dist/esnext/util.d.ts | 12 +- node_modules/uri-js/dist/esnext/util.js | 70 +- node_modules/uri-js/dist/esnext/util.js.map | 0 node_modules/uri-js/package.json | 24 +- node_modules/uri-js/rollup.config.js | 32 - node_modules/uri-js/src/index.ts | 18 - node_modules/uri-js/src/punycode.d.ts | 24 - node_modules/uri-js/src/regexps-iri.ts | 4 - node_modules/uri-js/src/regexps-uri.ts | 89 -- node_modules/uri-js/src/schemes/http.ts | 36 - node_modules/uri-js/src/schemes/https.ts | 11 - node_modules/uri-js/src/schemes/mailto.ts | 182 --- node_modules/uri-js/src/schemes/urn-uuid.ts | 36 - node_modules/uri-js/src/schemes/urn.ts | 69 -- node_modules/uri-js/src/uri.ts | 556 --------- node_modules/uri-js/src/util.ts | 40 - node_modules/uri-js/tests/qunit.css | 118 -- node_modules/uri-js/tests/qunit.js | 1042 ----------------- node_modules/uri-js/tests/test-es5-min.html | 17 - node_modules/uri-js/tests/test-es5.html | 17 - node_modules/uri-js/tests/tests.js | 774 ------------ node_modules/uri-js/tsconfig.json | 20 - node_modules/uri-js/yarn.lock | 65 +- package-lock.json | 628 +++++----- 145 files changed, 1239 insertions(+), 7239 deletions(-) create mode 100644 node_modules/aws4/.github/FUNDING.yml delete mode 120000 node_modules/bin-links/node_modules/.bin/rimraf delete mode 100644 node_modules/bin-links/node_modules/rimraf/CHANGELOG.md delete mode 100644 node_modules/bin-links/node_modules/rimraf/LICENSE delete mode 100644 node_modules/bin-links/node_modules/rimraf/README.md delete mode 100755 node_modules/bin-links/node_modules/rimraf/bin.js delete mode 100644 node_modules/bin-links/node_modules/rimraf/package.json delete mode 100644 node_modules/bin-links/node_modules/rimraf/rimraf.js delete mode 120000 node_modules/cacache/node_modules/.bin/rimraf delete mode 100644 node_modules/cacache/node_modules/rimraf/CHANGELOG.md delete mode 100644 node_modules/cacache/node_modules/rimraf/LICENSE delete mode 100644 node_modules/cacache/node_modules/rimraf/README.md delete mode 100755 node_modules/cacache/node_modules/rimraf/bin.js delete mode 100644 node_modules/cacache/node_modules/rimraf/package.json delete mode 100644 node_modules/cacache/node_modules/rimraf/rimraf.js create mode 100644 node_modules/console-control-strings/README.md~ delete mode 100644 node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/debug/dist/debug.js rename node_modules/{cli-table3/node_modules => }/emoji-regex/LICENSE-MIT.txt (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/README.md (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/es2015/index.js (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/es2015/text.js (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/index.d.ts (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/index.js (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/package.json (100%) rename node_modules/{cli-table3/node_modules => }/emoji-regex/text.js (100%) rename node_modules/{request/node_modules => }/form-data/License (100%) rename node_modules/{request/node_modules => }/form-data/README.md (100%) rename node_modules/{request/node_modules => }/form-data/README.md.bak (100%) rename node_modules/{request/node_modules => }/form-data/lib/browser.js (100%) rename node_modules/{request/node_modules => }/form-data/lib/form_data.js (100%) rename node_modules/{request/node_modules => }/form-data/lib/populate.js (100%) rename node_modules/{request/node_modules => }/form-data/package.json (100%) rename node_modules/{request/node_modules => }/form-data/yarn.lock (100%) delete mode 120000 node_modules/pacote/node_modules/.bin/rimraf delete mode 100644 node_modules/pacote/node_modules/rimraf/CHANGELOG.md delete mode 100644 node_modules/pacote/node_modules/rimraf/LICENSE delete mode 100644 node_modules/pacote/node_modules/rimraf/README.md delete mode 100755 node_modules/pacote/node_modules/rimraf/bin.js delete mode 100644 node_modules/pacote/node_modules/rimraf/package.json delete mode 100644 node_modules/pacote/node_modules/rimraf/rimraf.js rename node_modules/{promise-retry/node_modules => }/retry/.npmignore (100%) rename node_modules/{promise-retry/node_modules => }/retry/License (100%) rename node_modules/{promise-retry/node_modules => }/retry/Makefile (100%) rename node_modules/{promise-retry/node_modules => }/retry/README.md (100%) rename node_modules/{promise-retry/node_modules => }/retry/equation.gif (100%) rename node_modules/{promise-retry/node_modules => }/retry/example/dns.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/example/stop.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/index.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/lib/retry.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/lib/retry_operation.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/package.json (100%) rename node_modules/{promise-retry/node_modules => }/retry/test/common.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/test/integration/test-forever.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/test/integration/test-retry-operation.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/test/integration/test-retry-wrap.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/test/integration/test-timeouts.js (100%) rename node_modules/{promise-retry/node_modules => }/retry/test/runner.js (100%) create mode 100755 node_modules/uri-js/LICENSE mode change 100644 => 100755 node_modules/uri-js/README.md delete mode 100644 node_modules/uri-js/bower.json mode change 100644 => 100755 node_modules/uri-js/dist/es5/uri.all.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/es5/uri.all.js mode change 100644 => 100755 node_modules/uri-js/dist/es5/uri.all.js.map mode change 100644 => 100755 node_modules/uri-js/dist/es5/uri.all.min.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/es5/uri.all.min.js mode change 100644 => 100755 node_modules/uri-js/dist/es5/uri.all.min.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/index.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/index.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/index.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/regexps-iri.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/regexps-iri.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/regexps-iri.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/regexps-uri.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/regexps-uri.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/regexps-uri.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/http.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/http.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/http.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/https.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/https.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/https.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/urn.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/urn.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/uri.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/uri.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/uri.js.map mode change 100644 => 100755 node_modules/uri-js/dist/esnext/util.d.ts mode change 100644 => 100755 node_modules/uri-js/dist/esnext/util.js mode change 100644 => 100755 node_modules/uri-js/dist/esnext/util.js.map mode change 100644 => 100755 node_modules/uri-js/package.json delete mode 100644 node_modules/uri-js/rollup.config.js delete mode 100644 node_modules/uri-js/src/index.ts delete mode 100644 node_modules/uri-js/src/punycode.d.ts delete mode 100644 node_modules/uri-js/src/regexps-iri.ts delete mode 100644 node_modules/uri-js/src/regexps-uri.ts delete mode 100644 node_modules/uri-js/src/schemes/http.ts delete mode 100644 node_modules/uri-js/src/schemes/https.ts delete mode 100644 node_modules/uri-js/src/schemes/mailto.ts delete mode 100644 node_modules/uri-js/src/schemes/urn-uuid.ts delete mode 100644 node_modules/uri-js/src/schemes/urn.ts delete mode 100644 node_modules/uri-js/src/uri.ts delete mode 100644 node_modules/uri-js/src/util.ts delete mode 100644 node_modules/uri-js/tests/qunit.css delete mode 100644 node_modules/uri-js/tests/qunit.js delete mode 100644 node_modules/uri-js/tests/test-es5-min.html delete mode 100644 node_modules/uri-js/tests/test-es5.html delete mode 100644 node_modules/uri-js/tests/tests.js delete mode 100644 node_modules/uri-js/tsconfig.json mode change 100644 => 100755 node_modules/uri-js/yarn.lock diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 1d56c819934b1..4d6f8f3ed6a78 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -33,6 +33,7 @@ package-lock.json /caching-transform /caller /callsites +/camelcase /chokidar /cliui /color-support @@ -49,7 +50,6 @@ package-lock.json /diff /diff-frag /doctrine -/emoji-regex /enquirer /error-ex /es-abstract @@ -106,6 +106,7 @@ package-lock.json /is-date-object /is-extglob /is-glob +/is-negative-zero /is-number /is-regex /is-stream @@ -185,6 +186,7 @@ package-lock.json /source-map /source-map-support /spawn-wrap +/sprintf-js /stack-utils /string.prototype.trimend /string.prototype.trimstart diff --git a/node_modules/aggregate-error/index.d.ts b/node_modules/aggregate-error/index.d.ts index 2cec44a002d88..502bf7ad1d0df 100644 --- a/node_modules/aggregate-error/index.d.ts +++ b/node_modules/aggregate-error/index.d.ts @@ -1,7 +1,7 @@ /** Create an error from multiple errors. */ -declare class AggregateError extends Error implements Iterable { +declare class AggregateError extends Error implements Iterable { readonly name: 'AggregateError'; /** @@ -43,9 +43,9 @@ declare class AggregateError extends Error implements Iterable { //=> [Error: baz] ``` */ - constructor(errors: ReadonlyArray); + constructor(errors: ReadonlyArray); - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): IterableIterator; } export = AggregateError; diff --git a/node_modules/aggregate-error/package.json b/node_modules/aggregate-error/package.json index d352fc1a12979..74fcc37611e64 100644 --- a/node_modules/aggregate-error/package.json +++ b/node_modules/aggregate-error/package.json @@ -1,6 +1,6 @@ { "name": "aggregate-error", - "version": "3.0.1", + "version": "3.1.0", "description": "Create an error from multiple errors", "license": "MIT", "repository": "sindresorhus/aggregate-error", diff --git a/node_modules/aws4/.github/FUNDING.yml b/node_modules/aws4/.github/FUNDING.yml new file mode 100644 index 0000000000000..b7fdd9747f71d --- /dev/null +++ b/node_modules/aws4/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: mhart diff --git a/node_modules/aws4/README.md b/node_modules/aws4/README.md index f4dc271cea56d..7202e452f8c43 100644 --- a/node_modules/aws4/README.md +++ b/node_modules/aws4/README.md @@ -20,11 +20,11 @@ Example ------- ```javascript -var http = require('https') +var https = require('https') var aws4 = require('aws4') // to illustrate usage, we'll create a utility function to request and pipe to stdout -function request(opts) { http.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') } +function request(opts) { https.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') } // aws4 will sign an options object as you'd pass to http.request, with an AWS service and region var opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object', service: 's3', region: 'us-west-1' } @@ -94,6 +94,15 @@ request(aws4.sign({ ... */ +// The raw RequestSigner can be used to generate CodeCommit Git passwords +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() + // see example.js for examples with other services ``` @@ -102,11 +111,10 @@ API ### aws4.sign(requestOptions, [credentials]) -This calculates and populates the `Authorization` header of -`requestOptions`, and any other necessary AWS headers and/or request -options. Returns `requestOptions` as a convenience for chaining. +Calculates and populates any necessary AWS headers and/or request +options on `requestOptions`. Returns `requestOptions` as a convenience for chaining. -`requestOptions` is an object holding the same options that the node.js +`requestOptions` is an object holding the same options that the Node.js [http.request](https://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) function takes. @@ -119,6 +127,7 @@ populated if they don't already exist: - `body` (will use `''` if not given) - `service` (will try to be calculated from `hostname` or `host` if not given) - `region` (will try to be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `signQuery` (to sign the query instead of adding an `Authorization` header, defaults to false) - `headers['Host']` (will use `hostname` or `host` or be calculated if not given) - `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` if not given and there is a `body`) @@ -170,5 +179,5 @@ Thanks to [@jed](https://github.com/jed) for his committed and subsequently extracted this code. Also thanks to the -[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +[official Node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving me a start on implementing the v4 signature. diff --git a/node_modules/aws4/aws4.js b/node_modules/aws4/aws4.js index ed282f85bc088..8c772597da518 100644 --- a/node_modules/aws4/aws4.js +++ b/node_modules/aws4/aws4.js @@ -259,7 +259,7 @@ RequestSigner.prototype.canonicalString = function() { if (normalizePath && piece === '..') { path.pop() } else if (!normalizePath || piece !== '.') { - if (decodePath) piece = decodeURIComponent(piece).replace(/\+/g, ' ') + if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, ' ')) path.push(encodeRfc3986Full(piece)) } return path diff --git a/node_modules/aws4/package.json b/node_modules/aws4/package.json index aef8a638f8d32..4b795bfefdf74 100644 --- a/node_modules/aws4/package.json +++ b/node_modules/aws4/package.json @@ -1,6 +1,6 @@ { "name": "aws4", - "version": "1.10.0", + "version": "1.10.1", "description": "Signs and prepares requests using AWS Signature Version 4", "author": "Michael Hart (https://github.com/mhart)", "license": "MIT", @@ -11,7 +11,7 @@ "integration": "node ./test/slow.js" }, "devDependencies": { - "mocha": "^7.1.2", - "should": "^13.2.3" + "mocha": "^2.5.3", + "should": "^8.4.0" } } diff --git a/node_modules/bin-links/node_modules/.bin/rimraf b/node_modules/bin-links/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49ddfc1..0000000000000 --- a/node_modules/bin-links/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/bin-links/node_modules/rimraf/CHANGELOG.md b/node_modules/bin-links/node_modules/rimraf/CHANGELOG.md deleted file mode 100644 index f116f1414d76d..0000000000000 --- a/node_modules/bin-links/node_modules/rimraf/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# v3.0 - -- Add `--preserve-root` option to executable (default true) -- Drop support for Node.js below version 6 - -# v2.7 - -- Make `glob` an optional dependency - -# 2.6 - -- Retry on EBUSY on non-windows platforms as well -- Make `rimraf.sync` 10000% more reliable on Windows - -# 2.5 - -- Handle Windows EPERM when lstat-ing read-only dirs -- Add glob option to pass options to glob - -# 2.4 - -- Add EPERM to delay/retry loop -- Add `disableGlob` option - -# 2.3 - -- Make maxBusyTries and emfileWait configurable -- Handle weird SunOS unlink-dir issue -- Glob the CLI arg for better Windows support - -# 2.2 - -- Handle ENOENT properly on Windows -- Allow overriding fs methods -- Treat EPERM as indicative of non-empty dir -- Remove optional graceful-fs dep -- Consistently return null error instead of undefined on success -- win32: Treat ENOTEMPTY the same as EBUSY -- Add `rimraf` binary - -# 2.1 - -- Fix SunOS error code for a non-empty directory -- Try rmdir before readdir -- Treat EISDIR like EPERM -- Remove chmod -- Remove lstat polyfill, node 0.7 is not supported - -# 2.0 - -- Fix myGid call to check process.getgid -- Simplify the EBUSY backoff logic. -- Use fs.lstat in node >= 0.7.9 -- Remove gently option -- remove fiber implementation -- Delete files that are marked read-only - -# 1.0 - -- Allow ENOENT in sync method -- Throw when no callback is provided -- Make opts.gently an absolute path -- use 'stat' if 'lstat' is not available -- Consistent error naming, and rethrow non-ENOENT stat errors -- add fiber implementation diff --git a/node_modules/bin-links/node_modules/rimraf/LICENSE b/node_modules/bin-links/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e315fe59..0000000000000 --- a/node_modules/bin-links/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/bin-links/node_modules/rimraf/README.md b/node_modules/bin-links/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf854ad3..0000000000000 --- a/node_modules/bin-links/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf [ ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/bin-links/node_modules/rimraf/bin.js b/node_modules/bin-links/node_modules/rimraf/bin.js deleted file mode 100755 index 023814cc93e84..0000000000000 --- a/node_modules/bin-links/node_modules/rimraf/bin.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const rimraf = require('./') - -const path = require('path') - -const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) -const filterOutRoot = arg => { - const ok = preserveRoot === false || !isRoot(arg) - if (!ok) { - console.error(`refusing to remove ${arg}`) - console.error('Set --no-preserve-root to allow this') - } - return ok -} - -let help = false -let dashdash = false -let noglob = false -let preserveRoot = true -const args = process.argv.slice(2).filter(arg => { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else if (arg === '--preserve-root') - preserveRoot = true - else if (arg === '--no-preserve-root') - preserveRoot = false - else - return !!arg -}).filter(arg => !preserveRoot || filterOutRoot(arg)) - -const go = n => { - if (n >= args.length) - return - const options = noglob ? { glob: false } : {} - rimraf(args[n], options, er => { - if (er) - throw er - go(n+1) - }) -} - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - const log = help ? console.log : console.error - log('Usage: rimraf [ ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - log(' --preserve-root Do not remove \'/\' (default)') - log(' --no-preserve-root Do not treat \'/\' specially') - log(' -- Stop parsing flags') - process.exit(help ? 0 : 1) -} else - go(0) diff --git a/node_modules/bin-links/node_modules/rimraf/package.json b/node_modules/bin-links/node_modules/rimraf/package.json deleted file mode 100644 index 1bf8d5e38775d..0000000000000 --- a/node_modules/bin-links/node_modules/rimraf/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rimraf", - "version": "3.0.2", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": "git://github.com/isaacs/rimraf.git", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "tap test/*.js" - }, - "bin": "./bin.js", - "dependencies": { - "glob": "^7.1.3" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/node_modules/bin-links/node_modules/rimraf/rimraf.js b/node_modules/bin-links/node_modules/rimraf/rimraf.js deleted file mode 100644 index 34da4171d7559..0000000000000 --- a/node_modules/bin-links/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,360 +0,0 @@ -const assert = require("assert") -const path = require("path") -const fs = require("fs") -let glob = undefined -try { - glob = require("glob") -} catch (_err) { - // treat glob as optional. -} - -const defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -let timeout = 0 - -const isWindows = (process.platform === "win32") - -const defaults = options => { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - if (options.disableGlob !== true && glob === undefined) { - throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -const rimraf = (p, options, cb) => { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - let busyTries = 0 - let errState = null - let n = 0 - - const next = (er) => { - errState = errState || er - if (--n === 0) - cb(errState) - } - - const afterGlob = (er, results) => { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(p => { - const CB = (er) => { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p, options, CB), timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(er) - } - rimraf_(p, options, CB) - }) - } - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, (er, stat) => { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -const rimraf_ = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, er => { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -const fixWinEPERM = (p, options, er, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -const fixWinEPERMSync = (p, options, er) => { - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - let stats - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -const rmdir = (p, options, originalEr, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -const rmkids = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) - return cb(er) - let n = files.length - if (n === 0) - return options.rmdir(p, cb) - let errState - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -const rimrafSync = (p, options) => { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - let results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (let i = 0; i < results.length; i++) { - const p = results[i] - - let st - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -const rmdirSync = (p, options, originalEr) => { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -const rmkidsSync = (p, options) => { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const retries = isWindows ? 100 : 1 - let i = 0 - do { - let threw = true - try { - const ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/node_modules/cacache/node_modules/.bin/rimraf b/node_modules/cacache/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49ddfc1..0000000000000 --- a/node_modules/cacache/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/cacache/node_modules/rimraf/CHANGELOG.md b/node_modules/cacache/node_modules/rimraf/CHANGELOG.md deleted file mode 100644 index f116f1414d76d..0000000000000 --- a/node_modules/cacache/node_modules/rimraf/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# v3.0 - -- Add `--preserve-root` option to executable (default true) -- Drop support for Node.js below version 6 - -# v2.7 - -- Make `glob` an optional dependency - -# 2.6 - -- Retry on EBUSY on non-windows platforms as well -- Make `rimraf.sync` 10000% more reliable on Windows - -# 2.5 - -- Handle Windows EPERM when lstat-ing read-only dirs -- Add glob option to pass options to glob - -# 2.4 - -- Add EPERM to delay/retry loop -- Add `disableGlob` option - -# 2.3 - -- Make maxBusyTries and emfileWait configurable -- Handle weird SunOS unlink-dir issue -- Glob the CLI arg for better Windows support - -# 2.2 - -- Handle ENOENT properly on Windows -- Allow overriding fs methods -- Treat EPERM as indicative of non-empty dir -- Remove optional graceful-fs dep -- Consistently return null error instead of undefined on success -- win32: Treat ENOTEMPTY the same as EBUSY -- Add `rimraf` binary - -# 2.1 - -- Fix SunOS error code for a non-empty directory -- Try rmdir before readdir -- Treat EISDIR like EPERM -- Remove chmod -- Remove lstat polyfill, node 0.7 is not supported - -# 2.0 - -- Fix myGid call to check process.getgid -- Simplify the EBUSY backoff logic. -- Use fs.lstat in node >= 0.7.9 -- Remove gently option -- remove fiber implementation -- Delete files that are marked read-only - -# 1.0 - -- Allow ENOENT in sync method -- Throw when no callback is provided -- Make opts.gently an absolute path -- use 'stat' if 'lstat' is not available -- Consistent error naming, and rethrow non-ENOENT stat errors -- add fiber implementation diff --git a/node_modules/cacache/node_modules/rimraf/LICENSE b/node_modules/cacache/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e315fe59..0000000000000 --- a/node_modules/cacache/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/cacache/node_modules/rimraf/README.md b/node_modules/cacache/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf854ad3..0000000000000 --- a/node_modules/cacache/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf [ ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/cacache/node_modules/rimraf/bin.js b/node_modules/cacache/node_modules/rimraf/bin.js deleted file mode 100755 index 023814cc93e84..0000000000000 --- a/node_modules/cacache/node_modules/rimraf/bin.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const rimraf = require('./') - -const path = require('path') - -const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) -const filterOutRoot = arg => { - const ok = preserveRoot === false || !isRoot(arg) - if (!ok) { - console.error(`refusing to remove ${arg}`) - console.error('Set --no-preserve-root to allow this') - } - return ok -} - -let help = false -let dashdash = false -let noglob = false -let preserveRoot = true -const args = process.argv.slice(2).filter(arg => { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else if (arg === '--preserve-root') - preserveRoot = true - else if (arg === '--no-preserve-root') - preserveRoot = false - else - return !!arg -}).filter(arg => !preserveRoot || filterOutRoot(arg)) - -const go = n => { - if (n >= args.length) - return - const options = noglob ? { glob: false } : {} - rimraf(args[n], options, er => { - if (er) - throw er - go(n+1) - }) -} - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - const log = help ? console.log : console.error - log('Usage: rimraf [ ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - log(' --preserve-root Do not remove \'/\' (default)') - log(' --no-preserve-root Do not treat \'/\' specially') - log(' -- Stop parsing flags') - process.exit(help ? 0 : 1) -} else - go(0) diff --git a/node_modules/cacache/node_modules/rimraf/package.json b/node_modules/cacache/node_modules/rimraf/package.json deleted file mode 100644 index 1bf8d5e38775d..0000000000000 --- a/node_modules/cacache/node_modules/rimraf/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rimraf", - "version": "3.0.2", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": "git://github.com/isaacs/rimraf.git", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "tap test/*.js" - }, - "bin": "./bin.js", - "dependencies": { - "glob": "^7.1.3" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/node_modules/cacache/node_modules/rimraf/rimraf.js b/node_modules/cacache/node_modules/rimraf/rimraf.js deleted file mode 100644 index 34da4171d7559..0000000000000 --- a/node_modules/cacache/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,360 +0,0 @@ -const assert = require("assert") -const path = require("path") -const fs = require("fs") -let glob = undefined -try { - glob = require("glob") -} catch (_err) { - // treat glob as optional. -} - -const defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -let timeout = 0 - -const isWindows = (process.platform === "win32") - -const defaults = options => { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - if (options.disableGlob !== true && glob === undefined) { - throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -const rimraf = (p, options, cb) => { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - let busyTries = 0 - let errState = null - let n = 0 - - const next = (er) => { - errState = errState || er - if (--n === 0) - cb(errState) - } - - const afterGlob = (er, results) => { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(p => { - const CB = (er) => { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p, options, CB), timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(er) - } - rimraf_(p, options, CB) - }) - } - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, (er, stat) => { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -const rimraf_ = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, er => { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -const fixWinEPERM = (p, options, er, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -const fixWinEPERMSync = (p, options, er) => { - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - let stats - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -const rmdir = (p, options, originalEr, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -const rmkids = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) - return cb(er) - let n = files.length - if (n === 0) - return options.rmdir(p, cb) - let errState - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -const rimrafSync = (p, options) => { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - let results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (let i = 0; i < results.length; i++) { - const p = results[i] - - let st - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -const rmdirSync = (p, options, originalEr) => { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -const rmkidsSync = (p, options) => { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const retries = isWindows ? 100 : 1 - let i = 0 - do { - let threw = true - try { - const ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/node_modules/console-control-strings/README.md~ b/node_modules/console-control-strings/README.md~ new file mode 100644 index 0000000000000..6eb34e89d17de --- /dev/null +++ b/node_modules/console-control-strings/README.md~ @@ -0,0 +1,140 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/node_modules/debug/CHANGELOG.md b/node_modules/debug/CHANGELOG.md deleted file mode 100644 index 820d21e3322b9..0000000000000 --- a/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,395 +0,0 @@ - -3.1.0 / 2017-09-26 -================== - - * Add `DEBUG_HIDE_DATE` env var (#486) - * Remove ReDoS regexp in %o formatter (#504) - * Remove "component" from package.json - * Remove `component.json` - * Ignore package-lock.json - * Examples: fix colors printout - * Fix: browser detection - * Fix: spelling mistake (#496, @EdwardBetts) - -3.0.1 / 2017-08-24 -================== - - * Fix: Disable colors in Edge and Internet Explorer (#489) - -3.0.0 / 2017-08-08 -================== - - * Breaking: Remove DEBUG_FD (#406) - * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) - * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) - * Addition: document `enabled` flag (#465) - * Addition: add 256 colors mode (#481) - * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) - * Update: component: update "ms" to v2.0.0 - * Update: separate the Node and Browser tests in Travis-CI - * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots - * Update: separate Node.js and web browser examples for organization - * Update: update "browserify" to v14.4.0 - * Fix: fix Readme typo (#473) - -2.6.9 / 2017-09-22 -================== - - * remove ReDoS regexp in %o formatter (#504) - -2.6.8 / 2017-05-18 -================== - - * Fix: Check for undefined on browser globals (#462, @marbemac) - -2.6.7 / 2017-05-16 -================== - - * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) - * Fix: Inline extend function in node implementation (#452, @dougwilson) - * Docs: Fix typo (#455, @msasad) - -2.6.5 / 2017-04-27 -================== - - * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) - * Misc: clean up browser reference checks (#447, @thebigredgeek) - * Misc: add npm-debug.log to .gitignore (@thebigredgeek) - - -2.6.4 / 2017-04-20 -================== - - * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) - * Chore: ignore bower.json in npm installations. (#437, @joaovieira) - * Misc: update "ms" to v0.7.3 (@tootallnate) - -2.6.3 / 2017-03-13 -================== - - * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) - * Docs: Changelog fix (@thebigredgeek) - -2.6.2 / 2017-03-10 -================== - - * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) - * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) - * Docs: Add Slackin invite badge (@tootallnate) - -2.6.1 / 2017-02-10 -================== - - * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error - * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) - * Fix: IE8 "Expected identifier" error (#414, @vgoma) - * Fix: Namespaces would not disable once enabled (#409, @musikov) - -2.6.0 / 2016-12-28 -================== - - * Fix: added better null pointer checks for browser useColors (@thebigredgeek) - * Improvement: removed explicit `window.debug` export (#404, @tootallnate) - * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) - -2.5.2 / 2016-12-25 -================== - - * Fix: reference error on window within webworkers (#393, @KlausTrainer) - * Docs: fixed README typo (#391, @lurch) - * Docs: added notice about v3 api discussion (@thebigredgeek) - -2.5.1 / 2016-12-20 -================== - - * Fix: babel-core compatibility - -2.5.0 / 2016-12-20 -================== - - * Fix: wrong reference in bower file (@thebigredgeek) - * Fix: webworker compatibility (@thebigredgeek) - * Fix: output formatting issue (#388, @kribblo) - * Fix: babel-loader compatibility (#383, @escwald) - * Misc: removed built asset from repo and publications (@thebigredgeek) - * Misc: moved source files to /src (#378, @yamikuronue) - * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) - * Test: coveralls integration (#378, @yamikuronue) - * Docs: simplified language in the opening paragraph (#373, @yamikuronue) - -2.4.5 / 2016-12-17 -================== - - * Fix: `navigator` undefined in Rhino (#376, @jochenberger) - * Fix: custom log function (#379, @hsiliev) - * Improvement: bit of cleanup + linting fixes (@thebigredgeek) - * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) - * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) - -2.4.4 / 2016-12-14 -================== - - * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) - -2.4.3 / 2016-12-14 -================== - - * Fix: navigation.userAgent error for react native (#364, @escwald) - -2.4.2 / 2016-12-14 -================== - - * Fix: browser colors (#367, @tootallnate) - * Misc: travis ci integration (@thebigredgeek) - * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) - -2.4.1 / 2016-12-13 -================== - - * Fix: typo that broke the package (#356) - -2.4.0 / 2016-12-13 -================== - - * Fix: bower.json references unbuilt src entry point (#342, @justmatt) - * Fix: revert "handle regex special characters" (@tootallnate) - * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) - * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) - * Improvement: allow colors in workers (#335, @botverse) - * Improvement: use same color for same namespace. (#338, @lchenay) - -2.3.3 / 2016-11-09 -================== - - * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) - * Fix: Returning `localStorage` saved values (#331, Levi Thomason) - * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) - -2.3.2 / 2016-11-09 -================== - - * Fix: be super-safe in index.js as well (@TooTallNate) - * Fix: should check whether process exists (Tom Newby) - -2.3.1 / 2016-11-09 -================== - - * Fix: Added electron compatibility (#324, @paulcbetts) - * Improvement: Added performance optimizations (@tootallnate) - * Readme: Corrected PowerShell environment variable example (#252, @gimre) - * Misc: Removed yarn lock file from source control (#321, @fengmk2) - -2.3.0 / 2016-11-07 -================== - - * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) - * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) - * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) - * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) - * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) - * Package: Update "ms" to 0.7.2 (#315, @DevSide) - * Package: removed superfluous version property from bower.json (#207 @kkirsche) - * Readme: fix USE_COLORS to DEBUG_COLORS - * Readme: Doc fixes for format string sugar (#269, @mlucool) - * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) - * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) - * Readme: better docs for browser support (#224, @matthewmueller) - * Tooling: Added yarn integration for development (#317, @thebigredgeek) - * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) - * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) - * Misc: Updated contributors (@thebigredgeek) - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/debug/dist/debug.js b/node_modules/debug/dist/debug.js deleted file mode 100644 index 89ad0c2175c3d..0000000000000 --- a/node_modules/debug/dist/debug.js +++ /dev/null @@ -1,912 +0,0 @@ -"use strict"; - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -(function (f) { - if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { - module.exports = f(); - } else if (typeof define === "function" && define.amd) { - define([], f); - } else { - var g; - - if (typeof window !== "undefined") { - g = window; - } else if (typeof global !== "undefined") { - g = global; - } else if (typeof self !== "undefined") { - g = self; - } else { - g = this; - } - - g.debug = f(); - } -})(function () { - var define, module, exports; - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - - return n[i].exports; - } - - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { - o(t[i]); - } - - return o; - } - - return r; - }()({ - 1: [function (require, module, exports) { - /** - * Helpers. - */ - var s = 1000; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - - module.exports = function (val, options) { - options = options || {}; - - var type = _typeof(val); - - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse(str) { - str = String(str); - - if (str.length > 100) { - return; - } - - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - - if (!match) { - return; - } - - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - - case 'weeks': - case 'week': - case 'w': - return n * w; - - case 'days': - case 'day': - case 'd': - return n * d; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - - default: - return undefined; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtShort(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtLong(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - - return ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); - } - }, {}], - 2: [function (require, module, exports) { - // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; // v8 likes predictible objects - - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - - process.listeners = function (name) { - return []; - }; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { - return '/'; - }; - - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - process.umask = function () { - return 0; - }; - }, {}], - 3: [function (require, module, exports) { - /** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - Object.keys(env).forEach(function (key) { - createDebug[key] = env[key]; - }); - /** - * Active `debug` instances. - */ - - createDebug.instances = []; - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - - createDebug.formatters = {}; - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - - function selectColor(namespace) { - var hash = 0; - - for (var i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - - createDebug.selectColor = selectColor; - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - - function createDebug(namespace) { - var prevTime; - - function debug() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - // Disabled? - if (!debug.enabled) { - return; - } - - var self = debug; // Set `diff` timestamp - - var curr = Number(new Date()); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } // Apply any `formatters` transformations - - - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - - index++; - var formatter = createDebug.formatters[format]; - - if (typeof formatter === 'function') { - var val = args[index]; - match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` - - args.splice(index, 1); - index--; - } - - return match; - }); // Apply env-specific formatting (colors, etc.) - - createDebug.formatArgs.call(self, args); - var logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); - debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances - - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - createDebug.instances.push(debug); - return debug; - } - - function destroy() { - var index = createDebug.instances.indexOf(this); - - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - - return false; - } - - function extend(namespace, delimiter) { - var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - - - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.names = []; - createDebug.skips = []; - var i; - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - - for (i = 0; i < createDebug.instances.length; i++) { - var instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - - - function disable() { - var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { - return '-' + namespace; - }))).join(','); - createDebug.enable(''); - return namespaces; - } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - - - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - var i; - var len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - - - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); - } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - - - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - - return val; - } - - createDebug.enable(createDebug.load()); - return createDebug; - } - - module.exports = setup; - }, { - "ms": 1 - }], - 4: [function (require, module, exports) { - (function (process) { - /* eslint-env browser */ - - /** - * This is the web browser implementation of `debug()`. - */ - exports.log = log; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.storage = localstorage(); - /** - * Colors. - */ - - exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; - /** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - // eslint-disable-next-line complexity - - function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } // Internet Explorer and Edge do not support colors. - - - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - - - return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - /** - * Colorize log arguments if enabled. - * - * @api public - */ - - - function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function (match) { - if (match === '%%') { - return; - } - - index++; - - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - - - function log() { - var _console; - - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); - } - /** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - - - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } - } - /** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - - - function load() { - var r; - - try { - r = exports.storage.getItem('debug'); - } catch (error) {} // Swallow - // XXX (@Qix-) should we be logging these? - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - - - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; - } - /** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - - - function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } - } - - module.exports = require('./common')(exports); - var formatters = module.exports.formatters; - /** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - - formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } - }; - }).call(this, require('_process')); - }, { - "./common": 3, - "_process": 2 - }] - }, {}, [4])(4); -}); diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index 86713156d9841..c270ca0e51f0a 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -1,6 +1,6 @@ { "name": "debug", - "version": "4.1.1", + "version": "4.2.0", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" @@ -13,51 +13,47 @@ ], "files": [ "src", - "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", - "Andrew Rhyne " + "Andrew Rhyne ", + "Josh Junon " ], "license": "MIT", "scripts": { "lint": "xo", - "test": "npm run test:node && npm run test:browser", + "test": "npm run test:node && npm run test:browser && npm run lint", "test:node": "istanbul cover _mocha -- test.js", - "pretest:browser": "npm run build", "test:browser": "karma start --single-run", - "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", - "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", - "build:test": "babel -d dist test.js", - "build": "npm run build:debug && npm run build:test", - "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" }, "devDependencies": { - "@babel/cli": "^7.0.0", - "@babel/core": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "browserify": "14.4.0", - "chai": "^3.5.0", - "concurrently": "^3.1.0", + "brfs": "^2.0.1", + "browserify": "^16.2.3", "coveralls": "^3.0.2", "istanbul": "^0.4.5", - "karma": "^3.0.0", - "karma-chai": "^0.1.0", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", "karma-mocha": "^1.3.0", - "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", - "rimraf": "^2.5.4", "xo": "^0.23.0" }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, "main": "./src/index.js", "browser": "./src/browser.js", - "unpkg": "./dist/debug.js" + "engines": { + "node": ">=6.0" + } } diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js index 5f34c0d0a73f0..ac3f7e1339b98 100644 --- a/node_modules/debug/src/browser.js +++ b/node_modules/debug/src/browser.js @@ -4,7 +4,6 @@ * This is the web browser implementation of `debug()`. */ -exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; @@ -170,18 +169,14 @@ function formatArgs(args) { } /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. * * @api public */ -function log(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); -} +exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. diff --git a/node_modules/debug/src/common.js b/node_modules/debug/src/common.js index 2f82b8dc7d886..da7eada619f82 100644 --- a/node_modules/debug/src/common.js +++ b/node_modules/debug/src/common.js @@ -117,13 +117,11 @@ function setup(env) { debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); + debug.color = createDebug.selectColor(namespace); debug.destroy = destroy; debug.extend = extend; - // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances + // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } diff --git a/node_modules/cli-table3/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/emoji-regex/LICENSE-MIT.txt similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/LICENSE-MIT.txt rename to node_modules/emoji-regex/LICENSE-MIT.txt diff --git a/node_modules/cli-table3/node_modules/emoji-regex/README.md b/node_modules/emoji-regex/README.md similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/README.md rename to node_modules/emoji-regex/README.md diff --git a/node_modules/cli-table3/node_modules/emoji-regex/es2015/index.js b/node_modules/emoji-regex/es2015/index.js similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/es2015/index.js rename to node_modules/emoji-regex/es2015/index.js diff --git a/node_modules/cli-table3/node_modules/emoji-regex/es2015/text.js b/node_modules/emoji-regex/es2015/text.js similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/es2015/text.js rename to node_modules/emoji-regex/es2015/text.js diff --git a/node_modules/cli-table3/node_modules/emoji-regex/index.d.ts b/node_modules/emoji-regex/index.d.ts similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/index.d.ts rename to node_modules/emoji-regex/index.d.ts diff --git a/node_modules/cli-table3/node_modules/emoji-regex/index.js b/node_modules/emoji-regex/index.js similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/index.js rename to node_modules/emoji-regex/index.js diff --git a/node_modules/cli-table3/node_modules/emoji-regex/package.json b/node_modules/emoji-regex/package.json similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/package.json rename to node_modules/emoji-regex/package.json diff --git a/node_modules/cli-table3/node_modules/emoji-regex/text.js b/node_modules/emoji-regex/text.js similarity index 100% rename from node_modules/cli-table3/node_modules/emoji-regex/text.js rename to node_modules/emoji-regex/text.js diff --git a/node_modules/request/node_modules/form-data/License b/node_modules/form-data/License similarity index 100% rename from node_modules/request/node_modules/form-data/License rename to node_modules/form-data/License diff --git a/node_modules/request/node_modules/form-data/README.md b/node_modules/form-data/README.md similarity index 100% rename from node_modules/request/node_modules/form-data/README.md rename to node_modules/form-data/README.md diff --git a/node_modules/request/node_modules/form-data/README.md.bak b/node_modules/form-data/README.md.bak similarity index 100% rename from node_modules/request/node_modules/form-data/README.md.bak rename to node_modules/form-data/README.md.bak diff --git a/node_modules/request/node_modules/form-data/lib/browser.js b/node_modules/form-data/lib/browser.js similarity index 100% rename from node_modules/request/node_modules/form-data/lib/browser.js rename to node_modules/form-data/lib/browser.js diff --git a/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/form-data/lib/form_data.js similarity index 100% rename from node_modules/request/node_modules/form-data/lib/form_data.js rename to node_modules/form-data/lib/form_data.js diff --git a/node_modules/request/node_modules/form-data/lib/populate.js b/node_modules/form-data/lib/populate.js similarity index 100% rename from node_modules/request/node_modules/form-data/lib/populate.js rename to node_modules/form-data/lib/populate.js diff --git a/node_modules/request/node_modules/form-data/package.json b/node_modules/form-data/package.json similarity index 100% rename from node_modules/request/node_modules/form-data/package.json rename to node_modules/form-data/package.json diff --git a/node_modules/request/node_modules/form-data/yarn.lock b/node_modules/form-data/yarn.lock similarity index 100% rename from node_modules/request/node_modules/form-data/yarn.lock rename to node_modules/form-data/yarn.lock diff --git a/node_modules/minipass-fetch/lib/body.js b/node_modules/minipass-fetch/lib/body.js index baa3fa3e26568..fb7ffc356fb6d 100644 --- a/node_modules/minipass-fetch/lib/body.js +++ b/node_modules/minipass-fetch/lib/body.js @@ -130,6 +130,12 @@ class Body { this.url} (over ${this.timeout}ms)`, 'body-timeout')) }, this.timeout) : null + // do not keep the process open just for this timeout, even + // though we expect it'll get cleared eventually. + if (resTimeout) { + resTimeout.unref() + } + // do the pipe in the promise, because the pipe() can send too much // data through right away and upset the MP Sized object return new Promise((resolve, reject) => { diff --git a/node_modules/minipass-fetch/package.json b/node_modules/minipass-fetch/package.json index 24853d1bd02d3..74402cb320926 100644 --- a/node_modules/minipass-fetch/package.json +++ b/node_modules/minipass-fetch/package.json @@ -1,6 +1,6 @@ { "name": "minipass-fetch", - "version": "1.3.0", + "version": "1.3.1", "description": "An implementation of window.fetch in Node.js using Minipass streams", "license": "MIT", "main": "lib/index.js", @@ -28,7 +28,8 @@ "dependencies": { "minipass": "^3.1.0", "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" + "minizlib": "^2.0.0", + "encoding": "^0.1.12" }, "optionalDependencies": { "encoding": "^0.1.12" diff --git a/node_modules/pacote/node_modules/.bin/rimraf b/node_modules/pacote/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49ddfc1..0000000000000 --- a/node_modules/pacote/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/pacote/node_modules/rimraf/CHANGELOG.md b/node_modules/pacote/node_modules/rimraf/CHANGELOG.md deleted file mode 100644 index f116f1414d76d..0000000000000 --- a/node_modules/pacote/node_modules/rimraf/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# v3.0 - -- Add `--preserve-root` option to executable (default true) -- Drop support for Node.js below version 6 - -# v2.7 - -- Make `glob` an optional dependency - -# 2.6 - -- Retry on EBUSY on non-windows platforms as well -- Make `rimraf.sync` 10000% more reliable on Windows - -# 2.5 - -- Handle Windows EPERM when lstat-ing read-only dirs -- Add glob option to pass options to glob - -# 2.4 - -- Add EPERM to delay/retry loop -- Add `disableGlob` option - -# 2.3 - -- Make maxBusyTries and emfileWait configurable -- Handle weird SunOS unlink-dir issue -- Glob the CLI arg for better Windows support - -# 2.2 - -- Handle ENOENT properly on Windows -- Allow overriding fs methods -- Treat EPERM as indicative of non-empty dir -- Remove optional graceful-fs dep -- Consistently return null error instead of undefined on success -- win32: Treat ENOTEMPTY the same as EBUSY -- Add `rimraf` binary - -# 2.1 - -- Fix SunOS error code for a non-empty directory -- Try rmdir before readdir -- Treat EISDIR like EPERM -- Remove chmod -- Remove lstat polyfill, node 0.7 is not supported - -# 2.0 - -- Fix myGid call to check process.getgid -- Simplify the EBUSY backoff logic. -- Use fs.lstat in node >= 0.7.9 -- Remove gently option -- remove fiber implementation -- Delete files that are marked read-only - -# 1.0 - -- Allow ENOENT in sync method -- Throw when no callback is provided -- Make opts.gently an absolute path -- use 'stat' if 'lstat' is not available -- Consistent error naming, and rethrow non-ENOENT stat errors -- add fiber implementation diff --git a/node_modules/pacote/node_modules/rimraf/LICENSE b/node_modules/pacote/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e315fe59..0000000000000 --- a/node_modules/pacote/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/rimraf/README.md b/node_modules/pacote/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf854ad3..0000000000000 --- a/node_modules/pacote/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf [ ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/pacote/node_modules/rimraf/bin.js b/node_modules/pacote/node_modules/rimraf/bin.js deleted file mode 100755 index 023814cc93e84..0000000000000 --- a/node_modules/pacote/node_modules/rimraf/bin.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const rimraf = require('./') - -const path = require('path') - -const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) -const filterOutRoot = arg => { - const ok = preserveRoot === false || !isRoot(arg) - if (!ok) { - console.error(`refusing to remove ${arg}`) - console.error('Set --no-preserve-root to allow this') - } - return ok -} - -let help = false -let dashdash = false -let noglob = false -let preserveRoot = true -const args = process.argv.slice(2).filter(arg => { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else if (arg === '--preserve-root') - preserveRoot = true - else if (arg === '--no-preserve-root') - preserveRoot = false - else - return !!arg -}).filter(arg => !preserveRoot || filterOutRoot(arg)) - -const go = n => { - if (n >= args.length) - return - const options = noglob ? { glob: false } : {} - rimraf(args[n], options, er => { - if (er) - throw er - go(n+1) - }) -} - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - const log = help ? console.log : console.error - log('Usage: rimraf [ ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - log(' --preserve-root Do not remove \'/\' (default)') - log(' --no-preserve-root Do not treat \'/\' specially') - log(' -- Stop parsing flags') - process.exit(help ? 0 : 1) -} else - go(0) diff --git a/node_modules/pacote/node_modules/rimraf/package.json b/node_modules/pacote/node_modules/rimraf/package.json deleted file mode 100644 index 1bf8d5e38775d..0000000000000 --- a/node_modules/pacote/node_modules/rimraf/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rimraf", - "version": "3.0.2", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": "git://github.com/isaacs/rimraf.git", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "tap test/*.js" - }, - "bin": "./bin.js", - "dependencies": { - "glob": "^7.1.3" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/node_modules/pacote/node_modules/rimraf/rimraf.js b/node_modules/pacote/node_modules/rimraf/rimraf.js deleted file mode 100644 index 34da4171d7559..0000000000000 --- a/node_modules/pacote/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,360 +0,0 @@ -const assert = require("assert") -const path = require("path") -const fs = require("fs") -let glob = undefined -try { - glob = require("glob") -} catch (_err) { - // treat glob as optional. -} - -const defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -let timeout = 0 - -const isWindows = (process.platform === "win32") - -const defaults = options => { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - if (options.disableGlob !== true && glob === undefined) { - throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -const rimraf = (p, options, cb) => { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - let busyTries = 0 - let errState = null - let n = 0 - - const next = (er) => { - errState = errState || er - if (--n === 0) - cb(errState) - } - - const afterGlob = (er, results) => { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(p => { - const CB = (er) => { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p, options, CB), timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(er) - } - rimraf_(p, options, CB) - }) - } - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, (er, stat) => { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -const rimraf_ = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, er => { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -const fixWinEPERM = (p, options, er, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -const fixWinEPERMSync = (p, options, er) => { - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - let stats - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -const rmdir = (p, options, originalEr, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -const rmkids = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) - return cb(er) - let n = files.length - if (n === 0) - return options.rmdir(p, cb) - let errState - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -const rimrafSync = (p, options) => { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - let results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (let i = 0; i < results.length; i++) { - const p = results[i] - - let st - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -const rmdirSync = (p, options, originalEr) => { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -const rmkidsSync = (p, options) => { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const retries = isWindows ? 100 : 1 - let i = 0 - do { - let threw = true - try { - const ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/node_modules/promise-retry/node_modules/retry/.npmignore b/node_modules/retry/.npmignore similarity index 100% rename from node_modules/promise-retry/node_modules/retry/.npmignore rename to node_modules/retry/.npmignore diff --git a/node_modules/promise-retry/node_modules/retry/License b/node_modules/retry/License similarity index 100% rename from node_modules/promise-retry/node_modules/retry/License rename to node_modules/retry/License diff --git a/node_modules/promise-retry/node_modules/retry/Makefile b/node_modules/retry/Makefile similarity index 100% rename from node_modules/promise-retry/node_modules/retry/Makefile rename to node_modules/retry/Makefile diff --git a/node_modules/promise-retry/node_modules/retry/README.md b/node_modules/retry/README.md similarity index 100% rename from node_modules/promise-retry/node_modules/retry/README.md rename to node_modules/retry/README.md diff --git a/node_modules/promise-retry/node_modules/retry/equation.gif b/node_modules/retry/equation.gif similarity index 100% rename from node_modules/promise-retry/node_modules/retry/equation.gif rename to node_modules/retry/equation.gif diff --git a/node_modules/promise-retry/node_modules/retry/example/dns.js b/node_modules/retry/example/dns.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/example/dns.js rename to node_modules/retry/example/dns.js diff --git a/node_modules/promise-retry/node_modules/retry/example/stop.js b/node_modules/retry/example/stop.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/example/stop.js rename to node_modules/retry/example/stop.js diff --git a/node_modules/promise-retry/node_modules/retry/index.js b/node_modules/retry/index.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/index.js rename to node_modules/retry/index.js diff --git a/node_modules/promise-retry/node_modules/retry/lib/retry.js b/node_modules/retry/lib/retry.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/lib/retry.js rename to node_modules/retry/lib/retry.js diff --git a/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js b/node_modules/retry/lib/retry_operation.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/lib/retry_operation.js rename to node_modules/retry/lib/retry_operation.js diff --git a/node_modules/promise-retry/node_modules/retry/package.json b/node_modules/retry/package.json similarity index 100% rename from node_modules/promise-retry/node_modules/retry/package.json rename to node_modules/retry/package.json diff --git a/node_modules/promise-retry/node_modules/retry/test/common.js b/node_modules/retry/test/common.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/test/common.js rename to node_modules/retry/test/common.js diff --git a/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js b/node_modules/retry/test/integration/test-forever.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js rename to node_modules/retry/test/integration/test-forever.js diff --git a/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js b/node_modules/retry/test/integration/test-retry-operation.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js rename to node_modules/retry/test/integration/test-retry-operation.js diff --git a/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js b/node_modules/retry/test/integration/test-retry-wrap.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js rename to node_modules/retry/test/integration/test-retry-wrap.js diff --git a/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js b/node_modules/retry/test/integration/test-timeouts.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js rename to node_modules/retry/test/integration/test-timeouts.js diff --git a/node_modules/promise-retry/node_modules/retry/test/runner.js b/node_modules/retry/test/runner.js similarity index 100% rename from node_modules/promise-retry/node_modules/retry/test/runner.js rename to node_modules/retry/test/runner.js diff --git a/node_modules/socks/.travis.yml b/node_modules/socks/.travis.yml index 6ba78778432b7..2c6099bcdc2be 100644 --- a/node_modules/socks/.travis.yml +++ b/node_modules/socks/.travis.yml @@ -6,6 +6,6 @@ node_js: - stable before_install: - - yarn global add typescript prettier tslint coveralls + - npm add -g typescript prettier tslint coveralls -script: "yarn run build && yarn run coveralls" \ No newline at end of file +script: "npm run build && npm run coveralls" \ No newline at end of file diff --git a/node_modules/socks/build/client/socksclient.js b/node_modules/socks/build/client/socksclient.js index 38553c1726464..df3058a05aa3c 100644 --- a/node_modules/socks/build/client/socksclient.js +++ b/node_modules/socks/build/client/socksclient.js @@ -285,7 +285,9 @@ class SocksClient extends events_1.EventEmitter { */ processData() { // If we have enough data to process the next step in the SOCKS handshake, proceed. - if (this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { + while (this.state !== constants_1.SocksClientState.Established && + this.state !== constants_1.SocksClientState.Error && + this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { // Sent initial handshake, waiting for response. if (this.state === constants_1.SocksClientState.SentInitialHandshake) { if (this.options.proxy.type === 4) { @@ -314,11 +316,9 @@ class SocksClient extends events_1.EventEmitter { this.handleSocks5IncomingConnectionResponse(); } } - else if (this.state === constants_1.SocksClientState.Established) { - // do nothing (prevents closing of the socket) - } else { this.closeSocket(constants_1.ERRORS.InternalError); + break; } } } diff --git a/node_modules/socks/build/client/socksclient.js.map b/node_modules/socks/build/client/socksclient.js.map index ff8cd89c1e44c..8fdc0ec620403 100644 --- a/node_modules/socks/build/client/socksclient.js.map +++ b/node_modules/socks/build/client/socksclient.js.map @@ -1 +1 @@ -{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAiB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;A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4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;aACH;YAED,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,yBACK,IAAI,CAAC,OAAO,EACf;IACJ,CAAC;CACF;AAGC,kCAAW"} \ No newline at end of file +{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAiB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;AACtD,yCAA8D;AAs2B5D,iGAt2BM,uBAAgB,OAs2BN;AA50BlB,MAAM,WAAY,SAAQ,qBAAY;IAepC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,oCAA0B,CAAC,OAAO,CAAC,CAAC;QAEpC,gBAAgB;QAChB,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,OAA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ED,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,yBACK,IAAI,CAAC,OAAO,EACf;IACJ,CAAC;CACF;AAGC,kCAAW"} \ No newline at end of file diff --git a/node_modules/socks/build/index.js b/node_modules/socks/build/index.js index a237caf0f0be6..17b6f42df8e5b 100644 --- a/node_modules/socks/build/index.js +++ b/node_modules/socks/build/index.js @@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./client/socksclient"), exports); diff --git a/node_modules/socks/package.json b/node_modules/socks/package.json index a0513681c127f..dc69653e21a76 100644 --- a/node_modules/socks/package.json +++ b/node_modules/socks/package.json @@ -1,7 +1,7 @@ { "name": "socks", "private": false, - "version": "2.4.1", + "version": "2.4.4", "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", "main": "build/index.js", "typings": "typings", @@ -33,23 +33,23 @@ "license": "MIT", "readmeFilename": "README.md", "devDependencies": { - "@types/chai": "4.2.11", + "@types/chai": "^4.2.12", "@types/ip": "1.1.0", - "@types/mocha": "7.0.2", - "@types/node": "^14.0.13", + "@types/mocha": "^8.0.3", + "@types/node": "^14.6.2", "chai": "^4.1.2", "coveralls": "3.1.0", - "mocha": "8.0.1", + "mocha": "^8.1.3", "nyc": "15.1.0", - "prettier": "^2.0.5", + "prettier": "^2.1.1", "socks5-server": "^0.1.1", - "ts-node": "8.10.2", - "tslint": "6.1.2", + "ts-node": "^9.0.0", + "tslint": "^6.1.3", "tslint-config-airbnb": "^5.11.2", - "typescript": "3.9.5" + "typescript": "^4.0.2" }, "dependencies": { - "ip": "1.1.5", + "ip": "^1.1.5", "smart-buffer": "^4.1.0" }, "scripts": { diff --git a/node_modules/spdx-license-ids/deprecated.json b/node_modules/spdx-license-ids/deprecated.json index 1681f4870d5d9..c7de09858ff35 100644 --- a/node_modules/spdx-license-ids/deprecated.json +++ b/node_modules/spdx-license-ids/deprecated.json @@ -1,6 +1,8 @@ [ "AGPL-1.0", "AGPL-3.0", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", "GFDL-1.1", "GFDL-1.2", "GFDL-1.3", diff --git a/node_modules/spdx-license-ids/index.json b/node_modules/spdx-license-ids/index.json index 5283c78dc77c3..de204732913a7 100644 --- a/node_modules/spdx-license-ids/index.json +++ b/node_modules/spdx-license-ids/index.json @@ -35,9 +35,8 @@ "Artistic-2.0", "BSD-1-Clause", "BSD-2-Clause", - "BSD-2-Clause-FreeBSD", - "BSD-2-Clause-NetBSD", "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", "BSD-3-Clause", "BSD-3-Clause-Attribution", "BSD-3-Clause-Clear", @@ -58,11 +57,14 @@ "BitTorrent-1.1", "BlueOak-1.0.0", "Borceux", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", "CATOSL-1.1", "CC-BY-1.0", "CC-BY-2.0", "CC-BY-2.5", "CC-BY-3.0", + "CC-BY-3.0-AT", "CC-BY-4.0", "CC-BY-NC-1.0", "CC-BY-NC-2.0", @@ -73,6 +75,7 @@ "CC-BY-NC-ND-2.0", "CC-BY-NC-ND-2.5", "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-IGO", "CC-BY-NC-ND-4.0", "CC-BY-NC-SA-1.0", "CC-BY-NC-SA-2.0", @@ -88,6 +91,7 @@ "CC-BY-SA-2.0", "CC-BY-SA-2.5", "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", "CC-BY-SA-4.0", "CC-PDDC", "CC0-1.0", @@ -103,6 +107,9 @@ "CECILL-C", "CERN-OHL-1.1", "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", "CNRI-Jython", "CNRI-Python", "CNRI-Python-GPL-Compatible", @@ -124,6 +131,7 @@ "ECL-2.0", "EFL-1.0", "EFL-2.0", + "EPICS", "EPL-1.0", "EPL-2.0", "EUDatagrid", @@ -140,13 +148,26 @@ "Fair", "Frameworx-1.0", "FreeImage", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", "GFDL-1.1-only", "GFDL-1.1-or-later", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", "GFDL-1.2-only", "GFDL-1.2-or-later", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", "GFDL-1.3-only", "GFDL-1.3-or-later", "GL2PS", + "GLWTPL", "GPL-1.0-only", "GPL-1.0-or-later", "GPL-2.0-only", @@ -159,6 +180,7 @@ "HPND", "HPND-sell-variant", "HaskellReport", + "Hippocratic-2.1", "IBM-pibs", "ICU", "IJG", @@ -214,12 +236,17 @@ "MakeIndex", "MirOS", "Motosoto", + "MulanPSL-1.0", + "MulanPSL-2.0", "Multics", "Mup", "NASA-1.3", "NBPL-1.0", + "NCGL-UK-2.0", "NCSA", "NGPL", + "NIST-PD", + "NIST-PD-fallback", "NLOD-1.0", "NLPL", "NOSL", @@ -228,18 +255,26 @@ "NPOSL-3.0", "NRL", "NTP", + "NTP-0", "Naumen", "Net-SNMP", "NetCDF", "Newsletr", "Nokia", "Noweb", + "O-UDA-1.0", "OCCT-PL", "OCLC-2.0", "ODC-By-1.0", "ODbL-1.0", "OFL-1.0", + "OFL-1.0-RFN", + "OFL-1.0-no-RFN", "OFL-1.1", + "OFL-1.1-RFN", + "OFL-1.1-no-RFN", + "OGC-1.0", + "OGL-Canada-2.0", "OGL-UK-1.0", "OGL-UK-2.0", "OGL-UK-3.0", @@ -272,8 +307,12 @@ "PDDL-1.0", "PHP-3.0", "PHP-3.01", + "PSF-2.0", "Parity-6.0.0", + "Parity-7.0.0", "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", "PostgreSQL", "Python-2.0", "QPL-1.0", @@ -299,6 +338,8 @@ "SMPPL", "SNIA", "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", "SSPL-1.0", "SWL", "Saxpath", @@ -318,6 +359,7 @@ "TOSL", "TU-Berlin-1.0", "TU-Berlin-2.0", + "UCL-1.0", "UPL-1.0", "Unicode-DFS-2015", "Unicode-DFS-2016", @@ -356,10 +398,12 @@ "diffmark", "dvipdfm", "eGenix", + "etalab-2.0", "gSOAP-1.3b", "gnuplot", "iMatix", "libpng-2.0", + "libselinux-1.0", "libtiff", "mpich2", "psfrag", diff --git a/node_modules/spdx-license-ids/package.json b/node_modules/spdx-license-ids/package.json index 68580a6e962b5..5653f9d08fcb9 100644 --- a/node_modules/spdx-license-ids/package.json +++ b/node_modules/spdx-license-ids/package.json @@ -1,8 +1,8 @@ { "name": "spdx-license-ids", - "version": "3.0.5", + "version": "3.0.6", "description": "A list of SPDX license identifiers", - "repository": "shinnn/spdx-license-ids", + "repository": "jslicense/spdx-license-ids", "author": "Shinnosuke Watanabe (https://github.com/shinnn)", "license": "CC0-1.0", "scripts": { diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js index dcaa45412304d..6fada390fb88d 100644 --- a/node_modules/supports-color/index.js +++ b/node_modules/supports-color/index.js @@ -81,7 +81,7 @@ function supportsColor(haveStream, streamIsTTY) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -92,10 +92,6 @@ function supportsColor(haveStream, streamIsTTY) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - if ('GITHUB_ACTIONS' in env) { - return 1; - } - if (env.COLORTERM === 'truecolor') { return 3; } diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json index f9e9763aac306..f7182edcea2ba 100644 --- a/node_modules/supports-color/package.json +++ b/node_modules/supports-color/package.json @@ -1,6 +1,6 @@ { "name": "supports-color", - "version": "7.1.0", + "version": "7.2.0", "description": "Detect whether a terminal supports color", "license": "MIT", "repository": "chalk/supports-color", diff --git a/node_modules/uri-js/LICENSE b/node_modules/uri-js/LICENSE new file mode 100755 index 0000000000000..9338bde8eb43b --- /dev/null +++ b/node_modules/uri-js/LICENSE @@ -0,0 +1,11 @@ +Copyright 2011 Gary Court. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/node_modules/uri-js/README.md b/node_modules/uri-js/README.md old mode 100644 new mode 100755 index 3f225e74508de..3dbe4054f2577 --- a/node_modules/uri-js/README.md +++ b/node_modules/uri-js/README.md @@ -3,7 +3,7 @@ URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. -URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.2kb (gzipped, 16kb deflated). +URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). ## API @@ -101,9 +101,23 @@ URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_schem * urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] * urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] -### HTTP Support +### HTTP/HTTPS Support URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true + URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true + +### WS/WSS Support + + URI.parse("wss://example.com/foo?bar=baz"); + //returns: + //{ + // scheme : "wss", + // host: "example.com", + // resourceName: "/foo?bar=baz", + // secure: true, + //} + + URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true ### Mailto Support @@ -152,9 +166,11 @@ To load in a browser, use the following tag: -To load in a CommonJS (Node.js) environment, first install with npm by running on the command line: +To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: npm install uri-js + # OR + yarn add uri-js Then, in your code, load it using: @@ -183,17 +199,3 @@ URI validation has been removed as it was slow, exposed a vulnerabilty, and was ### Breaking changes from 1.x The `errors` array on parsed components is now an `error` string. - -## License ([Simplified BSD](http://en.wikipedia.org/wiki/BSD_licenses#2-clause)) - -Copyright 2011 Gary Court. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/node_modules/uri-js/bower.json b/node_modules/uri-js/bower.json deleted file mode 100644 index 7a40440176809..0000000000000 --- a/node_modules/uri-js/bower.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "uri-js", - "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", - "main": "dist/es5/uri.all.js", - "moduleType": [ - "globals", - "amd", - "node", - "es6" - ], - "authors": [ - "Gary Court " - ], - "license": "BSD-2-Clause", - "keywords": [ - "URI", - "IRI", - "IDN", - "URN", - "HTTP", - "HTTPS", - "MAILTO", - "RFC3986", - "RFC3987", - "RFC5891", - "RFC2616", - "RFC2818", - "RFC2141", - "RFC4122", - "RFC6068" - ], - "homepage": "https://github.com/garycourt/uri-js", - "repository": { - "type": "git", - "url": "http://github.com/garycourt/uri-js" - }, - "dependencies": { - "punycode": "^2.1.0" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/uri-js/dist/es5/uri.all.d.ts b/node_modules/uri-js/dist/es5/uri.all.d.ts old mode 100644 new mode 100755 index 320f53417f1e8..da51e23527705 --- a/node_modules/uri-js/dist/es5/uri.all.d.ts +++ b/node_modules/uri-js/dist/es5/uri.all.d.ts @@ -1,59 +1,59 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.js b/node_modules/uri-js/dist/es5/uri.all.js old mode 100644 new mode 100755 index 2df06091a638f..47f42f8aa1669 --- a/node_modules/uri-js/dist/es5/uri.all.js +++ b/node_modules/uri-js/dist/es5/uri.all.js @@ -1,4 +1,4 @@ -/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -961,9 +961,9 @@ function _recomposeAuthority(components, options) { return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; })); } - if (typeof components.port === "number") { + if (typeof components.port === "number" || typeof components.port === "string") { uriTokens.push(":"); - uriTokens.push(components.port.toString(10)); + uriTokens.push(String(components.port)); } return uriTokens.length ? uriTokens.join("") : undefined; } @@ -1166,8 +1166,9 @@ var handler = { return components; }, serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; //normalize the default port - if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { + if (components.port === (secure ? 443 : 80) || components.port === "") { components.port = undefined; } //normalize the empty path @@ -1188,6 +1189,57 @@ var handler$1 = { serialize: handler.serialize }; +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + var O = {}; var isIRI = true; //RFC 3986 @@ -1218,7 +1270,7 @@ function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(UNRESERVED) ? str : decStr; } -var handler$2 = { +var handler$4 = { scheme: "mailto", parse: function parse$$1(components, options) { var mailtoComponents = components; @@ -1306,7 +1358,7 @@ var handler$2 = { var URN_PARSE = /^([^\:]+)\:(.*)/; //RFC 2141 -var handler$3 = { +var handler$5 = { scheme: "urn", parse: function parse$$1(components, options) { var matches = components.path && components.path.match(URN_PARSE); @@ -1345,7 +1397,7 @@ var handler$3 = { var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; //RFC 4122 -var handler$4 = { +var handler$6 = { scheme: "urn:uuid", parse: function parse(urnComponents, options) { var uuidComponents = urnComponents; @@ -1369,6 +1421,8 @@ SCHEMES[handler$1.scheme] = handler$1; SCHEMES[handler$2.scheme] = handler$2; SCHEMES[handler$3.scheme] = handler$3; SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; exports.SCHEMES = SCHEMES; exports.pctEncChar = pctEncChar; diff --git a/node_modules/uri-js/dist/es5/uri.all.js.map b/node_modules/uri-js/dist/es5/uri.all.js.map old mode 100644 new mode 100755 index 536ffa8815efd..5b30c4e2202e1 --- a/node_modules/uri-js/dist/es5/uri.all.js.map +++ b/node_modules/uri-js/dist/es5/uri.all.js.map @@ -1 +1 @@ -{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (components.port === (String(components.scheme).toLowerCase() !== \"https\" ? 80 : 443) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(components.port.toString(10));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","port","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","fragment","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AUAA,SAAA4E,KAAA,GAAA;sCAAyBkP,IAAzB;YAAA;;;QACKA,KAAK/R,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAU+R,KAAK,CAAL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,EAAqF;2BACrEH,KAAf,GAAuBH,eAAeG,KAAf,IAAwB,oBAA/C;;eAGMH,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCE,OAAzC,EAAb;YACQJ,gBAAgBE,cAAtB;;sBAEcD,GAAd,GAAoB,CAACC,eAAeR,IAAf,IAAuB,EAAxB,EAA4BS,WAA5B,EAApB;eACOH,aAAP;;CAnBF,CAuBA;;ADhCAP,QAAQM,QAAKJ,MAAb,IAAuBI,OAAvB;AAEA,AACAN,QAAQK,UAAMH,MAAd,IAAwBG,SAAxB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAA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AAsB,CAACJ,eAAeV,IAAhB,IAAwB,CAACU,eAAeV,IAAf,CAAoBe,KAApB,CAA0BC,IAA1B,CAA/C,CAAJ,EAAqF;2BACrEH,KAAf,GAAuBH,eAAeG,KAAf,IAAwB,oBAA/C;;eAGMH,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCE,OAAzC,EAAb;YACQJ,gBAAgBE,cAAtB;;sBAEcD,GAAd,GAAoB,CAACC,eAAeV,IAAf,IAAuB,EAAxB,EAA4BW,WAA5B,EAApB;eACOH,aAAP;;CAnBF,CAuBA;;ADhCAT,QAAQQ,QAAKN,MAAb,IAAuBM,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/node_modules/uri-js/dist/es5/uri.all.min.d.ts old mode 100644 new mode 100755 index 320f53417f1e8..da51e23527705 --- a/node_modules/uri-js/dist/es5/uri.all.min.d.ts +++ b/node_modules/uri-js/dist/es5/uri.all.min.d.ts @@ -1,59 +1,59 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js b/node_modules/uri-js/dist/es5/uri.all.min.js old mode 100644 new mode 100755 index 1b791ef723929..09edffb7ccbb6 --- a/node_modules/uri-js/dist/es5/uri.all.min.js +++ b/node_modules/uri-js/dist/es5/uri.all.min.js @@ -1,3 +1,3 @@ -/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function g(e){return e.replace(/^0*(.*)/,"$1")||"0"}function v(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=R(n,2),o=t[1];return o?o.split(".").map(g).join("."):e}function m(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=R(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=R(i,2),s=u[0],f=u[1],c=f?f.split(":").map(g):[],p=s.split(":").map(g),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,m=Array(d),E=0;E1){var A=m.slice(0,y.index),D=m.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=m.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?N:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(J);if(o){K?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=m(v(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=B[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=Y.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?N:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(m(v(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"==typeof e.port&&(t.push(":"),t.push(e.port.toString(10))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(W))e=e.replace(W,"");else if(e.match(X))e=e.replace(X,"/");else if(e.match(ee))e=e.replace(ee,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(re);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?N:F,t=[],o=B[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?Y.toUnicode(e.host):Y.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?N.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?N.PCT_ENCODED:F.PCT_ENCODED,d)}function I(e){var r=d(e);return r.match(fe)?r:e}var F=u(!1),N=u(!0),R=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},H=Math.floor,z=String.fromCharCode,L=function(e){return String.fromCodePoint.apply(String,T(e))},$=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},M=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},V=function(e,r,n){var t=0;for(e=n?H(e/700):e>>1,e+=H(e/r);e>455;t+=36)e=H(e/35);return H(t+36*e/(e+38))},k=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=$(e.charCodeAt(f++));(d>=36||d>H((_-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dH(_/g)&&s("overflow"),p*=g}var v=r.length+1;a=V(t-c,v,0==c),H(t/v)>_-o&&s("overflow"),o+=H(t/v),t%=v,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},Z=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(z(d))}}catch(j){u=!0,f=j}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,g=l;for(l&&r.push("-");g=t&&AH((_-o)/D)&&s("overflow"),o+=(v-t)*D,t=v;var w=!0,b=!1,x=undefined;try{for(var O,I=e[Symbol.iterator]();!(w=(O=I.next()).done);w=!0){var F=O.value;if(F_&&s("overflow"),F==t){for(var N=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(NA-Z\\x5E-\\x7E]",'[\\"\\\\]'),fe=new RegExp(ae,"g"),ce=new RegExp(ue,"g"),pe=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',se),"g"),he=new RegExp(r("[^]",ae,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),de=he,le={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(components.port.toString(10));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (components.port === (String(components.scheme).toLowerCase() !== \"https\" ? 80 : 443) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file +{"version":3,"sources":["../../src/util.ts","../../src/regexps-uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/uri.ts","../../src/schemes/ws.ts","../../src/schemes/mailto.ts","../../src/regexps-iri.ts","../../src/schemes/http.ts","../../src/schemes/https.ts","../../src/schemes/wss.ts","../../src/schemes/urn.ts","../../src/schemes/urn-uuid.ts","../../src/index.ts"],"names":["merge","sets","Array","_len","_key","arguments","length","slice","xl","x","join","subexp","str","typeOf","o","undefined","Object","prototype","toString","call","split","pop","shift","toLowerCase","toUpperCase","toArray","obj","setInterval","assign","target","source","key","buildExps","isIRI","HEXDIG$$","PCT_ENCODED$","SUB_DELIMS$$","RESERVED$$","UCSCHAR$$","DEC_OCTET_RELAXED$","H16$","LS32$","IPV4ADDRESS$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","ZONEID$","UNRESERVED$$","RegExp","IPRIVATE$$","IPV6ADDRESS$","error","type","RangeError","errors","map","array","fn","result","mapDomain","string","parts","replace","regexSeparators","ucs2decode","output","counter","value","charCodeAt","extra","push","pctEncChar","chr","c","pctDecChars","newStr","i","il","parseInt","substr","String","fromCharCode","c2","c3","_normalizeComponentEncoding","components","protocol","decodeUnreserved","decStr","match","UNRESERVED","scheme","PCT_ENCODED","NOT_SCHEME","userinfo","NOT_USERINFO","host","NOT_HOST","path","NOT_PATH","NOT_PATH_NOSCHEME","query","NOT_QUERY","fragment","NOT_FRAGMENT","_stripLeadingZeros","_normalizeIPv4","matches","IPV4ADDRESS","address","_matches","_normalizeIPv6","IPV6ADDRESS","_matches2","zone","reverse","last","_address$toLowerCase$2","first","firstFields","lastFields","isLastFieldIPv4Address","test","fieldCount","lastFieldsStart","fields","allZeroFields","reduce","acc","field","index","lastLongest","longestZeroFields","sort","a","b","newHost","newFirst","newLast","parse","uriString","options","iri","IRI_PROTOCOL","URI_PROTOCOL","reference","URI_PARSE","NO_MATCH_IS_UNDEFINED","port","isNaN","indexOf","schemeHandler","SCHEMES","unicodeSupport","domainHost","punycode","toASCII","e","_recomposeAuthority","uriTokens","_","$1","$2","removeDotSegments","input","RDS1","RDS2","RDS3","im","RDS5","Error","s","serialize","toUnicode","authority","charAt","absolutePath","resolveComponents","base","relative","skipNormalization","tolerant","lastIndexOf","resolve","baseURI","relativeURI","schemelessOptions","normalize","uri","equal","uriA","uriB","escapeComponent","ESCAPE","unescapeComponent","isSecure","wsComponents","secure","maxInt","regexPunycode","regexNonASCII","floor","Math","stringFromCharCode","ucs2encode","fromCodePoint","apply","toConsumableArray","basicToDigit","codePoint","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","k","baseMinusTMin","decode","inputLength","n","bias","basic","j","oldi","w","t","baseMinusT","out","splice","encode","_step","Symbol","iterator","_iteratorNormalCompletion","_iterator","next","done","currentValue","basicLength","handledCPCount","m","_step2","_iteratorNormalCompletion2","_iterator2","handledCPCountPlusOne","_step3","_iteratorNormalCompletion3","_iterator3","q","qMinusT","handler","http","resourceName","_wsComponents$resourc2","ws","O","VCHAR$$","NOT_LOCAL_PART","NOT_HFNAME","NOT_HFVALUE","mailtoComponents","to","unknownHeaders","headers","hfields","hfield","toAddrs","subject","body","addr","toAddr","atIdx","localPart","domain","name","URN_PARSE","urnComponents","nid","nss","urnScheme","uriComponents","UUID","uuidComponents","uuid","https","wss","mailto","urn"],"mappings":";4LAAA,SAAAA,gCAAyBC,EAAzBC,MAAAC,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,MAAAA,GAAAC,UAAAD,MACKH,EAAKK,OAAS,EAAG,GACf,GAAKL,EAAK,GAAGM,MAAM,GAAI,OAEvB,GADCC,GAAKP,EAAKK,OAAS,EAChBG,EAAI,EAAGA,EAAID,IAAMC,IACpBA,GAAKR,EAAKQ,GAAGF,MAAM,GAAI,YAExBC,GAAMP,EAAKO,GAAID,MAAM,GACnBN,EAAKS,KAAK,UAEVT,GAAK,GAId,QAAAU,GAAuBC,SACf,MAAQA,EAAM,IAGtB,QAAAC,GAAuBC,SACfA,KAAMC,UAAY,YAAqB,OAAND,EAAa,OAASE,OAAOC,UAAUC,SAASC,KAAKL,GAAGM,MAAM,KAAKC,MAAMD,MAAM,KAAKE,QAAQC,cAGrI,QAAAC,GAA4BZ,SACpBA,GAAIY,cAGZ,QAAAC,GAAwBC,SAChBA,KAAQX,WAAqB,OAARW,EAAgBA,YAAexB,OAAQwB,EAA6B,gBAAfA,GAAIpB,QAAuBoB,EAAIN,OAASM,EAAIC,aAAeD,EAAIP,MAAQO,GAAOxB,MAAMe,UAAUV,MAAMY,KAAKO,MAI3L,QAAAE,GAAuBC,EAAgBC,MAChCJ,GAAMG,KACRC,MACE,GAAMC,KAAOD,KACbC,GAAOD,EAAOC,SAGbL,GCnCR,QAAAM,GAA0BC,MAMxBC,GAAWlC,EAFD,QAEgB,YAG1BmC,EAAexB,EAAOA,EAAO,UAAYuB,EAAW,IAAMA,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jB8I,MACaA,EAAcZ,MAAM2I,EAAezI,WAGtC1F,MAAQmO,EAAcnO,OAAS,+BAGvCmO,cAGI,SAAUA,EAA6BzI,MAC5ClD,GAASkD,EAAQlD,QAAU2L,EAAc3L,QAAU,MACnD4L,EAAMD,EAAcC,IACpBE,EAAe9L,EAAf,KAAyBkD,EAAQ0I,KAAOA,GACxChI,EAAgBC,EAAQiI,EAE1BlI,OACaA,EAAcqB,UAAU0G,EAAezI,OAGlD6I,GAAgBJ,EAChBE,EAAMF,EAAcE,aACZtL,MAAUqL,GAAO1I,EAAQ0I,KAAvC,IAA8CC,EAEvCE,ICxDHC,GAAO,2DAIP/B,WACI,iBAED,SAAU0B,EAA6BzI,MACxC+I,GAAiBN,WACRO,KAAOD,EAAeJ,MACtBA,IAAM/Q,UAEhBoI,EAAQwC,UAAcuG,EAAeC,MAASD,EAAeC,KAAKpM,MAAMkM,QAC7DxO,MAAQyO,EAAezO,OAAS,sBAGzCyO,aAGI,SAAUA,EAA+B/I,MAC9CyI,GAAgBM,WAERJ,KAAOI,EAAeC,MAAQ,IAAI5Q,cACzCqQ,GC5BT9H,GAAQqG,GAAKlK,QAAUkK,GAEvBrG,EACQsI,GAAMnM,QAAUmM,GAExBtI,EACQwG,GAAGrK,QAAUqK,GAErBxG,EACQuI,GAAIpM,QAAUoM,GAEtBvI,EACQwI,GAAOrM,QAAUqM,GAEzBxI,EACQyI,GAAItM,QAAUsM,GAEtBzI,EACQqI,GAAKlM,QAAUkM","file":"dist/es5/uri.all.min.js","sourcesContent":["export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.d.ts b/node_modules/uri-js/dist/esnext/index.d.ts old mode 100644 new mode 100755 index be95efb268e77..f6be760343fbd --- a/node_modules/uri-js/dist/esnext/index.d.ts +++ b/node_modules/uri-js/dist/esnext/index.d.ts @@ -1 +1 @@ -export * from "./uri"; +export * from "./uri"; diff --git a/node_modules/uri-js/dist/esnext/index.js b/node_modules/uri-js/dist/esnext/index.js old mode 100644 new mode 100755 index de8868ff6879b..e3531b5b61bb2 --- a/node_modules/uri-js/dist/esnext/index.js +++ b/node_modules/uri-js/dist/esnext/index.js @@ -1,13 +1,17 @@ -import { SCHEMES } from "./uri"; -import http from "./schemes/http"; -SCHEMES[http.scheme] = http; -import https from "./schemes/https"; -SCHEMES[https.scheme] = https; -import mailto from "./schemes/mailto"; -SCHEMES[mailto.scheme] = mailto; -import urn from "./schemes/urn"; -SCHEMES[urn.scheme] = urn; -import uuid from "./schemes/urn-uuid"; -SCHEMES[uuid.scheme] = uuid; -export * from "./uri"; +import { SCHEMES } from "./uri"; +import http from "./schemes/http"; +SCHEMES[http.scheme] = http; +import https from "./schemes/https"; +SCHEMES[https.scheme] = https; +import ws from "./schemes/ws"; +SCHEMES[ws.scheme] = ws; +import wss from "./schemes/wss"; +SCHEMES[wss.scheme] = wss; +import mailto from "./schemes/mailto"; +SCHEMES[mailto.scheme] = mailto; +import urn from "./schemes/urn"; +SCHEMES[urn.scheme] = urn; +import uuid from "./schemes/urn-uuid"; +SCHEMES[uuid.scheme] = uuid; +export * from "./uri"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.js.map b/node_modules/uri-js/dist/esnext/index.js.map old mode 100644 new mode 100755 index e9e400876a37e..0971f6ebcadb7 --- a/node_modules/uri-js/dist/esnext/index.js.map +++ b/node_modules/uri-js/dist/esnext/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts old mode 100644 new mode 100755 index 6fc0f5dba28fc..c91cdacbce6f7 --- a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts +++ b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts @@ -1,3 +1,3 @@ -import { URIRegExps } from "./uri"; -declare const _default: URIRegExps; -export default _default; +import { URIRegExps } from "./uri"; +declare const _default: URIRegExps; +export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js b/node_modules/uri-js/dist/esnext/regexps-iri.js old mode 100644 new mode 100755 index 86239cf38cb01..34e7de989e3b4 --- a/node_modules/uri-js/dist/esnext/regexps-iri.js +++ b/node_modules/uri-js/dist/esnext/regexps-iri.js @@ -1,3 +1,3 @@ -import { buildExps } from "./regexps-uri"; -export default buildExps(true); +import { buildExps } from "./regexps-uri"; +export default buildExps(true); //# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/node_modules/uri-js/dist/esnext/regexps-iri.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts old mode 100644 new mode 100755 index 10ec87bdf913a..6096bda5cd515 --- a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts +++ b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts @@ -1,4 +1,4 @@ -import { URIRegExps } from "./uri"; -export declare function buildExps(isIRI: boolean): URIRegExps; -declare const _default: URIRegExps; -export default _default; +import { URIRegExps } from "./uri"; +export declare function buildExps(isIRI: boolean): URIRegExps; +declare const _default: URIRegExps; +export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js b/node_modules/uri-js/dist/esnext/regexps-uri.js old mode 100644 new mode 100755 index 6e7e9a0219fba..1cc659f133da3 --- a/node_modules/uri-js/dist/esnext/regexps-uri.js +++ b/node_modules/uri-js/dist/esnext/regexps-uri.js @@ -1,42 +1,42 @@ -import { merge, subexp } from "./util"; -export function buildExps(isIRI) { - const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive - LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; - return { - NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED: new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} -export default buildExps(false); +import { merge, subexp } from "./util"; +export function buildExps(isIRI) { + const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive + LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +export default buildExps(false); //# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/node_modules/uri-js/dist/esnext/regexps-uri.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/http.d.ts b/node_modules/uri-js/dist/esnext/schemes/http.d.ts old mode 100644 new mode 100755 index 3899956970e5a..fe5b2f354241b --- a/node_modules/uri-js/dist/esnext/schemes/http.d.ts +++ b/node_modules/uri-js/dist/esnext/schemes/http.d.ts @@ -1,3 +1,3 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js old mode 100644 new mode 100755 index a280369881c13..6abf0fe6e3f1f --- a/node_modules/uri-js/dist/esnext/schemes/http.js +++ b/node_modules/uri-js/dist/esnext/schemes/http.js @@ -1,27 +1,28 @@ -const handler = { - scheme: "http", - domainHost: true, - parse: function (components, options) { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - }, - serialize: function (components, options) { - //normalize the default port - if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { - components.port = undefined; - } - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - return components; - } -}; -export default handler; +const handler = { + scheme: "http", + domainHost: true, + parse: function (components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function (components, options) { + const secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; +export default handler; //# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js.map b/node_modules/uri-js/dist/esnext/schemes/http.js.map old mode 100644 new mode 100755 index 83e2ad54e4140..82118970c54de --- a/node_modules/uri-js/dist/esnext/schemes/http.js.map +++ b/node_modules/uri-js/dist/esnext/schemes/http.js.map @@ -1 +1 @@ -{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACnH,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/node_modules/uri-js/dist/esnext/schemes/https.d.ts old mode 100644 new mode 100755 index 3899956970e5a..fe5b2f354241b --- a/node_modules/uri-js/dist/esnext/schemes/https.d.ts +++ b/node_modules/uri-js/dist/esnext/schemes/https.d.ts @@ -1,3 +1,3 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js b/node_modules/uri-js/dist/esnext/schemes/https.js old mode 100644 new mode 100755 index fc3c71a6c2847..ec4b6e76de671 --- a/node_modules/uri-js/dist/esnext/schemes/https.js +++ b/node_modules/uri-js/dist/esnext/schemes/https.js @@ -1,9 +1,9 @@ -import http from "./http"; -const handler = { - scheme: "https", - domainHost: http.domainHost, - parse: http.parse, - serialize: http.serialize -}; -export default handler; +import http from "./http"; +const handler = { + scheme: "https", + domainHost: http.domainHost, + parse: http.parse, + serialize: http.serialize +}; +export default handler; //# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js.map b/node_modules/uri-js/dist/esnext/schemes/https.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts old mode 100644 new mode 100755 index b0db4bfc1a5e0..e2aefc2afd163 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts +++ b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts @@ -1,12 +1,12 @@ -import { URISchemeHandler, URIComponents } from "../uri"; -export interface MailtoHeaders { - [hfname: string]: string; -} -export interface MailtoComponents extends URIComponents { - to: Array; - headers?: MailtoHeaders; - subject?: string; - body?: string; -} -declare const handler: URISchemeHandler; -export default handler; +import { URISchemeHandler, URIComponents } from "../uri"; +export interface MailtoHeaders { + [hfname: string]: string; +} +export interface MailtoComponents extends URIComponents { + to: Array; + headers?: MailtoHeaders; + subject?: string; + body?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js b/node_modules/uri-js/dist/esnext/schemes/mailto.js old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts old mode 100644 new mode 100755 index 261ddcea665a5..e75f2e793f929 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts @@ -1,7 +1,7 @@ -import { URISchemeHandler, URIOptions } from "../uri"; -import { URNComponents } from "./urn"; -export interface UUIDComponents extends URNComponents { - uuid?: string; -} -declare const handler: URISchemeHandler; -export default handler; +import { URISchemeHandler, URIOptions } from "../uri"; +import { URNComponents } from "./urn"; +export interface UUIDComponents extends URNComponents { + uuid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js old mode 100644 new mode 100755 index 044c8a80daa6d..d1fce49555481 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js @@ -1,23 +1,23 @@ -const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; -//RFC 4122 -const handler = { - scheme: "urn:uuid", - parse: function (urnComponents, options) { - const uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - }, - serialize: function (uuidComponents, options) { - const urnComponents = uuidComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - }, -}; -export default handler; +const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; +//RFC 4122 +const handler = { + scheme: "urn:uuid", + parse: function (urnComponents, options) { + const uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function (uuidComponents, options) { + const urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + }, +}; +export default handler; //# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts old mode 100644 new mode 100755 index 49481055adffa..7e0c2fba6c628 --- a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts +++ b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts @@ -1,10 +1,10 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -export interface URNComponents extends URIComponents { - nid?: string; - nss?: string; -} -export interface URNOptions extends URIOptions { - nid?: string; -} -declare const handler: URISchemeHandler; -export default handler; +import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; +export interface URNComponents extends URIComponents { + nid?: string; + nss?: string; +} +export interface URNOptions extends URIOptions { + nid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js b/node_modules/uri-js/dist/esnext/schemes/urn.js old mode 100644 new mode 100755 index b53161c2eece1..5d3f10aa0f8b1 --- a/node_modules/uri-js/dist/esnext/schemes/urn.js +++ b/node_modules/uri-js/dist/esnext/schemes/urn.js @@ -1,49 +1,49 @@ -import { SCHEMES } from "../uri"; -const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; -const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; -const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; -const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; -const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); -const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); -const URN_PARSE = /^([^\:]+)\:(.*)/; -const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; -//RFC 2141 -const handler = { - scheme: "urn", - parse: function (components, options) { - const matches = components.path && components.path.match(URN_PARSE); - let urnComponents = components; - if (matches) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = matches[1].toLowerCase(); - const nss = matches[2]; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } - else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - }, - serialize: function (urnComponents, options) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = urnComponents.nid; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - const uriComponents = urnComponents; - const nss = urnComponents.nss; - uriComponents.path = `${nid || options.nid}:${nss}`; - return uriComponents; - }, -}; -export default handler; +import { SCHEMES } from "../uri"; +const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; +const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; +const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; +const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; +const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); +const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); +const URN_PARSE = /^([^\:]+)\:(.*)/; +const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; +//RFC 2141 +const handler = { + scheme: "urn", + parse: function (components, options) { + const matches = components.path && components.path.match(URN_PARSE); + let urnComponents = components; + if (matches) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = matches[1].toLowerCase(); + const nss = matches[2]; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } + else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function (urnComponents, options) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = urnComponents.nid; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + const uriComponents = urnComponents; + const nss = urnComponents.nss; + uriComponents.path = `${nid || options.nid}:${nss}`; + return uriComponents; + }, +}; +export default handler; //# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/node_modules/uri-js/dist/esnext/schemes/urn.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.d.ts b/node_modules/uri-js/dist/esnext/schemes/ws.d.ts new file mode 100755 index 0000000000000..47f4835b24a96 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface WSComponents extends URIComponents { + resourceName?: string; + secure?: boolean; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js b/node_modules/uri-js/dist/esnext/schemes/ws.js new file mode 100755 index 0000000000000..9277f035a0bdd --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.js @@ -0,0 +1,41 @@ +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +const handler = { + scheme: "ws", + domainHost: true, + parse: function (components, options) { + const wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function (wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + const [path, query] = wsComponents.resourceName.split('?'); + wsComponents.path = (path && path !== '/' ? path : undefined); + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; +export default handler; +//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/node_modules/uri-js/dist/esnext/schemes/ws.js.map new file mode 100755 index 0000000000000..186818ccd65df --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CA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YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.d.ts b/node_modules/uri-js/dist/esnext/schemes/wss.d.ts new file mode 100755 index 0000000000000..fe5b2f354241b --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js b/node_modules/uri-js/dist/esnext/schemes/wss.js new file mode 100755 index 0000000000000..d1e22ccd6e0cc --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.js @@ -0,0 +1,9 @@ +import ws from "./ws"; +const handler = { + scheme: "wss", + domainHost: ws.domainHost, + parse: ws.parse, + serialize: ws.serialize +}; +export default handler; +//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/node_modules/uri-js/dist/esnext/schemes/wss.js.map new file mode 100755 index 0000000000000..e19006d947b35 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.d.ts b/node_modules/uri-js/dist/esnext/uri.d.ts old mode 100644 new mode 100755 index 320f53417f1e8..da51e23527705 --- a/node_modules/uri-js/dist/esnext/uri.d.ts +++ b/node_modules/uri-js/dist/esnext/uri.d.ts @@ -1,59 +1,59 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/esnext/uri.js b/node_modules/uri-js/dist/esnext/uri.js old mode 100644 new mode 100755 index 2fb6d713e3a58..659ce2651cea1 --- a/node_modules/uri-js/dist/esnext/uri.js +++ b/node_modules/uri-js/dist/esnext/uri.js @@ -270,9 +270,9 @@ function _recomposeAuthority(components, options) { //normalize IP hosts, add brackets and escape zone separator for IPv6 uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); } - if (typeof components.port === "number") { + if (typeof components.port === "number" || typeof components.port === "string") { uriTokens.push(":"); - uriTokens.push(components.port.toString(10)); + uriTokens.push(String(components.port)); } return uriTokens.length ? uriTokens.join("") : undefined; } diff --git a/node_modules/uri-js/dist/esnext/uri.js.map b/node_modules/uri-js/dist/esnext/uri.js.map old mode 100644 new mode 100755 index e1d831cb2a05e..2e72ab18d1192 --- a/node_modules/uri-js/dist/esnext/uri.js.map +++ b/node_modules/uri-js/dist/esnext/uri.js.map @@ -1 +1 @@ -{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiDrD,MAAM,CAAC,MAAM,OAAO,GAAsC,EAAE,CAAC;AAE7D,MAAM,qBAAqB,GAAU;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAQ,CAAC;IAEb,IAAI,CAAC,GAAG,EAAE;QAAE,CAAC,GAAG,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ACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,OAAO,IAAI,KAAK,IAAI,CAAC;AACtB,CAAC;AAAA,CAAC;AAEF,MAAM,0BAA0B,GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.d.ts b/node_modules/uri-js/dist/esnext/util.d.ts old mode 100644 new mode 100755 index 8b484cd35ba7c..7c12857543a6b --- a/node_modules/uri-js/dist/esnext/util.d.ts +++ b/node_modules/uri-js/dist/esnext/util.d.ts @@ -1,6 +1,6 @@ -export declare function merge(...sets: Array): string; -export declare function subexp(str: string): string; -export declare function typeOf(o: any): string; -export declare function toUpperCase(str: string): string; -export declare function toArray(obj: any): Array; -export declare function assign(target: object, source: any): any; +export declare function merge(...sets: Array): string; +export declare function subexp(str: string): string; +export declare function typeOf(o: any): string; +export declare function toUpperCase(str: string): string; +export declare function toArray(obj: any): Array; +export declare function assign(target: object, source: any): any; diff --git a/node_modules/uri-js/dist/esnext/util.js b/node_modules/uri-js/dist/esnext/util.js old mode 100644 new mode 100755 index 45af46fe547b9..072711efdbfe3 --- a/node_modules/uri-js/dist/esnext/util.js +++ b/node_modules/uri-js/dist/esnext/util.js @@ -1,36 +1,36 @@ -export function merge(...sets) { - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - const xl = sets.length - 1; - for (let x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } - else { - return sets[0]; - } -} -export function subexp(str) { - return "(?:" + str + ")"; -} -export function typeOf(o) { - return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); -} -export function toUpperCase(str) { - return str.toUpperCase(); -} -export function toArray(obj) { - return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; -} -export function assign(target, source) { - const obj = target; - if (source) { - for (const key in source) { - obj[key] = source[key]; - } - } - return obj; -} +export function merge(...sets) { + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + const xl = sets.length - 1; + for (let x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } + else { + return sets[0]; + } +} +export function subexp(str) { + return "(?:" + str + ")"; +} +export function typeOf(o) { + return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); +} +export function toUpperCase(str) { + return str.toUpperCase(); +} +export function toArray(obj) { + return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; +} +export function assign(target, source) { + const obj = target; + if (source) { + for (const key in source) { + obj[key] = source[key]; + } + } + return obj; +} //# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.js.map b/node_modules/uri-js/dist/esnext/util.js.map old mode 100644 new mode 100755 diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json old mode 100644 new mode 100755 index ad02071fd26a1..4120c110552ec --- a/node_modules/uri-js/package.json +++ b/node_modules/uri-js/package.json @@ -1,19 +1,28 @@ { "name": "uri-js", - "version": "4.2.2", + "version": "4.4.0", "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", "main": "dist/es5/uri.all.js", "types": "dist/es5/uri.all.d.ts", "directories": { "test": "tests" }, + "files": [ + "dist", + "package.json", + "yarn.lock", + "README.md", + "CHANGELOG", + "LICENSE" + ], "scripts": { - "build:esnext": "node_modules/.bin/tsc", - "build:es5": "node_modules/.bin/rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", - "build:es5:fix-sourcemap": "node_modules/.bin/sorcery -i dist/es5/uri.all.js", - "build:es5:min": "node_modules/.bin/uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", + "build:esnext": "tsc", + "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", + "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", + "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", - "test": "node_modules/.bin/mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" + "clean": "rm -rf dist", + "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" }, "repository": { "type": "git", @@ -27,6 +36,8 @@ "UUID", "HTTP", "HTTPS", + "WS", + "WSS", "MAILTO", "RFC3986", "RFC3987", @@ -38,6 +49,7 @@ "RFC4291", "RFC5952", "RFC6068", + "RFC6455", "RFC6874" ], "author": "Gary Court ", diff --git a/node_modules/uri-js/rollup.config.js b/node_modules/uri-js/rollup.config.js deleted file mode 100644 index 5bb8b0541b5fc..0000000000000 --- a/node_modules/uri-js/rollup.config.js +++ /dev/null @@ -1,32 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve'; -import babel from 'rollup-plugin-babel'; -const packageJson = require('./package.json'); - -export default { - entry : "dist/esnext/index.js", - format : "umd", - moduleName : "URI", - plugins: [ - resolve({ - module: true, - jsnext: true, - preferBuiltins: false - }), - - babel({ - "presets": [ - ["latest", { - "es2015": { - "modules": false - } - }] - ], - "plugins": ["external-helpers"], - "externalHelpers": false - } -) - ], - dest : "dist/es5/uri.all.js", - sourceMap: true, - banner: "/** @license URI.js v" + packageJson.version + " (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */" -} diff --git a/node_modules/uri-js/src/index.ts b/node_modules/uri-js/src/index.ts deleted file mode 100644 index 6532a1bcb1056..0000000000000 --- a/node_modules/uri-js/src/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { SCHEMES } from "./uri"; - -import http from "./schemes/http"; -SCHEMES[http.scheme] = http; - -import https from "./schemes/https"; -SCHEMES[https.scheme] = https; - -import mailto from "./schemes/mailto"; -SCHEMES[mailto.scheme] = mailto; - -import urn from "./schemes/urn"; -SCHEMES[urn.scheme] = urn; - -import uuid from "./schemes/urn-uuid"; -SCHEMES[uuid.scheme] = uuid; - -export * from "./uri"; diff --git a/node_modules/uri-js/src/punycode.d.ts b/node_modules/uri-js/src/punycode.d.ts deleted file mode 100644 index 4ecbd34845935..0000000000000 --- a/node_modules/uri-js/src/punycode.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -declare module 'punycode' { - function ucs2decode(string:string):Array; - function ucs2encode(array:Array):string; - function decode(string:string):string; - function encode(string:string):string; - function toASCII(string:string):string; - function toUnicode(string:string):string; - - interface Punycode { - 'version': '2.2.0'; - 'ucs2': { - 'decode': typeof ucs2decode; - 'encode': typeof ucs2encode; - }, - 'decode': typeof decode; - 'encode': typeof encode; - 'toASCII': typeof toASCII; - 'toUnicode': typeof toUnicode; - } - - const punycode:Punycode; - - export default punycode; -} diff --git a/node_modules/uri-js/src/regexps-iri.ts b/node_modules/uri-js/src/regexps-iri.ts deleted file mode 100644 index 8bd605b43dba3..0000000000000 --- a/node_modules/uri-js/src/regexps-iri.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { URIRegExps } from "./uri"; -import { buildExps } from "./regexps-uri"; - -export default buildExps(true); diff --git a/node_modules/uri-js/src/regexps-uri.ts b/node_modules/uri-js/src/regexps-uri.ts deleted file mode 100644 index 8d6b547916909..0000000000000 --- a/node_modules/uri-js/src/regexps-uri.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { URIRegExps } from "./uri"; -import { merge, subexp } from "./util"; - -export function buildExps(isIRI:boolean):URIRegExps { - const - ALPHA$$ = "[A-Za-z]", - CR$ = "[\\x0D]", - DIGIT$$ = "[0-9]", - DQUOTE$$ = "[\\x22]", - HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive - LF$$ = "[\\x0A]", - SP$$ = "[\\x20]", - PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", - SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", - RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), - UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), - SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), - USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), - DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), - DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), - H16$ = subexp(HEXDIG$$ + "{1,4}"), - LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), - IPV6ADDRESS1$ = subexp( subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp( "\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp( H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$ ), //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:" ), //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), - ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), - IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), - HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), - PORT$ = subexp(DIGIT$$ + "*"), - AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), - PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), - SEGMENT$ = subexp(PCHAR$ + "*"), - SEGMENT_NZ$ = subexp(PCHAR$ + "+"), - SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), - PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), - PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", - PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), - FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), - HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), - RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), - ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), - - GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", - SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$" - ; - - return { - NOT_SCHEME : new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO : new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST : new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH : new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME : new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY : new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT : new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE : new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED : new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS : new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED : new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS : new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS : new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} - -export default buildExps(false); diff --git a/node_modules/uri-js/src/schemes/http.ts b/node_modules/uri-js/src/schemes/http.ts deleted file mode 100644 index 3e53145cc357d..0000000000000 --- a/node_modules/uri-js/src/schemes/http.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; - -const handler:URISchemeHandler = { - scheme : "http", - - domainHost : true, - - parse : function (components:URIComponents, options:URIOptions):URIComponents { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - - return components; - }, - - serialize : function (components:URIComponents, options:URIOptions):URIComponents { - //normalize the default port - if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { - components.port = undefined; - } - - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - - return components; - } -}; - -export default handler; \ No newline at end of file diff --git a/node_modules/uri-js/src/schemes/https.ts b/node_modules/uri-js/src/schemes/https.ts deleted file mode 100644 index a19a494289998..0000000000000 --- a/node_modules/uri-js/src/schemes/https.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -import http from "./http"; - -const handler:URISchemeHandler = { - scheme : "https", - domainHost : http.domainHost, - parse : http.parse, - serialize : http.serialize -} - -export default handler; \ No newline at end of file diff --git a/node_modules/uri-js/src/schemes/mailto.ts b/node_modules/uri-js/src/schemes/mailto.ts deleted file mode 100644 index 3faf320d65590..0000000000000 --- a/node_modules/uri-js/src/schemes/mailto.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; -import punycode from "punycode"; -import { merge, subexp, toUpperCase, toArray } from "../util"; - -export interface MailtoHeaders { - [hfname:string]:string -} - -export interface MailtoComponents extends URIComponents { - to:Array, - headers?:MailtoHeaders, - subject?:string, - body?:string -} - -const O:MailtoHeaders = {}; -const isIRI = true; - -//RFC 3986 -const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; -const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive -const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded - -//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = -//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) -//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext -//const VCHAR$$ = "[\\x21-\\x7E]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext -//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); -//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); -//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); -const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; -const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; -const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); -const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); -const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); -const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); -const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); - -//RFC 6068 -const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 -const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; -const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); -const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); -const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); -const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); -const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); -const HFNAME$ = subexp(QCHAR$ + "*"); -const HFVALUE$ = HFNAME$; -const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); -const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); -const HFIELDS$ = subexp("\\?" + HFIELDS2$); -const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); - -const UNRESERVED = new RegExp(UNRESERVED$$, "g"); -const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); -const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); -const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); -const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); -const NOT_HFVALUE = NOT_HFNAME; -const TO = new RegExp("^" + TO$ + "$"); -const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); - -function decodeUnreserved(str:string):string { - const decStr = pctDecChars(str); - return (!decStr.match(UNRESERVED) ? str : decStr); -} - -const handler:URISchemeHandler = { - scheme : "mailto", - - parse : function (components:URIComponents, options:URIOptions):MailtoComponents { - const mailtoComponents = components as MailtoComponents; - const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); - mailtoComponents.path = undefined; - - if (mailtoComponents.query) { - let unknownHeaders = false - const headers:MailtoHeaders = {}; - const hfields = mailtoComponents.query.split("&"); - - for (let x = 0, xl = hfields.length; x < xl; ++x) { - const hfield = hfields[x].split("="); - - switch (hfield[0]) { - case "to": - const toAddrs = hfield[1].split(","); - for (let x = 0, xl = toAddrs.length; x < xl; ++x) { - to.push(toAddrs[x]); - } - break; - case "subject": - mailtoComponents.subject = unescapeComponent(hfield[1], options); - break; - case "body": - mailtoComponents.body = unescapeComponent(hfield[1], options); - break; - default: - unknownHeaders = true; - headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); - break; - } - } - - if (unknownHeaders) mailtoComponents.headers = headers; - } - - mailtoComponents.query = undefined; - - for (let x = 0, xl = to.length; x < xl; ++x) { - const addr = to[x].split("@"); - - addr[0] = unescapeComponent(addr[0]); - - if (!options.unicodeSupport) { - //convert Unicode IDN -> ASCII IDN - try { - addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); - } catch (e) { - mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; - } - } else { - addr[1] = unescapeComponent(addr[1], options).toLowerCase(); - } - - to[x] = addr.join("@"); - } - - return mailtoComponents; - }, - - serialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents { - const components = mailtoComponents as URIComponents; - const to = toArray(mailtoComponents.to); - if (to) { - for (let x = 0, xl = to.length; x < xl; ++x) { - const toAddr = String(to[x]); - const atIdx = toAddr.lastIndexOf("@"); - const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); - let domain = toAddr.slice(atIdx + 1); - - //convert IDN via punycode - try { - domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); - } catch (e) { - components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - - to[x] = localPart + "@" + domain; - } - - components.path = to.join(","); - } - - const headers = mailtoComponents.headers = mailtoComponents.headers || {}; - - if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; - if (mailtoComponents.body) headers["body"] = mailtoComponents.body; - - const fields = []; - for (const name in headers) { - if (headers[name] !== O[name]) { - fields.push( - name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + - "=" + - headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar) - ); - } - } - if (fields.length) { - components.query = fields.join("&"); - } - - return components; - } -} - -export default handler; \ No newline at end of file diff --git a/node_modules/uri-js/src/schemes/urn-uuid.ts b/node_modules/uri-js/src/schemes/urn-uuid.ts deleted file mode 100644 index 56653292096fe..0000000000000 --- a/node_modules/uri-js/src/schemes/urn-uuid.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -import { URNComponents } from "./urn"; -import { SCHEMES } from "../uri"; - -export interface UUIDComponents extends URNComponents { - uuid?: string; -} - -const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; - -//RFC 4122 -const handler:URISchemeHandler = { - scheme : "urn:uuid", - - parse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents { - const uuidComponents = urnComponents as UUIDComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - - return uuidComponents; - }, - - serialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents { - const urnComponents = uuidComponents as URNComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - }, -}; - -export default handler; \ No newline at end of file diff --git a/node_modules/uri-js/src/schemes/urn.ts b/node_modules/uri-js/src/schemes/urn.ts deleted file mode 100644 index 590f9cce16a52..0000000000000 --- a/node_modules/uri-js/src/schemes/urn.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -import { pctEncChar, SCHEMES } from "../uri"; - -export interface URNComponents extends URIComponents { - nid?:string; - nss?:string; -} - -export interface URNOptions extends URIOptions { - nid?:string; -} - -const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; -const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; -const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; -const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; -const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); -const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); -const URN_PARSE = /^([^\:]+)\:(.*)/; -const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; - -//RFC 2141 -const handler:URISchemeHandler = { - scheme : "urn", - - parse : function (components:URIComponents, options:URNOptions):URNComponents { - const matches = components.path && components.path.match(URN_PARSE); - let urnComponents = components as URNComponents; - - if (matches) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = matches[1].toLowerCase(); - const nss = matches[2]; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options) as URNComponents; - } - } else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - - return urnComponents; - }, - - serialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = urnComponents.nid; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents; - } - - const uriComponents = urnComponents as URIComponents; - const nss = urnComponents.nss; - uriComponents.path = `${nid || options.nid}:${nss}`; - - return uriComponents; - }, -}; - -export default handler; \ No newline at end of file diff --git a/node_modules/uri-js/src/uri.ts b/node_modules/uri-js/src/uri.ts deleted file mode 100644 index c282c37233600..0000000000000 --- a/node_modules/uri-js/src/uri.ts +++ /dev/null @@ -1,556 +0,0 @@ -/** - * URI.js - * - * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. - * @author Gary Court - * @see http://github.com/garycourt/uri-js - */ - -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. - */ - -import URI_PROTOCOL from "./regexps-uri"; -import IRI_PROTOCOL from "./regexps-iri"; -import punycode from "punycode"; -import { toUpperCase, typeOf, assign } from "./util"; - -export interface URIComponents { - scheme?:string; - userinfo?:string; - host?:string; - port?:number|string; - path?:string; - query?:string; - fragment?:string; - reference?:string; - error?:string; -} - -export interface URIOptions { - scheme?:string; - reference?:string; - tolerant?:boolean; - absolutePath?:boolean; - iri?:boolean; - unicodeSupport?:boolean; - domainHost?:boolean; -} - -export interface URISchemeHandler { - scheme:string; - parse(components:ParentComponents, options:Options):Components; - serialize(components:Components, options:Options):ParentComponents; - unicodeSupport?:boolean; - domainHost?:boolean; - absolutePath?:boolean; -} - -export interface URIRegExps { - NOT_SCHEME : RegExp, - NOT_USERINFO : RegExp, - NOT_HOST : RegExp, - NOT_PATH : RegExp, - NOT_PATH_NOSCHEME : RegExp, - NOT_QUERY : RegExp, - NOT_FRAGMENT : RegExp, - ESCAPE : RegExp, - UNRESERVED : RegExp, - OTHER_CHARS : RegExp, - PCT_ENCODED : RegExp, - IPV4ADDRESS : RegExp, - IPV6ADDRESS : RegExp, -} - -export const SCHEMES:{[scheme:string]:URISchemeHandler} = {}; - -export function pctEncChar(chr:string):string { - const c = chr.charCodeAt(0); - let e:string; - - if (c < 16) e = "%0" + c.toString(16).toUpperCase(); - else if (c < 128) e = "%" + c.toString(16).toUpperCase(); - else if (c < 2048) e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); - else e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); - - return e; -} - -export function pctDecChars(str:string):string { - let newStr = ""; - let i = 0; - const il = str.length; - - while (i < il) { - const c = parseInt(str.substr(i + 1, 2), 16); - - if (c < 128) { - newStr += String.fromCharCode(c); - i += 3; - } - else if (c >= 194 && c < 224) { - if ((il - i) >= 6) { - const c2 = parseInt(str.substr(i + 4, 2), 16); - newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - } else { - newStr += str.substr(i, 6); - } - i += 6; - } - else if (c >= 224) { - if ((il - i) >= 9) { - const c2 = parseInt(str.substr(i + 4, 2), 16); - const c3 = parseInt(str.substr(i + 7, 2), 16); - newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } else { - newStr += str.substr(i, 9); - } - i += 9; - } - else { - newStr += str.substr(i, 3); - i += 3; - } - } - - return newStr; -} - -function _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) { - function decodeUnreserved(str:string):string { - const decStr = pctDecChars(str); - return (!decStr.match(protocol.UNRESERVED) ? str : decStr); - } - - if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); - if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - - return components; -}; - -function _stripLeadingZeros(str:string):string { - return str.replace(/^0*(.*)/, "$1") || "0"; -} - -function _normalizeIPv4(host:string, protocol:URIRegExps):string { - const matches = host.match(protocol.IPV4ADDRESS) || []; - const [, address] = matches; - - if (address) { - return address.split(".").map(_stripLeadingZeros).join("."); - } else { - return host; - } -} - -function _normalizeIPv6(host:string, protocol:URIRegExps):string { - const matches = host.match(protocol.IPV6ADDRESS) || []; - const [, address, zone] = matches; - - if (address) { - const [last, first] = address.toLowerCase().split('::').reverse(); - const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; - const lastFields = last.split(":").map(_stripLeadingZeros); - const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); - const fieldCount = isLastFieldIPv4Address ? 7 : 8; - const lastFieldsStart = lastFields.length - fieldCount; - const fields = Array(fieldCount); - - for (let x = 0; x < fieldCount; ++x) { - fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; - } - - if (isLastFieldIPv4Address) { - fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); - } - - const allZeroFields = fields.reduce>((acc, field, index) => { - if (!field || field === "0") { - const lastLongest = acc[acc.length - 1]; - if (lastLongest && lastLongest.index + lastLongest.length === index) { - lastLongest.length++; - } else { - acc.push({ index, length : 1 }); - } - } - return acc; - }, []); - - const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; - - let newHost:string; - if (longestZeroFields && longestZeroFields.length > 1) { - const newFirst = fields.slice(0, longestZeroFields.index) ; - const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); - newHost = newFirst.join(":") + "::" + newLast.join(":"); - } else { - newHost = fields.join(":"); - } - - if (zone) { - newHost += "%" + zone; - } - - return newHost; - } else { - return host; - } -} - -const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; -const NO_MATCH_IS_UNDEFINED = (("").match(/(){0}/))[1] === undefined; - -export function parse(uriString:string, options:URIOptions = {}):URIComponents { - const components:URIComponents = {}; - const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); - - if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; - - const matches = uriString.match(URI_PARSE); - - if (matches) { - if (NO_MATCH_IS_UNDEFINED) { - //store each component - components.scheme = matches[1]; - components.userinfo = matches[3]; - components.host = matches[4]; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = matches[7]; - components.fragment = matches[8]; - - //fix port number - if (isNaN(components.port)) { - components.port = matches[5]; - } - } else { //IE FIX for improper RegExp matching - //store each component - components.scheme = matches[1] || undefined; - components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); - components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); - components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); - - //fix port number - if (isNaN(components.port)) { - components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); - } - } - - if (components.host) { - //normalize IP hosts - components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); - } - - //determine reference type - if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { - components.reference = "same-document"; - } else if (components.scheme === undefined) { - components.reference = "relative"; - } else if (components.fragment === undefined) { - components.reference = "absolute"; - } else { - components.reference = "uri"; - } - - //check for reference errors - if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { - components.error = components.error || "URI is not a " + options.reference + " reference."; - } - - //find scheme handler - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - - //check if scheme can't handle IRIs - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - //if host component is a domain name - if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { - //convert Unicode IDN -> ASCII IDN - try { - components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; - } - } - //convert IRI -> URI - _normalizeComponentEncoding(components, URI_PROTOCOL); - } else { - //normalize encodings - _normalizeComponentEncoding(components, protocol); - } - - //perform scheme specific parsing - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(components, options); - } - } else { - components.error = components.error || "URI can not be parsed."; - } - - return components; -}; - -function _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined { - const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); - const uriTokens:Array = []; - - if (components.userinfo !== undefined) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - - if (components.host !== undefined) { - //normalize IP hosts, add brackets and escape zone separator for IPv6 - uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); - } - - if (typeof components.port === "number") { - uriTokens.push(":"); - uriTokens.push(components.port.toString(10)); - } - - return uriTokens.length ? uriTokens.join("") : undefined; -}; - -const RDS1 = /^\.\.?\//; -const RDS2 = /^\/\.(\/|$)/; -const RDS3 = /^\/\.\.(\/|$)/; -const RDS4 = /^\.\.?$/; -const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; - -export function removeDotSegments(input:string):string { - const output:Array = []; - - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } else if (input === "." || input === "..") { - input = ""; - } else { - const im = input.match(RDS5); - if (im) { - const s = im[0]; - input = input.slice(s.length); - output.push(s); - } else { - throw new Error("Unexpected dot segment condition"); - } - } - } - - return output.join(""); -}; - -export function serialize(components:URIComponents, options:URIOptions = {}):string { - const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); - const uriTokens:Array = []; - - //find scheme handler - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - - //perform scheme specific serialization - if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); - - if (components.host) { - //if host component is an IPv6 address - if (protocol.IPV6ADDRESS.test(components.host)) { - //TODO: normalize IPv6 address as per RFC 5952 - } - - //if host component is a domain name - else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { - //convert IDN via punycode - try { - components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - } - } - - //normalize encoding - _normalizeComponentEncoding(components, protocol); - - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme); - uriTokens.push(":"); - } - - const authority = _recomposeAuthority(components, options); - if (authority !== undefined) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - - uriTokens.push(authority); - - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - - if (components.path !== undefined) { - let s = components.path; - - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - - if (authority === undefined) { - s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" - } - - uriTokens.push(s); - } - - if (components.query !== undefined) { - uriTokens.push("?"); - uriTokens.push(components.query); - } - - if (components.fragment !== undefined) { - uriTokens.push("#"); - uriTokens.push(components.fragment); - } - - return uriTokens.join(""); //merge tokens into a string -}; - -export function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents { - const target:URIComponents = {}; - - if (!skipNormalization) { - base = parse(serialize(base, options), options); //normalize base components - relative = parse(serialize(relative, options), options); //normalize relative components - } - options = options || {}; - - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== undefined) { - target.query = relative.query; - } else { - target.query = base.query; - } - } else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } else { - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { - target.path = "/" + relative.path; - } else if (!base.path) { - target.path = relative.path; - } else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - //target.authority = base.authority; - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - - target.fragment = relative.fragment; - - return target; -}; - -export function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string { - const schemelessOptions = assign({ scheme : 'null' }, options); - return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); -}; - -export function normalize(uri:string, options?:URIOptions):string; -export function normalize(uri:URIComponents, options?:URIOptions):URIComponents; -export function normalize(uri:any, options?:URIOptions):any { - if (typeof uri === "string") { - uri = serialize(parse(uri, options), options); - } else if (typeOf(uri) === "object") { - uri = parse(serialize(uri, options), options); - } - - return uri; -}; - -export function equal(uriA:string, uriB:string, options?: URIOptions):boolean; -export function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean; -export function equal(uriA:any, uriB:any, options?:URIOptions):boolean { - if (typeof uriA === "string") { - uriA = serialize(parse(uriA, options), options); - } else if (typeOf(uriA) === "object") { - uriA = serialize(uriA, options); - } - - if (typeof uriB === "string") { - uriB = serialize(parse(uriB, options), options); - } else if (typeOf(uriB) === "object") { - uriB = serialize(uriB, options); - } - - return uriA === uriB; -}; - -export function escapeComponent(str:string, options?:URIOptions):string { - return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); -}; - -export function unescapeComponent(str:string, options?:URIOptions):string { - return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); -}; diff --git a/node_modules/uri-js/src/util.ts b/node_modules/uri-js/src/util.ts deleted file mode 100644 index 29c6d5d4db63a..0000000000000 --- a/node_modules/uri-js/src/util.ts +++ /dev/null @@ -1,40 +0,0 @@ -export function merge(...sets:Array):string { - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - const xl = sets.length - 1; - for (let x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } else { - return sets[0]; - } -} - -export function subexp(str:string):string { - return "(?:" + str + ")"; -} - -export function typeOf(o:any):string { - return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); -} - -export function toUpperCase(str:string):string { - return str.toUpperCase(); -} - -export function toArray(obj:any):Array { - return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; -} - - -export function assign(target: object, source: any): any { - const obj = target as any; - if (source) { - for (const key in source) { - obj[key] = source[key]; - } - } - return obj; -} \ No newline at end of file diff --git a/node_modules/uri-js/tests/qunit.css b/node_modules/uri-js/tests/qunit.css deleted file mode 100644 index a2e183d59874c..0000000000000 --- a/node_modules/uri-js/tests/qunit.css +++ /dev/null @@ -1,118 +0,0 @@ -ol#qunit-tests { - font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; - margin:0; - padding:0; - list-style-position:inside; - - font-size: smaller; -} -ol#qunit-tests li{ - padding:0.4em 0.5em 0.4em 2.5em; - border-bottom:1px solid #fff; - font-size:small; - list-style-position:inside; -} -ol#qunit-tests li ol{ - box-shadow: inset 0px 2px 13px #999; - -moz-box-shadow: inset 0px 2px 13px #999; - -webkit-box-shadow: inset 0px 2px 13px #999; - margin-top:0.5em; - margin-left:0; - padding:0.5em; - background-color:#fff; - border-radius:15px; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; -} -ol#qunit-tests li li{ - border-bottom:none; - margin:0.5em; - background-color:#fff; - list-style-position: inside; - padding:0.4em 0.5em 0.4em 0.5em; -} - -ol#qunit-tests li li.pass{ - border-left:26px solid #C6E746; - background-color:#fff; - color:#5E740B; - } -ol#qunit-tests li li.fail{ - border-left:26px solid #EE5757; - background-color:#fff; - color:#710909; -} -ol#qunit-tests li.pass{ - background-color:#D2E0E6; - color:#528CE0; -} -ol#qunit-tests li.fail{ - background-color:#EE5757; - color:#000; -} -ol#qunit-tests li strong { - cursor:pointer; -} -h1#qunit-header{ - background-color:#0d3349; - margin:0; - padding:0.5em 0 0.5em 1em; - color:#fff; - font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; - border-top-right-radius:15px; - border-top-left-radius:15px; - -moz-border-radius-topright:15px; - -moz-border-radius-topleft:15px; - -webkit-border-top-right-radius:15px; - -webkit-border-top-left-radius:15px; - text-shadow: rgba(0, 0, 0, 0.5) 4px 4px 1px; -} -h2#qunit-banner{ - font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; - height:5px; - margin:0; - padding:0; -} -h2#qunit-banner.qunit-pass{ - background-color:#C6E746; -} -h2#qunit-banner.qunit-fail, #qunit-testrunner-toolbar { - background-color:#EE5757; -} -#qunit-testrunner-toolbar { - font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; - padding:0; - /*width:80%;*/ - padding:0em 0 0.5em 2em; - font-size: small; -} -h2#qunit-userAgent { - font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; - background-color:#2b81af; - margin:0; - padding:0; - color:#fff; - font-size: small; - padding:0.5em 0 0.5em 2.5em; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} -p#qunit-testresult{ - font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; - margin:0; - font-size: small; - color:#2b81af; - border-bottom-right-radius:15px; - border-bottom-left-radius:15px; - -moz-border-radius-bottomright:15px; - -moz-border-radius-bottomleft:15px; - -webkit-border-bottom-right-radius:15px; - -webkit-border-bottom-left-radius:15px; - background-color:#D2E0E6; - padding:0.5em 0.5em 0.5em 2.5em; -} -strong b.fail{ - color:#710909; - } -strong b.pass{ - color:#5E740B; - } \ No newline at end of file diff --git a/node_modules/uri-js/tests/qunit.js b/node_modules/uri-js/tests/qunit.js deleted file mode 100644 index e449fdf8721ef..0000000000000 --- a/node_modules/uri-js/tests/qunit.js +++ /dev/null @@ -1,1042 +0,0 @@ -/* - * QUnit - A JavaScript Unit Testing Framework - * - * http://docs.jquery.com/QUnit - * - * Copyright (c) 2009 John Resig, Jörn Zaefferer - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - */ - -(function(window) { - -var QUnit = { - - // Initialize the configuration options - init: function() { - config = { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date, - blocking: false, - autorun: false, - assertions: [], - filters: [], - queue: [] - }; - - var tests = id("qunit-tests"), - banner = id("qunit-banner"), - result = id("qunit-testresult"); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - }, - - // call on start of module test to prepend name to all tests - module: function(name, testEnvironment) { - config.currentModule = name; - - synchronize(function() { - if ( config.currentModule ) { - QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); - } - - config.currentModule = name; - config.moduleTestEnvironment = testEnvironment; - config.moduleStats = { all: 0, bad: 0 }; - - QUnit.moduleStart( name, testEnvironment ); - }); - }, - - asyncTest: function(testName, expected, callback) { - if ( arguments.length === 2 ) { - callback = expected; - expected = 0; - } - - QUnit.test(testName, expected, callback, true); - }, - - test: function(testName, expected, callback, async) { - var name = testName, testEnvironment, testEnvironmentArg; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - // is 2nd argument a testEnvironment? - if ( expected && typeof expected === 'object') { - testEnvironmentArg = expected; - expected = null; - } - - if ( config.currentModule ) { - name = config.currentModule + " module: " + name; - } - - if ( !validTest(name) ) { - return; - } - - synchronize(function() { - QUnit.testStart( testName ); - - testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, config.moduleTestEnvironment); - if (testEnvironmentArg) { - extend(testEnvironment,testEnvironmentArg); - } - - // allow utility functions to access the current test environment - QUnit.current_testEnvironment = testEnvironment; - - config.assertions = []; - config.expected = expected; - - try { - if ( !config.pollution ) { - saveGlobal(); - } - - testEnvironment.setup.call(testEnvironment); - } catch(e) { - QUnit.ok( false, "Setup failed on " + name + ": " + e.message ); - } - - if ( async ) { - QUnit.stop(); - } - - try { - callback.call(testEnvironment); - } catch(e) { - fail("Test " + name + " died, exception and test follows", e, callback); - QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - start(); - } - } - }); - - synchronize(function() { - try { - checkPollution(); - testEnvironment.teardown.call(testEnvironment); - } catch(e) { - QUnit.ok( false, "Teardown failed on " + name + ": " + e.message ); - } - - try { - QUnit.reset(); - } catch(e) { - fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset); - } - - if ( config.expected && config.expected != config.assertions.length ) { - QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" ); - } - - var good = 0, bad = 0, - tests = id("qunit-tests"); - - config.stats.all += config.assertions.length; - config.moduleStats.all += config.assertions.length; - - if ( tests ) { - var ol = document.createElement("ol"); - ol.style.display = "none"; - - for ( var i = 0; i < config.assertions.length; i++ ) { - var assertion = config.assertions[i]; - - var li = document.createElement("li"); - li.className = assertion.result ? "pass" : "fail"; - li.appendChild(document.createTextNode(assertion.message || "(no message)")); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - var b = document.createElement("strong"); - b.innerHTML = name + " (" + bad + ", " + good + ", " + config.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.nextSibling, display = next.style.display; - next.style.display = display === "none" ? "block" : "none"; - }); - - addEvent(b, "dblclick", function(e) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() === "strong" ) { - var text = "", node = target.firstChild; - - while ( node.nodeType === 3 ) { - text += node.nodeValue; - node = node.nextSibling; - } - - text = text.replace(/(^\s*|\s*$)/g, ""); - - if ( window.location ) { - window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text); - } - } - }); - - var li = document.createElement("li"); - li.className = bad ? "fail" : "pass"; - li.appendChild( b ); - li.appendChild( ol ); - tests.appendChild( li ); - - if ( bad ) { - var toolbar = id("qunit-testrunner-toolbar"); - if ( toolbar ) { - toolbar.style.display = "block"; - id("qunit-filter-pass").disabled = null; - id("qunit-filter-missing").disabled = null; - } - } - - } else { - for ( var i = 0; i < config.assertions.length; i++ ) { - if ( !config.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - QUnit.testDone( testName, bad, config.assertions.length ); - - if ( !window.setTimeout && !config.queue.length ) { - done(); - } - }); - - if ( window.setTimeout && !config.doneTimer ) { - config.doneTimer = window.setTimeout(function(){ - if ( !config.queue.length ) { - done(); - } else { - synchronize( done ); - } - }, 13); - } - }, - - /** - * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - */ - expect: function(asserts) { - config.expected = asserts; - }, - - /** - * Asserts true. - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function(a, msg) { - QUnit.log(a, msg); - - config.assertions.push({ - result: !!a, - message: msg - }); - }, - - /** - * Checks that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * - * Prefered to ok( actual == expected, message ) - * - * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." ); - * - * @param Object actual - * @param Object expected - * @param String message (optional) - */ - equal: function(actual, expected, message) { - push(expected == actual, actual, expected, message); - }, - - notEqual: function(actual, expected, message) { - push(expected != actual, actual, expected, message); - }, - - deepEqual: function(a, b, message) { - push(QUnit.equiv(a, b), a, b, message); - }, - - notDeepEqual: function(a, b, message) { - push(!QUnit.equiv(a, b), a, b, message); - }, - - strictEqual: function(actual, expected, message) { - push(expected === actual, actual, expected, message); - }, - - notStrictEqual: function(actual, expected, message) { - push(expected !== actual, actual, expected, message); - }, - - start: function() { - // A slight delay, to avoid any current callbacks - if ( window.setTimeout ) { - window.setTimeout(function() { - if ( config.timeout ) { - clearTimeout(config.timeout); - } - - config.blocking = false; - process(); - }, 13); - } else { - config.blocking = false; - process(); - } - }, - - stop: function(timeout) { - config.blocking = true; - - if ( timeout && window.setTimeout ) { - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - QUnit.start(); - }, timeout); - } - }, - - /** - * Resets the test setup. Useful for tests that modify the DOM. - */ - reset: function() { - if ( window.jQuery ) { - jQuery("#main").html( config.fixture ); - jQuery.event.global = {}; - jQuery.ajaxSettings = extend({}, config.ajaxSettings); - } - }, - - /** - * Trigger an event on an element. - * - * @example triggerEvent( document.body, "click" ); - * - * @param DOMElement elem - * @param String type - */ - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent("MouseEvents"); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - elem.dispatchEvent( event ); - - } else if ( elem.fireEvent ) { - elem.fireEvent("on"+type); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return Object.prototype.toString.call( obj ) === "[object "+ type +"]"; - }, - - // Logging callbacks - done: function(failures, total) {}, - log: function(result, message) {}, - testStart: function(name) {}, - testDone: function(name, failures, total) {}, - moduleStart: function(name, testEnvironment) {}, - moduleDone: function(name, failures, total) {} -}; - -// Backwards compatibility, deprecated -QUnit.equals = QUnit.equal; -QUnit.same = QUnit.deepEqual; - -// Maintain internal state -var config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true -}; - -// Load paramaters -(function() { - var location = window.location || { search: "", protocol: "file:" }, - GETParams = location.search.slice(1).split('&'); - - for ( var i = 0; i < GETParams.length; i++ ) { - GETParams[i] = decodeURIComponent( GETParams[i] ); - if ( GETParams[i] === "noglobals" ) { - GETParams.splice( i, 1 ); - i--; - config.noglobals = true; - } else if ( GETParams[i].search('=') > -1 ) { - GETParams.splice( i, 1 ); - i--; - } - } - - // restrict modules/tests by get parameters - config.filters = GETParams; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = !!(location.protocol === 'file:'); -})(); - -// Expose the API as global variables, unless an 'exports' -// object exists, in that case we assume we're in CommonJS -if ( typeof exports === "undefined" || typeof require === "undefined" ) { - extend(window, QUnit); - window.QUnit = QUnit; -} else { - extend(exports, QUnit); - exports.QUnit = QUnit; -} - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -addEvent(window, "load", function() { - // Initialize the config, saving the execution queue - var oldconfig = extend({}, config); - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - var userAgent = id("qunit-userAgent"); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - var toolbar = id("qunit-testrunner-toolbar"); - if ( toolbar ) { - toolbar.style.display = "none"; - - var filter = document.createElement("input"); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - filter.disabled = true; - addEvent( filter, "click", function() { - var li = document.getElementsByTagName("li"); - for ( var i = 0; i < li.length; i++ ) { - if ( li[i].className.indexOf("pass") > -1 ) { - li[i].style.display = filter.checked ? "none" : ""; - } - } - }); - toolbar.appendChild( filter ); - - var label = document.createElement("label"); - label.setAttribute("for", "qunit-filter-pass"); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - var missing = document.createElement("input"); - missing.type = "checkbox"; - missing.id = "qunit-filter-missing"; - missing.disabled = true; - addEvent( missing, "click", function() { - var li = document.getElementsByTagName("li"); - for ( var i = 0; i < li.length; i++ ) { - if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) { - li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block"; - } - } - }); - toolbar.appendChild( missing ); - - label = document.createElement("label"); - label.setAttribute("for", "qunit-filter-missing"); - label.innerHTML = "Hide missing tests (untested code is broken code)"; - toolbar.appendChild( label ); - } - - var main = id('main'); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( window.jQuery ) { - config.ajaxSettings = window.jQuery.ajaxSettings; - } - - QUnit.start(); -}); - -function done() { - if ( config.doneTimer && window.clearTimeout ) { - window.clearTimeout( config.doneTimer ); - config.doneTimer = null; - } - - if ( config.queue.length ) { - config.doneTimer = window.setTimeout(function(){ - if ( !config.queue.length ) { - done(); - } else { - synchronize( done ); - } - }, 13); - - return; - } - - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); - } - - var banner = id("qunit-banner"), - tests = id("qunit-tests"), - html = ['Tests completed in ', - +new Date - config.started, ' milliseconds.
', - '', config.stats.all - config.stats.bad, ' tests of ', config.stats.all, ' passed, ', config.stats.bad,' failed.'].join(''); - - if ( banner ) { - banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass"); - } - - if ( tests ) { - var result = id("qunit-testresult"); - - if ( !result ) { - result = document.createElement("p"); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests.nextSibling ); - } - - result.innerHTML = html; - } - - QUnit.done( config.stats.bad, config.stats.all ); -} - -function validTest( name ) { - var i = config.filters.length, - run = false; - - if ( !i ) { - return true; - } - - while ( i-- ) { - var filter = config.filters[i], - not = filter.charAt(0) == '!'; - - if ( not ) { - filter = filter.slice(1); - } - - if ( name.indexOf(filter) !== -1 ) { - return !not; - } - - if ( not ) { - run = true; - } - } - - return run; -} - -function push(result, actual, expected, message) { - message = message || (result ? "okay" : "failed"); - QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) ); -} - -function synchronize( callback ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process(); - } -} - -function process() { - while ( config.queue.length && !config.blocking ) { - config.queue.shift()(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - config.pollution.push( key ); - } - } -} - -function checkPollution( name ) { - var old = config.pollution; - saveGlobal(); - - var newGlobals = diff( old, config.pollution ); - if ( newGlobals.length > 0 ) { - ok( false, "Introduced global variable(s): " + newGlobals.join(", ") ); - config.expected++; - } - - var deletedGlobals = diff( config.pollution, old ); - if ( deletedGlobals.length > 0 ) { - ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") ); - config.expected++; - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var result = a.slice(); - for ( var i = 0; i < result.length; i++ ) { - for ( var j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice(i, 1); - i--; - break; - } - } - } - return result; -} - -function fail(message, exception, callback) { - if ( typeof console !== "undefined" && console.error && console.warn ) { - console.error(message); - console.error(exception); - console.warn(callback.toString()); - - } else if ( window.opera && opera.postError ) { - opera.postError(message, exception, callback.toString); - } -} - -function extend(a, b) { - for ( var prop in b ) { - a[prop] = b[prop]; - } - - return a; -} - -function addEvent(elem, type, fn) { - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, fn ); - } else { - fn(); - } -} - -function id(name) { - return !!(typeof document !== "undefined" && document && document.getElementById) && - document.getElementById( name ); -} - -// Test for equality any JavaScript type. -// Discussions and reference: http://philrathe.com/articles/equiv -// Test suites: http://philrathe.com/tests/equiv -// Author: Philippe Rathé -QUnit.equiv = function () { - - var innerEquiv; // the real equiv function - var callers = []; // stack to decide between skip/abort functions - - - // Determine what is o. - function hoozit(o) { - if (QUnit.is("String", o)) { - return "string"; - - } else if (QUnit.is("Boolean", o)) { - return "boolean"; - - } else if (QUnit.is("Number", o)) { - - if (isNaN(o)) { - return "nan"; - } else { - return "number"; - } - - } else if (typeof o === "undefined") { - return "undefined"; - - // consider: typeof null === object - } else if (o === null) { - return "null"; - - // consider: typeof [] === object - } else if (QUnit.is( "Array", o)) { - return "array"; - - // consider: typeof new Date() === object - } else if (QUnit.is( "Date", o)) { - return "date"; - - // consider: /./ instanceof Object; - // /./ instanceof RegExp; - // typeof /./ === "function"; // => false in IE and Opera, - // true in FF and Safari - } else if (QUnit.is( "RegExp", o)) { - return "regexp"; - - } else if (typeof o === "object") { - return "object"; - - } else if (QUnit.is( "Function", o)) { - return "function"; - } else { - return undefined; - } - } - - // Call the o related callback with the given arguments. - function bindCallbacks(o, callbacks, args) { - var prop = hoozit(o); - if (prop) { - if (hoozit(callbacks[prop]) === "function") { - return callbacks[prop].apply(callbacks, args); - } else { - return callbacks[prop]; // or undefined - } - } - } - - var callbacks = function () { - - // for string, boolean, number and null - function useStrictEquality(b, a) { - if (b instanceof a.constructor || a instanceof b.constructor) { - // to catch short annotaion VS 'new' annotation of a declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function (b) { - return isNaN(b); - }, - - "date": function (b, a) { - return hoozit(b) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function (b, a) { - return hoozit(b) === "regexp" && - a.source === b.source && // the regex itself - a.global === b.global && // and its modifers (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function () { - var caller = callers[callers.length - 1]; - return caller !== Object && - typeof caller !== "undefined"; - }, - - "array": function (b, a) { - var i; - var len; - - // b could be an object literal here - if ( ! (hoozit(b) === "array")) { - return false; - } - - len = a.length; - if (len !== b.length) { // safe and faster - return false; - } - for (i = 0; i < len; i++) { - if ( ! innerEquiv(a[i], b[i])) { - return false; - } - } - return true; - }, - - "object": function (b, a) { - var i; - var eq = true; // unless we can proove it - var aProperties = [], bProperties = []; // collection of strings - - // comparing constructors is more strict than using instanceof - if ( a.constructor !== b.constructor) { - return false; - } - - // stack constructor before traversing properties - callers.push(a.constructor); - - for (i in a) { // be strict: don't ensures hasOwnProperty and go deep - - aProperties.push(i); // collect a's properties - - if ( ! innerEquiv(a[i], b[i])) { - eq = false; - } - } - - callers.pop(); // unstack, we are done - - for (i in b) { - bProperties.push(i); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv(aProperties.sort(), bProperties.sort()); - } - }; - }(); - - innerEquiv = function () { // can take multiple arguments - var args = Array.prototype.slice.apply(arguments); - if (args.length < 2) { - return true; // end transition - } - - return (function (a, b) { - if (a === b) { - return true; // catch the most you can - } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [b, a]); - } - - // apply transition with (1..n) arguments - })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1)); - }; - - return innerEquiv; - -}(); - -/** - * jsDump - * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com - * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php) - * Date: 5/15/2008 - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace(/"/g, '\\"') + '"'; - }; - function literal( o ) { - return o + ''; - }; - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) - arr = arr.join( ',' + s + inner ); - if ( !arr ) - return pre + post; - return [ pre, inner + arr, base + post ].join(s); - }; - function array( arr ) { - var i = arr.length, ret = Array(i); - this.up(); - while ( i-- ) - ret[i] = this.parse( arr[i] ); - this.down(); - return join( '[', ret, ']' ); - }; - - var reName = /^function (\w+)/; - - var jsDump = { - parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance - var parser = this.parsers[ type || this.typeOf(obj) ]; - type = typeof parser; - - return type == 'function' ? parser.call( this, obj ) : - type == 'string' ? parser : - this.parsers.error; - }, - typeOf:function( obj ) { - var type; - if ( obj === null ) { - type = "null"; - } else if (typeof obj === "undefined") { - type = "undefined"; - } else if (QUnit.is("RegExp", obj)) { - type = "regexp"; - } else if (QUnit.is("Date", obj)) { - type = "date"; - } else if (QUnit.is("Function", obj)) { - type = "function"; - } else if (QUnit.is("Array", obj)) { - type = "array"; - } else if (QUnit.is("Window", obj) || QUnit.is("global", obj)) { - type = "window"; - } else if (QUnit.is("HTMLDocument", obj)) { - type = "document"; - } else if (QUnit.is("HTMLCollection", obj) || QUnit.is("NodeList", obj)) { - type = "nodelist"; - } else if (/^\[object HTML/.test(Object.prototype.toString.call( obj ))) { - type = "node"; - } else { - type = typeof obj; - } - return type; - }, - separator:function() { - return this.multiline ? this.HTML ? '
' : '\n' : this.HTML ? ' ' : ' '; - }, - indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing - if ( !this.multiline ) - return ''; - var chr = this.indentChar; - if ( this.HTML ) - chr = chr.replace(/\t/g,' ').replace(/ /g,' '); - return Array( this._depth_ + (extra||0) ).join(chr); - }, - up:function( a ) { - this._depth_ += a || 1; - }, - down:function( a ) { - this._depth_ -= a || 1; - }, - setParser:function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote:quote, - literal:literal, - join:join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers:{ - window: '[Window]', - document: '[Document]', - error:'[ERROR]', //when no parser is found, shouldn't happen - unknown: '[Unknown]', - 'null':'null', - undefined:'undefined', - 'function':function( fn ) { - var ret = 'function', - name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE - if ( name ) - ret += ' ' + name; - ret += '('; - - ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join(''); - return join( ret, this.parse(fn,'functionCode'), '}' ); - }, - array: array, - nodelist: array, - arguments: array, - object:function( map ) { - var ret = [ ]; - this.up(); - for ( var key in map ) - ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) ); - this.down(); - return join( '{', ret, '}' ); - }, - node:function( node ) { - var open = this.HTML ? '<' : '<', - close = this.HTML ? '>' : '>'; - - var tag = node.nodeName.toLowerCase(), - ret = open + tag; - - for ( var a in this.DOMAttrs ) { - var val = node[this.DOMAttrs[a]]; - if ( val ) - ret += ' ' + a + '=' + this.parse( val, 'attribute' ); - } - return ret + close + open + '/' + tag + close; - }, - functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function - var l = fn.length; - if ( !l ) return ''; - - var args = Array(l); - while ( l-- ) - args[l] = String.fromCharCode(97+l);//97 is 'a' - return ' ' + args.join(', ') + ' '; - }, - key:quote, //object calls it internally, the key part of an item in a map - functionCode:'[code]', //function calls it internally, it's the content of the function - attribute:quote, //node calls it internally, it's an html attribute value - string:quote, - date:quote, - regexp:literal, //regex - number:literal, - 'boolean':literal - }, - DOMAttrs:{//attributes to dump from nodes, name=>realName - id:'id', - name:'name', - 'class':'className' - }, - HTML:true,//if true, entities are escaped ( <, >, \t, space and \n ) - indentChar:' ',//indentation unit - multiline:true //if true, items in a collection, are separated by a \n, else just a space. - }; - - return jsDump; -})(); - -})(this); diff --git a/node_modules/uri-js/tests/test-es5-min.html b/node_modules/uri-js/tests/test-es5-min.html deleted file mode 100644 index b841c7577eab5..0000000000000 --- a/node_modules/uri-js/tests/test-es5-min.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - -

URI.js Test Suite

-

-
-

-
    - - diff --git a/node_modules/uri-js/tests/test-es5.html b/node_modules/uri-js/tests/test-es5.html deleted file mode 100644 index 2d89c66b6d1c8..0000000000000 --- a/node_modules/uri-js/tests/test-es5.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - -

    URI.js Test Suite

    -

    -
    -

    -
      - - diff --git a/node_modules/uri-js/tests/tests.js b/node_modules/uri-js/tests/tests.js deleted file mode 100644 index 624191cedec14..0000000000000 --- a/node_modules/uri-js/tests/tests.js +++ /dev/null @@ -1,774 +0,0 @@ -// -// -// Tests -// -// - -if (typeof URI === "undefined") { - var URI = require("../dist/es5/uri.all"); -} - -test("Acquire URI", function () { - //URI = require("./uri").URI; - ok(URI); -}); - -test("URI Parsing", function () { - var components; - - //scheme - components = URI.parse("uri:"); - strictEqual(components.error, undefined, "scheme errors"); - strictEqual(components.scheme, "uri", "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //userinfo - components = URI.parse("//@"); - strictEqual(components.error, undefined, "userinfo errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, "@", "authority"); - strictEqual(components.userinfo, "", "userinfo"); - strictEqual(components.host, "", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //host - components = URI.parse("//"); - strictEqual(components.error, undefined, "host errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, "", "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //port - components = URI.parse("//:"); - strictEqual(components.error, undefined, "port errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, ":", "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "", "host"); - strictEqual(components.port, "", "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //path - components = URI.parse(""); - strictEqual(components.error, undefined, "path errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //query - components = URI.parse("?"); - strictEqual(components.error, undefined, "query errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, "", "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //fragment - components = URI.parse("#"); - strictEqual(components.error, undefined, "fragment errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, "", "fragment"); - - //fragment with character tabulation - components = URI.parse("#\t"); - strictEqual(components.error, undefined, "path errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, "%09", "fragment"); - - //fragment with line feed - components = URI.parse("#\n"); - strictEqual(components.error, undefined, "path errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, "%0A", "fragment"); - - //fragment with line tabulation - components = URI.parse("#\v"); - strictEqual(components.error, undefined, "path errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, "%0B", "fragment"); - - //fragment with form feed - components = URI.parse("#\f"); - strictEqual(components.error, undefined, "path errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, "%0C", "fragment"); - - //fragment with carriage return - components = URI.parse("#\r"); - strictEqual(components.error, undefined, "path errors"); - strictEqual(components.scheme, undefined, "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, "%0D", "fragment"); - - //all - components = URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); - strictEqual(components.error, undefined, "all errors"); - strictEqual(components.scheme, "uri", "scheme"); - //strictEqual(components.authority, "user:pass@example.com:123", "authority"); - strictEqual(components.userinfo, "user:pass", "userinfo"); - strictEqual(components.host, "example.com", "host"); - strictEqual(components.port, 123, "port"); - strictEqual(components.path, "/one/two.three", "path"); - strictEqual(components.query, "q1=a1&q2=a2", "query"); - strictEqual(components.fragment, "body", "fragment"); - - //IPv4address - components = URI.parse("//10.10.10.10"); - strictEqual(components.error, undefined, "IPv4address errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "10.10.10.10", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //IPv6address - components = URI.parse("//[2001:db8::7]"); - strictEqual(components.error, undefined, "IPv4address errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "2001:db8::7", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //mixed IPv4address & IPv6address - components = URI.parse("//[::ffff:129.144.52.38]"); - strictEqual(components.error, undefined, "IPv4address errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "::ffff:129.144.52.38", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4) - components = URI.parse("uri://10.10.10.10.example.com/en/process"); - strictEqual(components.error, undefined, "mixed errors"); - strictEqual(components.scheme, "uri", "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "10.10.10.10.example.com", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "/en/process", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16) - components = URI.parse("//[2606:2800:220:1:248:1893:25c8:1946]/test"); - strictEqual(components.error, undefined, "IPv6address errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "2606:2800:220:1:248:1893:25c8:1946", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "/test", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //IPv6address, example from RFC 5952 - components = URI.parse("//[2001:db8::1]:80"); - strictEqual(components.error, undefined, "IPv6address errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "2001:db8::1", "host"); - strictEqual(components.port, 80, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //IPv6address with zone identifier, RFC 6874 - components = URI.parse("//[fe80::a%25en1]"); - strictEqual(components.error, undefined, "IPv4address errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "fe80::a%en1", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - - //IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22) - components = URI.parse("//[2001:db8::7%en0]"); - strictEqual(components.error, undefined, "IPv6address interface errors"); - strictEqual(components.scheme, undefined, "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, "2001:db8::7%en0", "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, "", "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); -}); - -test("URI Serialization", function () { - var components = { - scheme : undefined, - userinfo : undefined, - host : undefined, - port : undefined, - path : undefined, - query : undefined, - fragment : undefined - }; - strictEqual(URI.serialize(components), "", "Undefined Components"); - - components = { - scheme : "", - userinfo : "", - host : "", - port : 0, - path : "", - query : "", - fragment : "" - }; - strictEqual(URI.serialize(components), "//@:0?#", "Empty Components"); - - components = { - scheme : "uri", - userinfo : "foo:bar", - host : "example.com", - port : 1, - path : "path", - query : "query", - fragment : "fragment" - }; - strictEqual(URI.serialize(components), "uri://foo:bar@example.com:1/path?query#fragment", "All Components"); - - strictEqual(URI.serialize({path:"//path"}), "/%2Fpath", "Double slash path"); - strictEqual(URI.serialize({path:"foo:bar"}), "foo%3Abar", "Colon path"); - strictEqual(URI.serialize({path:"?query"}), "%3Fquery", "Query path"); - - //mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4) - strictEqual(URI.serialize({host:"10.10.10.10.example.com"}), "//10.10.10.10.example.com", "Mixed IPv4address & reg-name"); - - //IPv6address - strictEqual(URI.serialize({host:"2001:db8::7"}), "//[2001:db8::7]", "IPv6 Host"); - strictEqual(URI.serialize({host:"::ffff:129.144.52.38"}), "//[::ffff:129.144.52.38]", "IPv6 Mixed Host"); - strictEqual(URI.serialize({host:"2606:2800:220:1:248:1893:25c8:1946"}), "//[2606:2800:220:1:248:1893:25c8:1946]", "IPv6 Full Host"); - - //IPv6address with zone identifier, RFC 6874 - strictEqual(URI.serialize({host:"fe80::a%en1"}), "//[fe80::a%25en1]", "IPv6 Zone Unescaped Host"); - strictEqual(URI.serialize({host:"fe80::a%25en1"}), "//[fe80::a%25en1]", "IPv6 Zone Escaped Host"); -}); - -test("URI Resolving", function () { - //normal examples from RFC 3986 - var base = "uri://a/b/c/d;p?q"; - strictEqual(URI.resolve(base, "g:h"), "g:h", "g:h"); - strictEqual(URI.resolve(base, "g:h"), "g:h", "g:h"); - strictEqual(URI.resolve(base, "g"), "uri://a/b/c/g", "g"); - strictEqual(URI.resolve(base, "./g"), "uri://a/b/c/g", "./g"); - strictEqual(URI.resolve(base, "g/"), "uri://a/b/c/g/", "g/"); - strictEqual(URI.resolve(base, "/g"), "uri://a/g", "/g"); - strictEqual(URI.resolve(base, "//g"), "uri://g", "//g"); - strictEqual(URI.resolve(base, "?y"), "uri://a/b/c/d;p?y", "?y"); - strictEqual(URI.resolve(base, "g?y"), "uri://a/b/c/g?y", "g?y"); - strictEqual(URI.resolve(base, "#s"), "uri://a/b/c/d;p?q#s", "#s"); - strictEqual(URI.resolve(base, "g#s"), "uri://a/b/c/g#s", "g#s"); - strictEqual(URI.resolve(base, "g?y#s"), "uri://a/b/c/g?y#s", "g?y#s"); - strictEqual(URI.resolve(base, ";x"), "uri://a/b/c/;x", ";x"); - strictEqual(URI.resolve(base, "g;x"), "uri://a/b/c/g;x", "g;x"); - strictEqual(URI.resolve(base, "g;x?y#s"), "uri://a/b/c/g;x?y#s", "g;x?y#s"); - strictEqual(URI.resolve(base, ""), "uri://a/b/c/d;p?q", ""); - strictEqual(URI.resolve(base, "."), "uri://a/b/c/", "."); - strictEqual(URI.resolve(base, "./"), "uri://a/b/c/", "./"); - strictEqual(URI.resolve(base, ".."), "uri://a/b/", ".."); - strictEqual(URI.resolve(base, "../"), "uri://a/b/", "../"); - strictEqual(URI.resolve(base, "../g"), "uri://a/b/g", "../g"); - strictEqual(URI.resolve(base, "../.."), "uri://a/", "../.."); - strictEqual(URI.resolve(base, "../../"), "uri://a/", "../../"); - strictEqual(URI.resolve(base, "../../g"), "uri://a/g", "../../g"); - - //abnormal examples from RFC 3986 - strictEqual(URI.resolve(base, "../../../g"), "uri://a/g", "../../../g"); - strictEqual(URI.resolve(base, "../../../../g"), "uri://a/g", "../../../../g"); - - strictEqual(URI.resolve(base, "/./g"), "uri://a/g", "/./g"); - strictEqual(URI.resolve(base, "/../g"), "uri://a/g", "/../g"); - strictEqual(URI.resolve(base, "g."), "uri://a/b/c/g.", "g."); - strictEqual(URI.resolve(base, ".g"), "uri://a/b/c/.g", ".g"); - strictEqual(URI.resolve(base, "g.."), "uri://a/b/c/g..", "g.."); - strictEqual(URI.resolve(base, "..g"), "uri://a/b/c/..g", "..g"); - - strictEqual(URI.resolve(base, "./../g"), "uri://a/b/g", "./../g"); - strictEqual(URI.resolve(base, "./g/."), "uri://a/b/c/g/", "./g/."); - strictEqual(URI.resolve(base, "g/./h"), "uri://a/b/c/g/h", "g/./h"); - strictEqual(URI.resolve(base, "g/../h"), "uri://a/b/c/h", "g/../h"); - strictEqual(URI.resolve(base, "g;x=1/./y"), "uri://a/b/c/g;x=1/y", "g;x=1/./y"); - strictEqual(URI.resolve(base, "g;x=1/../y"), "uri://a/b/c/y", "g;x=1/../y"); - - strictEqual(URI.resolve(base, "g?y/./x"), "uri://a/b/c/g?y/./x", "g?y/./x"); - strictEqual(URI.resolve(base, "g?y/../x"), "uri://a/b/c/g?y/../x", "g?y/../x"); - strictEqual(URI.resolve(base, "g#s/./x"), "uri://a/b/c/g#s/./x", "g#s/./x"); - strictEqual(URI.resolve(base, "g#s/../x"), "uri://a/b/c/g#s/../x", "g#s/../x"); - - strictEqual(URI.resolve(base, "uri:g"), "uri:g", "uri:g"); - strictEqual(URI.resolve(base, "uri:g", {tolerant:true}), "uri://a/b/c/g", "uri:g"); - - //examples by PAEz - strictEqual(URI.resolve("//www.g.com/","/adf\ngf"), "//www.g.com/adf%0Agf", "/adf\\ngf"); - strictEqual(URI.resolve("//www.g.com/error\n/bleh/bleh",".."), "//www.g.com/error%0A/", "//www.g.com/error\\n/bleh/bleh"); -}); - -test("URI Normalizing", function () { - //test from RFC 3987 - strictEqual(URI.normalize("uri://www.example.org/red%09ros\xE9#red"), "uri://www.example.org/red%09ros%C3%A9#red"); - - //IPv4address - strictEqual(URI.normalize("//192.068.001.000"), "//192.68.1.0"); - - //IPv6address, example from RFC 3513 - strictEqual(URI.normalize("http://[1080::8:800:200C:417A]/"), "http://[1080::8:800:200c:417a]/"); - - //IPv6address, examples from RFC 5952 - strictEqual(URI.normalize("//[2001:0db8::0001]/"), "//[2001:db8::1]/"); - strictEqual(URI.normalize("//[2001:db8::1:0000:1]/"), "//[2001:db8::1:0:1]/"); - strictEqual(URI.normalize("//[2001:db8:0:0:0:0:2:1]/"), "//[2001:db8::2:1]/"); - strictEqual(URI.normalize("//[2001:db8:0:1:1:1:1:1]/"), "//[2001:db8:0:1:1:1:1:1]/"); - strictEqual(URI.normalize("//[2001:0:0:1:0:0:0:1]/"), "//[2001:0:0:1::1]/"); - strictEqual(URI.normalize("//[2001:db8:0:0:1:0:0:1]/"), "//[2001:db8::1:0:0:1]/"); - strictEqual(URI.normalize("//[2001:DB8::1]/"), "//[2001:db8::1]/"); - strictEqual(URI.normalize("//[0:0:0:0:0:ffff:192.0.2.1]/"), "//[::ffff:192.0.2.1]/"); - - //Mixed IPv4 and IPv6 address - strictEqual(URI.normalize("//[1:2:3:4:5:6:192.0.2.1]/"), "//[1:2:3:4:5:6:192.0.2.1]/"); - strictEqual(URI.normalize("//[1:2:3:4:5:6:192.068.001.000]/"), "//[1:2:3:4:5:6:192.68.1.0]/"); -}); - -test("URI Equals", function () { - //test from RFC 3986 - strictEqual(URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d"), true); - - //test from RFC 3987 - strictEqual(URI.equal("http://example.org/~user", "http://example.org/%7euser"), true); -}); - -test("Escape Component", function () { - var chr; - for (var d = 0; d <= 129; ++d) { - chr = String.fromCharCode(d); - if (!chr.match(/[\$\&\+\,\;\=]/)) { - strictEqual(URI.escapeComponent(chr), encodeURIComponent(chr)); - } else { - strictEqual(URI.escapeComponent(chr), chr); - } - } - strictEqual(URI.escapeComponent("\u00c0"), encodeURIComponent("\u00c0")); - strictEqual(URI.escapeComponent("\u07ff"), encodeURIComponent("\u07ff")); - strictEqual(URI.escapeComponent("\u0800"), encodeURIComponent("\u0800")); - strictEqual(URI.escapeComponent("\u30a2"), encodeURIComponent("\u30a2")); -}); - -test("Unescape Component", function () { - var chr; - for (var d = 0; d <= 129; ++d) { - chr = String.fromCharCode(d); - strictEqual(URI.unescapeComponent(encodeURIComponent(chr)), chr); - } - strictEqual(URI.unescapeComponent(encodeURIComponent("\u00c0")), "\u00c0"); - strictEqual(URI.unescapeComponent(encodeURIComponent("\u07ff")), "\u07ff"); - strictEqual(URI.unescapeComponent(encodeURIComponent("\u0800")), "\u0800"); - strictEqual(URI.unescapeComponent(encodeURIComponent("\u30a2")), "\u30a2"); -}); - -// -// IRI -// - - - -var IRI_OPTION = { iri : true, unicodeSupport : true }; - -test("IRI Parsing", function () { - var components = URI.parse("uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy", IRI_OPTION); - strictEqual(components.error, undefined, "all errors"); - strictEqual(components.scheme, "uri", "scheme"); - //strictEqual(components.authority, "us\xA0er:pa\uD7FFss@example.com:123", "authority"); - strictEqual(components.userinfo, "us\xA0er:pa\uD7FFss", "userinfo"); - strictEqual(components.host, "example.com", "host"); - strictEqual(components.port, 123, "port"); - strictEqual(components.path, "/o\uF900ne/t\uFDCFwo.t\uFDF0hree", "path"); - strictEqual(components.query, "q1=a1\uF8FF\uE000&q2=a2", "query"); - strictEqual(components.fragment, "bo\uFFEFdy", "fragment"); -}); - -test("IRI Serialization", function () { - var components = { - scheme : "uri", - userinfo : "us\xA0er:pa\uD7FFss", - host : "example.com", - port : 123, - path : "/o\uF900ne/t\uFDCFwo.t\uFDF0hree", - query : "q1=a1\uF8FF\uE000&q2=a2", - fragment : "bo\uFFEFdy\uE001" - }; - strictEqual(URI.serialize(components, IRI_OPTION), "uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy%EE%80%81"); -}); - -test("IRI Normalizing", function () { - strictEqual(URI.normalize("uri://www.example.org/red%09ros\xE9#red", IRI_OPTION), "uri://www.example.org/red%09ros\xE9#red"); -}); - -test("IRI Equals", function () { - //example from RFC 3987 - strictEqual(URI.equal("example://a/b/c/%7Bfoo%7D/ros\xE9", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9", IRI_OPTION), true); -}); - -test("Convert IRI to URI", function () { - //example from RFC 3987 - strictEqual(URI.serialize(URI.parse("uri://www.example.org/red%09ros\xE9#red", IRI_OPTION)), "uri://www.example.org/red%09ros%C3%A9#red"); - - //Internationalized Domain Name conversion via punycode example from RFC 3987 - strictEqual(URI.serialize(URI.parse("uri://r\xE9sum\xE9.example.org", {iri:true, domainHost:true}), {domainHost:true}), "uri://xn--rsum-bpad.example.org"); -}); - -test("Convert URI to IRI", function () { - //examples from RFC 3987 - strictEqual(URI.serialize(URI.parse("uri://www.example.org/D%C3%BCrst"), IRI_OPTION), "uri://www.example.org/D\xFCrst"); - strictEqual(URI.serialize(URI.parse("uri://www.example.org/D%FCrst"), IRI_OPTION), "uri://www.example.org/D%FCrst"); - strictEqual(URI.serialize(URI.parse("uri://xn--99zt52a.example.org/%e2%80%ae"), IRI_OPTION), "uri://xn--99zt52a.example.org/%E2%80%AE"); //or uri://\u7D0D\u8C46.example.org/%E2%80%AE - - //Internationalized Domain Name conversion via punycode example from RFC 3987 - strictEqual(URI.serialize(URI.parse("uri://xn--rsum-bpad.example.org", {domainHost:true}), {iri:true, domainHost:true}), "uri://r\xE9sum\xE9.example.org"); -}); - -// -// HTTP -// - -if (URI.SCHEMES["http"]) { - - //module("HTTP"); - - test("HTTP Equals", function () { - //test from RFC 2616 - strictEqual(URI.equal("http://abc.com:80/~smith/home.html", "http://abc.com/~smith/home.html"), true); - strictEqual(URI.equal("http://ABC.com/%7Esmith/home.html", "http://abc.com/~smith/home.html"), true); - strictEqual(URI.equal("http://ABC.com:/%7esmith/home.html", "http://abc.com/~smith/home.html"), true); - strictEqual(URI.equal("HTTP://ABC.COM", "http://abc.com/"), true); - //test from RFC 3986 - strictEqual(URI.equal("http://example.com:/", "http://example.com:80/"), true); - }); - -} - -if (URI.SCHEMES["https"]) { - - //module("HTTPS"); - - test("HTTPS Equals", function () { - strictEqual(URI.equal("https://example.com", "https://example.com:443/"), true); - strictEqual(URI.equal("https://example.com:/", "https://example.com:443/"), true); - }); - -} - -// -// URN -// - -if (URI.SCHEMES["urn"]) { - - //module("URN"); - - test("URN Parsing", function () { - //example from RFC 2141 - var components = URI.parse("urn:foo:a123,456"); - strictEqual(components.error, undefined, "errors"); - strictEqual(components.scheme, "urn", "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, undefined, "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - strictEqual(components.nid, "foo", "nid"); - strictEqual(components.nss, "a123,456", "nss"); - }); - - test("URN Serialization", function () { - //example from RFC 2141 - var components = { - scheme : "urn", - nid : "foo", - nss : "a123,456" - }; - strictEqual(URI.serialize(components), "urn:foo:a123,456"); - }); - - test("URN Equals", function () { - //test from RFC 2141 - strictEqual(URI.equal("urn:foo:a123,456", "urn:foo:a123,456"), true); - strictEqual(URI.equal("urn:foo:a123,456", "URN:foo:a123,456"), true); - strictEqual(URI.equal("urn:foo:a123,456", "urn:FOO:a123,456"), true); - strictEqual(URI.equal("urn:foo:a123,456", "urn:foo:A123,456"), false); - strictEqual(URI.equal("urn:foo:a123%2C456", "URN:FOO:a123%2c456"), true); - }); - - test("URN Resolving", function () { - //example from epoberezkin - strictEqual(URI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop'); - strictEqual(URI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop'); - strictEqual(URI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop'); - strictEqual(URI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop'); - }); - - // - // URN UUID - // - - test("UUID Parsing", function () { - //example from RFC 4122 - var components = URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); - strictEqual(components.error, undefined, "errors"); - strictEqual(components.scheme, "urn", "scheme"); - //strictEqual(components.authority, undefined, "authority"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, undefined, "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - strictEqual(components.nid, "uuid", "nid"); - strictEqual(components.nss, undefined, "nss"); - strictEqual(components.uuid, "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", "uuid"); - - components = URI.parse("urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6"); - notStrictEqual(components.error, undefined, "errors"); - }); - - test("UUID Serialization", function () { - //example from RFC 4122 - var components = { - scheme : "urn", - nid : "uuid", - uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6" - }; - strictEqual(URI.serialize(components), "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); - - components = { - scheme : "urn", - nid : "uuid", - uuid : "notauuid-7dec-11d0-a765-00a0c91e6bf6" - }; - strictEqual(URI.serialize(components), "urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6"); - }); - - test("UUID Equals", function () { - strictEqual(URI.equal("URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6", "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"), true); - }); - - test("URN NID Override", function () { - var components = URI.parse("urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6", {nid:"uuid"}); - strictEqual(components.error, undefined, "errors"); - strictEqual(components.scheme, "urn", "scheme"); - strictEqual(components.path, undefined, "path"); - strictEqual(components.nid, "foo", "nid"); - strictEqual(components.nss, undefined, "nss"); - strictEqual(components.uuid, "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", "uuid"); - - var components = { - scheme : "urn", - nid : "foo", - uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6" - }; - strictEqual(URI.serialize(components, {nid:"uuid"}), "urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); - }); -} - -// -// Mailto -// - -if (URI.SCHEMES["mailto"]) { - - //module("Mailto"); - - test("Mailto Parse", function () { - var components; - - //tests from RFC 6068 - - components = URI.parse("mailto:chris@example.com"); - strictEqual(components.error, undefined, "error"); - strictEqual(components.scheme, "mailto", "scheme"); - strictEqual(components.userinfo, undefined, "userinfo"); - strictEqual(components.host, undefined, "host"); - strictEqual(components.port, undefined, "port"); - strictEqual(components.path, undefined, "path"); - strictEqual(components.query, undefined, "query"); - strictEqual(components.fragment, undefined, "fragment"); - deepEqual(components.to, ["chris@example.com"], "to"); - strictEqual(components.subject, undefined, "subject"); - strictEqual(components.body, undefined, "body"); - strictEqual(components.headers, undefined, "headers"); - - components = URI.parse("mailto:infobot@example.com?subject=current-issue"); - deepEqual(components.to, ["infobot@example.com"], "to"); - strictEqual(components.subject, "current-issue", "subject"); - - components = URI.parse("mailto:infobot@example.com?body=send%20current-issue"); - deepEqual(components.to, ["infobot@example.com"], "to"); - strictEqual(components.body, "send current-issue", "body"); - - components = URI.parse("mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index"); - deepEqual(components.to, ["infobot@example.com"], "to"); - strictEqual(components.body, "send current-issue\x0D\x0Asend index", "body"); - - components = URI.parse("mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E"); - deepEqual(components.to, ["list@example.org"], "to"); - deepEqual(components.headers, {"In-Reply-To":"<3469A91.D10AF4C@example.com>"}, "headers"); - - components = URI.parse("mailto:majordomo@example.com?body=subscribe%20bamboo-l"); - deepEqual(components.to, ["majordomo@example.com"], "to"); - strictEqual(components.body, "subscribe bamboo-l", "body"); - - components = URI.parse("mailto:joe@example.com?cc=bob@example.com&body=hello"); - deepEqual(components.to, ["joe@example.com"], "to"); - strictEqual(components.body, "hello", "body"); - deepEqual(components.headers, {"cc":"bob@example.com"}, "headers"); - - components = URI.parse("mailto:joe@example.com?cc=bob@example.com?body=hello"); - if (URI.VALIDATE_SUPPORT) ok(components.error, "invalid header fields"); - - components = URI.parse("mailto:gorby%25kremvax@example.com"); - deepEqual(components.to, ["gorby%kremvax@example.com"], "to gorby%kremvax@example.com"); - - components = URI.parse("mailto:unlikely%3Faddress@example.com?blat=foop"); - deepEqual(components.to, ["unlikely?address@example.com"], "to unlikely?address@example.com"); - deepEqual(components.headers, {"blat":"foop"}, "headers"); - - components = URI.parse("mailto:Mike%26family@example.org"); - deepEqual(components.to, ["Mike&family@example.org"], "to Mike&family@example.org"); - - components = URI.parse("mailto:%22not%40me%22@example.org"); - deepEqual(components.to, ['"not@me"@example.org'], "to " + '"not@me"@example.org'); - - components = URI.parse("mailto:%22oh%5C%5Cno%22@example.org"); - deepEqual(components.to, ['"oh\\\\no"@example.org'], "to " + '"oh\\\\no"@example.org'); - - components = URI.parse("mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org"); - deepEqual(components.to, ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'], "to " + '"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'); - - components = URI.parse("mailto:user@example.org?subject=caf%C3%A9"); - deepEqual(components.to, ["user@example.org"], "to"); - strictEqual(components.subject, "caf\xE9", "subject"); - - components = URI.parse("mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D"); - deepEqual(components.to, ["user@example.org"], "to"); - strictEqual(components.subject, "=?utf-8?Q?caf=C3=A9?=", "subject"); //TODO: Verify this - - components = URI.parse("mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D"); - deepEqual(components.to, ["user@example.org"], "to"); - strictEqual(components.subject, "=?iso-8859-1?Q?caf=E9?=", "subject"); //TODO: Verify this - - components = URI.parse("mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9"); - deepEqual(components.to, ["user@example.org"], "to"); - strictEqual(components.subject, "caf\xE9", "subject"); - strictEqual(components.body, "caf\xE9", "body"); - - if (URI.IRI_SUPPORT) { - components = URI.parse("mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO"); - deepEqual(components.to, ["user@xn--99zt52a.example.org"], "to"); - strictEqual(components.subject, "Test", "subject"); - strictEqual(components.body, "NATTO", "body"); - } - - }); - - test("Mailto Serialize", function () { - var components; - - //tests from RFC 6068 - strictEqual(URI.serialize({scheme : "mailto", to : ["chris@example.com"]}), "mailto:chris@example.com"); - strictEqual(URI.serialize({scheme : "mailto", to : ["infobot@example.com"], body : "current-issue"}), "mailto:infobot@example.com?body=current-issue"); - strictEqual(URI.serialize({scheme : "mailto", to : ["infobot@example.com"], body : "send current-issue"}), "mailto:infobot@example.com?body=send%20current-issue"); - strictEqual(URI.serialize({scheme : "mailto", to : ["infobot@example.com"], body : "send current-issue\x0D\x0Asend index"}), "mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index"); - strictEqual(URI.serialize({scheme : "mailto", to : ["list@example.org"], headers : {"In-Reply-To" : "<3469A91.D10AF4C@example.com>"}}), "mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E"); - strictEqual(URI.serialize({scheme : "mailto", to : ["majordomo@example.com"], body : "subscribe bamboo-l"}), "mailto:majordomo@example.com?body=subscribe%20bamboo-l"); - strictEqual(URI.serialize({scheme : "mailto", to : ["joe@example.com"], headers : {"cc" : "bob@example.com", "body" : "hello"}}), "mailto:joe@example.com?cc=bob@example.com&body=hello"); - strictEqual(URI.serialize({scheme : "mailto", to : ["gorby%25kremvax@example.com"]}), "mailto:gorby%25kremvax@example.com"); - strictEqual(URI.serialize({scheme : "mailto", to : ["unlikely%3Faddress@example.com"], headers : {"blat" : "foop"}}), "mailto:unlikely%3Faddress@example.com?blat=foop"); - strictEqual(URI.serialize({scheme : "mailto", to : ["Mike&family@example.org"]}), "mailto:Mike%26family@example.org"); - strictEqual(URI.serialize({scheme : "mailto", to : ['"not@me"@example.org']}), "mailto:%22not%40me%22@example.org"); - strictEqual(URI.serialize({scheme : "mailto", to : ['"oh\\\\no"@example.org']}), "mailto:%22oh%5C%5Cno%22@example.org"); - strictEqual(URI.serialize({scheme : "mailto", to : ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org']}), "mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org"); - strictEqual(URI.serialize({scheme : "mailto", to : ["user@example.org"], subject : "caf\xE9"}), "mailto:user@example.org?subject=caf%C3%A9"); - strictEqual(URI.serialize({scheme : "mailto", to : ["user@example.org"], subject : "=?utf-8?Q?caf=C3=A9?="}), "mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D"); - strictEqual(URI.serialize({scheme : "mailto", to : ["user@example.org"], subject : "=?iso-8859-1?Q?caf=E9?="}), "mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D"); - strictEqual(URI.serialize({scheme : "mailto", to : ["user@example.org"], subject : "caf\xE9", body : "caf\xE9"}), "mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9"); - if (URI.IRI_SUPPORT) { - strictEqual(URI.serialize({scheme : "mailto", to : ["us\xE9r@\u7d0d\u8c46.example.org"], subject : "Test", body : "NATTO"}), "mailto:us%C3%A9r@xn--99zt52a.example.org?subject=Test&body=NATTO"); - } - - }); - - test("Mailto Equals", function () { - //tests from RFC 6068 - strictEqual(URI.equal("mailto:addr1@an.example,addr2@an.example", "mailto:?to=addr1@an.example,addr2@an.example"), true); - strictEqual(URI.equal("mailto:?to=addr1@an.example,addr2@an.example", "mailto:addr1@an.example?to=addr2@an.example"), true); - }); - -} diff --git a/node_modules/uri-js/tsconfig.json b/node_modules/uri-js/tsconfig.json deleted file mode 100644 index e2899857b1f5c..0000000000000 --- a/node_modules/uri-js/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "es2015", - "target": "esnext", - "noImplicitAny": true, - "sourceMap": true, - "alwaysStrict": true, - "declaration": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "importHelpers": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "outDir": "dist/esnext", - "strictNullChecks": true - }, - "include": [ - "src/**/*" - ] -} diff --git a/node_modules/uri-js/yarn.lock b/node_modules/uri-js/yarn.lock old mode 100644 new mode 100755 index 569687d50ee09..19613ae746a44 --- a/node_modules/uri-js/yarn.lock +++ b/node_modules/uri-js/yarn.lock @@ -837,8 +837,8 @@ expand-range@^1.8.1: fill-range "^2.1.0" extend@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" extglob@^0.3.1: version "0.3.2" @@ -913,9 +913,9 @@ fstream-ignore@^1.0.5: inherits "2" minimatch "^3.0.0" -fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -965,7 +965,7 @@ glob@7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.5, glob@^7.1.2: +glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -976,13 +976,28 @@ glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.3: + version "7.1.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" -graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.4: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +graceful-fs@^4.1.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + +graceful-fs@^4.1.3, graceful-fs@^4.1.4: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" "graceful-readlink@>= 1.0.0": version "1.0.1" @@ -1057,8 +1072,8 @@ inflight@^1.0.4: wrappy "1" inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" ini@~1.3.0: version "1.3.5" @@ -1269,8 +1284,8 @@ lodash.keys@^3.0.0: lodash.isarray "^3.0.0" lodash@^4.17.4: - version "4.17.5" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" longest@^1.0.1: version "1.0.1" @@ -1632,11 +1647,17 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.1, rimraf@^2.5.2, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" +rimraf@2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +rimraf@^2.5.1, rimraf@^2.5.2, rimraf@^2.6.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" dependencies: - glob "^7.0.5" + glob "^7.1.3" rollup-plugin-babel@^2.7.1: version "2.7.1" @@ -1759,8 +1780,8 @@ string_decoder@~1.0.3: safe-buffer "~5.1.0" stringstream@~0.0.4: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + version "0.0.6" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" @@ -1796,11 +1817,11 @@ tar-pack@^3.4.0: uid-number "^0.0.6" tar@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + version "2.2.2" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40" dependencies: block-stream "*" - fstream "^1.0.2" + fstream "^1.0.12" inherits "2" to-fast-properties@^1.0.3: diff --git a/package-lock.json b/package-lock.json index ee890c7e77125..66b467c2c3f12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -170,12 +170,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz", - "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "dependencies": { - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -298,9 +298,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.0.tgz", - "integrity": "sha512-qvRvi4oI8xii8NllyEc4MDJjuZiNaRzyb7Y7lup1NqJV8TZHF4O27CcP+72WPn/k1zkgJ6WJfnIbk4jTsVAZHw==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -321,17 +321,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz", - "integrity": "sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -347,9 +347,9 @@ } }, "node_modules/@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.10.4", @@ -602,9 +602,9 @@ } }, "node_modules/aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "inBundle": true, "dependencies": { "clean-stack": "^2.0.0", @@ -738,12 +738,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/argparse/node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "node_modules/array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -835,9 +829,9 @@ } }, "node_modules/aws4": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", - "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "inBundle": true }, "node_modules/balanced-match": { @@ -872,21 +866,6 @@ "node": ">=10" } }, - "node_modules/bin-links/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "inBundle": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -979,21 +958,6 @@ "node": ">= 10" } }, - "node_modules/cacache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "inBundle": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/caching-transform": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", @@ -1035,6 +999,15 @@ "node": ">=6" } }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -1058,9 +1031,9 @@ } }, "node_modules/chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", "dev": true, "dependencies": { "anymatch": "~3.1.1", @@ -1148,12 +1121,6 @@ "node": ">=8" } }, - "node_modules/cli-table3/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "inBundle": true - }, "node_modules/cli-table3/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1430,12 +1397,20 @@ } }, "node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "inBundle": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/debuglog": { @@ -1576,10 +1551,10 @@ "inBundle": true }, "node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "inBundle": true }, "node_modules/encoding": { "version": "0.1.13", @@ -2028,9 +2003,9 @@ } }, "node_modules/esquery/node_modules/estraverse": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", - "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true, "engines": { "node": ">=4.0" @@ -2276,21 +2251,21 @@ "dev": true }, "node_modules/flow-parser": { - "version": "0.130.0", - "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.130.0.tgz", - "integrity": "sha512-h9NATB7QsKhj2ucgEH2XzB7p+5ubk8IZX5u/qHkN+oyQoECi1diq6mYfIuYBOyL35f3AhJf/YDkBYQBTqqYK+w==", + "version": "0.134.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.134.0.tgz", + "integrity": "sha512-VmRba5YXKmVqIH3xNzUJ4pNobxXEOl6h36m+0f5dZ6/av9YlRpls/yBnPESQ4qBUbyyp7iqoc1Feo1lFw3u1YQ==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/flow-remove-types": { - "version": "2.130.0", - "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.130.0.tgz", - "integrity": "sha512-x48wARPzBge8aRd0ZI3lQi59afHwVk7DymUIFf423bUfa3u1GJWOfpdHggPkN1f4R16oUH+YO4KldBz8Ce2ldg==", + "version": "2.134.0", + "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.134.0.tgz", + "integrity": "sha512-NVtghveE8GbU+980DRZQ0NZYGE7l7FIZm/UU8Ft7QoFgpsU8Tauv/WRLX+Exj4WT+GbAndmyUWZFOtcBfeT+gg==", "dev": true, "dependencies": { - "flow-parser": "^0.130.0", + "flow-parser": "^0.134.0", "pirates": "^3.0.2", "vlq": "^0.2.1" }, @@ -2359,6 +2334,20 @@ "node": "*" } }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "inBundle": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/fs-exists-cached": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", @@ -2853,9 +2842,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true, "engines": { "node": ">= 0.4" @@ -2924,6 +2913,15 @@ "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", "inBundle": true }, + "node_modules/is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2934,9 +2932,9 @@ } }, "node_modules/is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "dependencies": { "has-symbols": "^1.0.1" @@ -3551,9 +3549,9 @@ } }, "node_modules/lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "node_modules/lodash.clonedeep": { @@ -3665,9 +3663,9 @@ } }, "node_modules/marked": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.3.tgz", - "integrity": "sha512-Fqa7eq+UaxfMriqzYLayfqAE40WN03jf+zHjT18/uXNuzjq3TY0XTbrAoPeqSJrAmPz11VuUA+kBPYOhHt9oOQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", + "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", "dev": true, "peer": true, "bin": { @@ -3771,9 +3769,9 @@ } }, "node_modules/minipass-fetch": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.3.0.tgz", - "integrity": "sha512-Yb23ESZZ/8QxiBvSpJ4atbVMVDx2CXrerzrtQzQ67eLqKg+zFIkYFTagk3xh6fdo+e/FvDtVuCD4QcuYDRR3hw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.3.1.tgz", + "integrity": "sha512-N0ddPAD8OZnoAHUYj1ZH4ZJVna+ucy7if777LrdeIV1ko8f46af4jbyM5EC1gN4xc9Wq5c3C38GnxRJ2gneXRA==", "inBundle": true, "dependencies": { "encoding": "^0.1.12", @@ -4310,18 +4308,47 @@ } }, "node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.assign/node_modules/es-abstract": { + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", "dev": true, "dependencies": { - "define-properties": "^1.1.2", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.values": { @@ -4516,21 +4543,6 @@ "node": ">=10" } }, - "node_modules/pacote/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "inBundle": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4723,15 +4735,6 @@ "node": ">=0.12" } }, - "node_modules/promise-retry/node_modules/retry": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", - "inBundle": true, - "engines": { - "node": "*" - } - }, "node_modules/promzard": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", @@ -4973,20 +4976,6 @@ "node": ">= 6" } }, - "node_modules/request/node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "inBundle": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/request/node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -5041,6 +5030,15 @@ "node": ">=4" } }, + "node_modules/retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "inBundle": true, + "engines": { + "node": "*" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5165,12 +5163,12 @@ } }, "node_modules/socks": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.4.1.tgz", - "integrity": "sha512-8mWHeYC1OA0500qzb+sqwm0Hzi8oBpeuI1JugoBVMEJtJvxSgco8xFSK+NRnZcHeeWjTbF82KUDo5sXH22TY5A==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.4.4.tgz", + "integrity": "sha512-7LmHN4IHj1Vpd/k8D872VGCHJ6yIVyeFkfIBExRmGPYQ/kdUkpdg9eKh9oOzYYYKQhuxavayJHTnmBG+EzluUA==", "inBundle": true, "dependencies": { - "ip": "1.1.5", + "ip": "^1.1.5", "smart-buffer": "^4.1.0" }, "engines": { @@ -5303,11 +5301,17 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", "inBundle": true }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "node_modules/sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -5463,9 +5467,9 @@ } }, "node_modules/supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "inBundle": true, "dependencies": { "has-flag": "^4.0.0" @@ -5498,6 +5502,12 @@ "node": ">=6" } }, + "node_modules/table/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "node_modules/table/node_modules/string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -7871,9 +7881,9 @@ } }, "node_modules/uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "inBundle": true, "dependencies": { "punycode": "^2.1.0" @@ -8129,15 +8139,6 @@ "decamelize": "^1.2.0" } }, - "node_modules/yargs-parser/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/yargs/node_modules/ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -8185,6 +8186,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "node_modules/yargs/node_modules/find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -8307,12 +8314,12 @@ } }, "@babel/generator": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz", - "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "requires": { - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -8422,9 +8429,9 @@ } }, "@babel/parser": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.0.tgz", - "integrity": "sha512-qvRvi4oI8xii8NllyEc4MDJjuZiNaRzyb7Y7lup1NqJV8TZHF4O27CcP+72WPn/k1zkgJ6WJfnIbk4jTsVAZHw==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true }, "@babel/template": { @@ -8439,17 +8446,17 @@ } }, "@babel/traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz", - "integrity": "sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -8464,9 +8471,9 @@ } }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -8671,9 +8678,9 @@ } }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -8771,14 +8778,6 @@ "dev": true, "requires": { "sprintf-js": "~1.0.2" - }, - "dependencies": { - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - } } }, "array-includes": { @@ -8846,9 +8845,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", - "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" }, "balanced-match": { "version": "1.0.0", @@ -8874,16 +8873,6 @@ "read-cmd-shim": "^2.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^3.0.3" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - } } }, "binary-extensions": { @@ -8960,16 +8949,6 @@ "ssri": "^8.0.0", "tar": "^6.0.2", "unique-filename": "^1.1.1" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - } } }, "caching-transform": { @@ -9009,6 +8988,12 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -9024,9 +9009,9 @@ } }, "chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", "dev": true, "requires": { "anymatch": "~3.1.1", @@ -9081,11 +9066,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -9295,11 +9275,11 @@ } }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "debuglog": { @@ -9405,10 +9385,9 @@ "integrity": "sha1-YMf4e9YrzGqJT6jM1q+3gjok90I=" }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "encoding": { "version": "0.1.13", @@ -9762,9 +9741,9 @@ }, "dependencies": { "estraverse": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", - "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true } } @@ -9957,18 +9936,18 @@ "dev": true }, "flow-parser": { - "version": "0.130.0", - "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.130.0.tgz", - "integrity": "sha512-h9NATB7QsKhj2ucgEH2XzB7p+5ubk8IZX5u/qHkN+oyQoECi1diq6mYfIuYBOyL35f3AhJf/YDkBYQBTqqYK+w==", + "version": "0.134.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.134.0.tgz", + "integrity": "sha512-VmRba5YXKmVqIH3xNzUJ4pNobxXEOl6h36m+0f5dZ6/av9YlRpls/yBnPESQ4qBUbyyp7iqoc1Feo1lFw3u1YQ==", "dev": true }, "flow-remove-types": { - "version": "2.130.0", - "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.130.0.tgz", - "integrity": "sha512-x48wARPzBge8aRd0ZI3lQi59afHwVk7DymUIFf423bUfa3u1GJWOfpdHggPkN1f4R16oUH+YO4KldBz8Ce2ldg==", + "version": "2.134.0", + "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.134.0.tgz", + "integrity": "sha512-NVtghveE8GbU+980DRZQ0NZYGE7l7FIZm/UU8Ft7QoFgpsU8Tauv/WRLX+Exj4WT+GbAndmyUWZFOtcBfeT+gg==", "dev": true, "requires": { - "flow-parser": "^0.130.0", + "flow-parser": "^0.134.0", "pirates": "^3.0.2", "vlq": "^0.2.1" } @@ -10025,6 +10004,16 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, "fs-exists-cached": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", @@ -10394,9 +10383,9 @@ } }, "is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, "is-cidr": { @@ -10438,6 +10427,12 @@ "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=" }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -10445,9 +10440,9 @@ "dev": true }, "is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" @@ -10911,9 +10906,9 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash.clonedeep": { @@ -11003,8 +10998,9 @@ } }, "marked": { - "version": "https://registry.npmjs.org/marked/-/marked-0.6.3.tgz", - "integrity": "sha512-Fqa7eq+UaxfMriqzYLayfqAE40WN03jf+zHjT18/uXNuzjq3TY0XTbrAoPeqSJrAmPz11VuUA+kBPYOhHt9oOQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", + "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", "dev": true, "peer": true }, @@ -11076,9 +11072,9 @@ } }, "minipass-fetch": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.3.0.tgz", - "integrity": "sha512-Yb23ESZZ/8QxiBvSpJ4atbVMVDx2CXrerzrtQzQ67eLqKg+zFIkYFTagk3xh6fdo+e/FvDtVuCD4QcuYDRR3hw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.3.1.tgz", + "integrity": "sha512-N0ddPAD8OZnoAHUYj1ZH4ZJVna+ucy7if777LrdeIV1ko8f46af4jbyM5EC1gN4xc9Wq5c3C38GnxRJ2gneXRA==", "requires": { "encoding": "^0.1.12", "minipass": "^3.1.0", @@ -11470,15 +11466,37 @@ "dev": true }, "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "object.values": { @@ -11622,16 +11640,6 @@ "rimraf": "^3.0.2", "ssri": "^8.0.0", "tar": "^6.0.1" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - } } }, "parent-module": { @@ -11767,13 +11775,6 @@ "requires": { "err-code": "^1.0.0", "retry": "^0.10.0" - }, - "dependencies": { - "retry": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=" - } } }, "promzard": { @@ -11968,16 +11969,6 @@ "uuid": "^3.3.2" }, "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -12020,6 +12011,11 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=" + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -12111,11 +12107,11 @@ "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==" }, "socks": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.4.1.tgz", - "integrity": "sha512-8mWHeYC1OA0500qzb+sqwm0Hzi8oBpeuI1JugoBVMEJtJvxSgco8xFSK+NRnZcHeeWjTbF82KUDo5sXH22TY5A==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.4.4.tgz", + "integrity": "sha512-7LmHN4IHj1Vpd/k8D872VGCHJ6yIVyeFkfIBExRmGPYQ/kdUkpdg9eKh9oOzYYYKQhuxavayJHTnmBG+EzluUA==", "requires": { - "ip": "1.1.5", + "ip": "^1.1.5", "smart-buffer": "^4.1.0" } }, @@ -12225,9 +12221,15 @@ } }, "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "sshpk": { "version": "1.16.1", @@ -12337,9 +12339,9 @@ "dev": true }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { "has-flag": "^4.0.0" } @@ -12362,6 +12364,12 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -14164,9 +14172,9 @@ } }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "requires": { "punycode": "^2.1.0" } @@ -14411,6 +14419,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -14495,14 +14509,6 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } } }, "yn": { From 3b417055cf07c4ef8e4c5063f00d3c24b5f5cbd2 Mon Sep 17 00:00:00 2001 From: zhaoxuxu Date: Fri, 18 Sep 2020 18:21:07 +0800 Subject: [PATCH 32/39] add proxy PR-URL: https://github.com/npm/cli/pull/1859 Credit: @badeggg Close: #1859 Reviewed-by: @isaacs EDIT: changed flatOptions.noproxy to flatOptions.noProxy, since make-fetch-happen reads it from the camel-cased property. --- lib/utils/flat-options.js | 8 +++++++- tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js | 2 ++ test/lib/utils/flat-options.js | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js index 54ba22d6c8ffb..721bbbde76651 100644 --- a/lib/utils/flat-options.js +++ b/lib/utils/flat-options.js @@ -209,7 +209,13 @@ const flatOptions = npm => npm.flatOptions || Object.freeze({ ...getScopesAndAuths(npm), // npm fund exclusive option to select an item from a funding list - which: npm.config.get('which') + which: npm.config.get('which'), + + // socks proxy can be configured in https-proxy or proxy field + // note that the various (HTTPS_|HTTP_|)PROXY environs will be + // respected if this is not set. + proxy: npm.config.get('https-proxy') || npm.config.get('proxy'), + noProxy: npm.config.get('noproxy') }) const getPreferOnline = npm => { diff --git a/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js b/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js index 0e7b7c33e6c92..cd41d33cbb26c 100644 --- a/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js @@ -66,6 +66,7 @@ Object { "metricsRegistry": "metrics-registry", "nodeBin": "/path/to/some/node", "nodeVersion": "1.2.3", + "noProxy": "noproxy", "npmBin": "/path/to/npm/bin.js", "npmCommand": null, "npmSession": "12345", @@ -83,6 +84,7 @@ Object { "prefix": "/path/to/npm/cli", "preid": "preid", "projectScope": "@npmcli", + "proxy": "proxy", "readOnly": "read-only", "rebuildBundle": "rebuild-bundle", "registry": "registry", diff --git a/test/lib/utils/flat-options.js b/test/lib/utils/flat-options.js index 162e698daf29e..f18ce828c3e1d 100644 --- a/test/lib/utils/flat-options.js +++ b/test/lib/utils/flat-options.js @@ -110,6 +110,8 @@ class MockConfig { 'user-agent': 'user-agent', '@scope:registry': '@scope:registry', '//nerf.dart:_authToken': '//nerf.dart:_authToken', + 'proxy': 'proxy', + 'noproxy': 'noproxy', ...opts }] } From d30dade387942b4f82c25d4293dbd485605d1ad8 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 30 Sep 2020 15:19:23 -0400 Subject: [PATCH 33/39] chore: removed old test suite --- test/common-config.js | 90 -- test/common-tap.js | 276 ------ test/fake-registry.js | 156 ---- test/fake-registry.md | 198 ----- test/fixtures/config/.npmrc | 1 - test/fixtures/config/builtin | 1 - test/fixtures/config/globalconfig | 1 - test/fixtures/config/malformed | 1 - test/fixtures/config/multi-ca | 32 - test/fixtures/config/userconfig | 22 - test/fixtures/forked-underscore-1.5.1.tgz | Bin 583 -> 0 bytes ...-com-BryanDonovan-dummy-npm-bar.git.tar.gz | Bin 12585 -> 0 bytes ...com-BryanDonovan-dummy-npm-buzz.git.tar.gz | Bin 10860 -> 0 bytes ...-com-BryanDonovan-dummy-npm-foo.git.tar.gz | Bin 12712 -> 0 bytes ...b-com-BryanDonovan-npm-git-test.git.tar.gz | Bin 9521 -> 0 bytes test/fixtures/gitignore-and-npmignore-2.tar | Bin 4096 -> 0 bytes test/fixtures/gitignore-and-npmignore.tar | Bin 10240 -> 0 bytes test/fixtures/gitignore-and-npmignore.tgz | Bin 360 -> 0 bytes test/fixtures/gitignore.tgz | Bin 319 -> 0 bytes test/fixtures/npmignore.tgz | Bin 320 -> 0 bytes test/fixtures/onload.js | 1 - test/fixtures/scoped-underscore-1.3.1.tgz | Bin 55415 -> 0 bytes test/fixtures/third-party.md | 25 - .../add-remote-git-get-resolved.js | 129 --- .../belongs-in-pacote/git-races.js | 219 ----- test/need-npm5-update/ignore-shrinkwrap.js | 135 --- test/need-npm5-update/legacy-array-bin.js | 80 -- test/need-npm5-update/legacy-dir-bin.js | 79 -- .../legacy-npm-self-install.js | 106 --- test/need-npm5-update/legacy-optional-deps.js | 80 -- test/need-npm5-update/legacy-shrinkwrap.js | 132 --- test/need-npm5-update/lifecycle-signal.js | 140 --- .../move-no-clobber-dest-node-modules.js | 139 --- .../update-save.js | 219 ----- .../need-outdated/update-symlink.js | 127 --- test/need-npm5-update/outdated-depth-deep.js | 92 -- .../outdated-depth-integer.js | 80 -- .../outdated-include-devdependencies.js | 58 -- test/need-npm5-update/outdated-local.js | 195 ---- .../need-npm5-update/outdated-new-versions.js | 65 -- test/need-npm5-update/outdated-notarget.js | 47 - test/need-npm5-update/outdated-private.js | 115 --- test/need-npm5-update/outdated-symlink.js | 103 --- test/need-npm5-update/peer-deps-invalid.js | 100 --- test/need-npm5-update/peer-deps-toplevel.js | 132 --- .../peer-deps-without-package-json.js | 79 -- test/need-npm5-update/rm-linked.js | 139 --- .../shrinkwrap-complete-except-dev.js | 158 ---- .../shrinkwrap-dev-dep-cycle.js | 102 --- test/network/git-cache-locking.js | 44 - test/network/git-cache-no-hooks.js | 50 -- test/network/legacy-bundled-git.js | 99 --- test/network/legacy-url-dep.js | 59 -- test/network/registry.js | 68 -- test/tap/00-check-mock-dep.js | 17 - test/tap/00-config-setup.js | 85 -- test/tap/00-verify-bundle-deps.js | 16 - test/tap/00-verify-ls-ok.js | 27 - test/tap/404-parent.js | 54 -- test/tap/404-private-registry-scoped.js | 36 - test/tap/404-private-registry.js | 37 - test/tap/404.js | 72 -- test/tap/add-named-update-protocol-port.js | 113 --- test/tap/add-remote-git-file.js | 81 -- test/tap/add-remote-git-shrinkwrap.js | 137 --- test/tap/add-remote-git-submodule.js | 142 --- test/tap/add-remote-git.js | 104 --- test/tap/adduser-always-auth.js | 266 ------ test/tap/adduser-legacy-auth.js | 102 --- test/tap/adduser-oauth.js | 82 -- test/tap/adduser-saml.js | 82 -- test/tap/aliases.js | 273 ------ test/tap/anon-cli-metrics.js | 151 ---- test/tap/audit-fix.js | 829 ------------------ test/tap/audit.js | 578 ------------ test/tap/auto-prune.js | 147 ---- test/tap/bearer-token-check.js | 109 --- test/tap/bin.js | 23 - .../bitbucket-https-url-with-creds-package.js | 70 -- test/tap/bitbucket-https-url-with-creds.js | 69 -- test/tap/bitbucket-shortcut-package.js | 73 -- test/tap/bitbucket-shortcut.js | 70 -- test/tap/build-already-built.js | 60 -- test/tap/builtin-config.js | 136 --- test/tap/bundled-dependencies-nonarray.js | 71 -- test/tap/bundled-dependencies.js | 109 --- test/tap/bundled-no-add-to-move.js | 50 -- test/tap/bundled-transitive-deps.js | 108 --- test/tap/cache-add-unpublished.js | 37 - test/tap/cache-eacces-error-message.js | 35 - test/tap/cache-shasum-fork.js | 92 -- test/tap/check-cpu-reqs.js | 50 -- test/tap/check-engine-reqs.js | 63 -- test/tap/check-install-self.js | 56 -- test/tap/check-os-reqs.js | 50 -- test/tap/check-permissions.js | 95 -- test/tap/ci-header.js | 139 --- test/tap/ci-permissions.js | 53 -- test/tap/circular-dep.js | 93 -- test/tap/config-basic.js | 79 -- test/tap/config-builtin.js | 66 -- test/tap/config-certfile.js | 19 - test/tap/config-credentials.js | 350 -------- test/tap/config-edit.js | 74 -- test/tap/config-envReplace.js | 58 -- test/tap/config-list.js | 69 -- test/tap/config-malformed.js | 14 - test/tap/config-new-cafile.js | 37 - test/tap/config-private.js | 83 -- test/tap/config-project.js | 66 -- test/tap/config-save.js | 91 -- test/tap/cruft-test.js | 43 - test/tap/debug-logs.js | 97 -- test/tap/deprecate.js | 157 ---- test/tap/dist-tag.js | 271 ------ test/tap/doctor.js | 131 --- test/tap/extraneous-dep-cycle-ls-ok.js | 71 -- test/tap/false-name.js | 79 -- test/tap/format-package-lock.js | 116 --- test/tap/full-warning-messages.js | 112 --- test/tap/gently-rm-linked-module.js | 100 --- test/tap/gently-rm-overeager.js | 60 -- test/tap/gently-rm-symlinked-global-dir.js | 119 --- test/tap/gist-short-shortcut-package.js | 71 -- test/tap/gist-short-shortcut.js | 68 -- test/tap/gist-shortcut-package.js | 65 -- test/tap/gist-shortcut.js | 58 -- test/tap/git-dependency-install-link.js | 172 ---- test/tap/git-npmignore.js | 200 ----- test/tap/git-prepare.js | 166 ---- test/tap/github-shortcut-package.js | 61 -- test/tap/github-shortcut.js | 61 -- test/tap/gitlab-shortcut-package.js | 60 -- test/tap/gitlab-shortcut.js | 57 -- test/tap/global-prefix-set-in-userconfig.js | 36 - test/tap/graceful-restart.js | 94 -- test/tap/help.js | 26 - test/tap/hook.js | 243 ----- test/tap/ignore-install-link.js | 71 -- test/tap/ignore-scripts.js | 128 --- test/tap/init-create.js | 171 ---- test/tap/init-interrupt.js | 38 - test/tap/install-actions.js | 117 --- test/tap/install-at-locally.js | 52 -- test/tap/install-at-sub-path-locally.js | 49 -- test/tap/install-bad-dep-format.js | 33 - test/tap/install-bad-man.js | 61 -- test/tap/install-before.js | 94 -- test/tap/install-bin-null.js | 73 -- test/tap/install-cli-only-development.js | 95 -- test/tap/install-cli-only-production.js | 81 -- test/tap/install-cli-only-shrinkwrap.js | 119 --- test/tap/install-cli-production-nosave.js | 48 - test/tap/install-cli-production.js | 79 -- test/tap/install-cli-unicode.js | 57 -- test/tap/install-contributors-count.js | 69 -- test/tap/install-dep-classification.js | 188 ---- test/tap/install-duplicate-deps-warning.js | 51 -- test/tap/install-from-local-multipath.js | 173 ---- test/tap/install-from-local.js | 89 -- test/tap/install-into-likenamed-folder.js | 44 - test/tap/install-link-metadeps-locally.js | 52 -- test/tap/install-link-metadeps-subfolders.js | 68 -- test/tap/install-link-scripts.js | 121 --- test/tap/install-local-dep-cycle.js | 79 -- test/tap/install-local-from-local.js | 94 -- test/tap/install-man.js | 57 -- test/tap/install-mention-funding.js | 130 --- test/tap/install-noargs-dev.js | 90 -- test/tap/install-order.js | 65 -- test/tap/install-package-json-order.js | 42 - test/tap/install-package-lock-only.js | 123 --- test/tap/install-parse-error.js | 50 -- test/tap/install-property-conflicts.js | 53 -- test/tap/install-report-just-installed.js | 74 -- test/tap/install-save-consistent-newlines.js | 98 --- test/tap/install-save-exact.js | 82 -- test/tap/install-save-local.js | 181 ---- test/tap/install-save-prefix.js | 164 ---- test/tap/install-scoped-already-installed.js | 129 --- test/tap/install-scoped-link.js | 73 -- .../install-scoped-with-bundled-dependency.js | 83 -- .../install-scoped-with-peer-dependency.js | 40 - test/tap/install-shrinkwrapped-git.js | 155 ---- ...stall-test-cli-with-broken-package-lock.js | 118 --- .../install-test-cli-without-package-lock.js | 64 -- test/tap/install-windows-newlines.js | 90 -- test/tap/install-with-dev-dep-duplicate.js | 81 -- test/tap/install-without-registry-config.js | 35 - test/tap/invalid-cmd-exit-code.js | 34 - test/tap/invalid-dep-version-filtering.js | 135 --- test/tap/is-fs-access-available.js | 55 -- test/tap/is-registry.js | 27 - test/tap/it.js | 65 -- test/tap/legacy-ignore-nested-nm.js | 64 -- test/tap/legacy-missing-bindir.js | 78 -- test/tap/legacy-no-auth-leak.js | 74 -- test/tap/legacy-platform-all.js | 74 -- test/tap/legacy-platform.js | 64 -- test/tap/legacy-private.js | 58 -- test/tap/legacy-test-package.js | 70 -- test/tap/lifecycle-INIT_CWD.js | 36 - test/tap/lifecycle-order.js | 33 - test/tap/lifecycle-path.js | 210 ----- test/tap/link.js | 193 ---- test/tap/local-args-relative-to-cwd.js | 65 -- test/tap/lockfile-http-deps.js | 90 -- test/tap/logout-scoped.js | 69 -- test/tap/logout.js | 67 -- .../meta-test-flaky-root-ownership-test.js | 20 - test/tap/nerf-dart.js | 32 - test/tap/nested-extraneous.js | 53 -- test/tap/no-global-warns.js | 62 -- test/tap/no-scan-full-global-dir.js | 107 --- test/tap/noargs-install-config-save.js | 76 -- test/tap/node-modules-path-munge.js | 39 - test/tap/normalize-package-explode.js | 26 - test/tap/npm-api-not-loaded-error.js | 48 - test/tap/onload.js | 39 - .../optional-metadep-rollback-collision.js | 188 ---- test/tap/org.js | 136 --- test/tap/outdated-bad-read-tree.js | 21 - test/tap/outdated-color.js | 75 -- test/tap/outdated-depth.js | 76 -- test/tap/outdated-git.js | 61 -- test/tap/outdated-json.js | 123 --- test/tap/outdated-latest.js | 109 --- test/tap/outdated-long.js | 93 -- test/tap/outdated-remote.js | 89 -- test/tap/outdated-symlink.js | 133 --- test/tap/outdated.js | 123 --- test/tap/override-bundled.js | 191 ---- test/tap/owner.js | 159 ---- test/tap/pack-files-and-ignores.js | 707 --------------- test/tap/pack-scoped.js | 81 -- test/tap/pack.js | 199 ----- test/tap/peer-deps.js | 52 -- .../pick-manifest-from-registry-metadata.js | 145 --- test/tap/ping.js | 95 -- test/tap/prepare.js | 89 -- test/tap/prepublish-only.js | 136 --- test/tap/prepublish.js | 118 --- test/tap/process-logger.js | 12 - test/tap/progress-config.js | 87 -- test/tap/publish-access-scoped.js | 65 -- ...ublish-access-unscoped-restricted-fails.js | 38 - test/tap/publish-access-unscoped.js | 65 -- test/tap/publish-config.js | 69 -- test/tap/publish-invalid-semver-tag.js | 76 -- test/tap/publish-scoped.js | 81 -- test/tap/publish.js | 162 ---- test/tap/pwd-prefix.js | 35 - test/tap/repo.js | 212 ----- test/tap/retry-on-stale-cache.js | 195 ---- test/tap/run-script-filter-private.js | 52 -- test/tap/run-script.js | 374 -------- test/tap/save-optional.js | 81 -- test/tap/scope-header.js | 160 ---- test/tap/scripts-whitespace-windows.js | 88 -- test/tap/search.all-package-search.js | 207 ----- test/tap/search.js | 254 ------ test/tap/semver-doc.js | 12 - test/tap/shared-linked.js | 151 ---- test/tap/shrinkwrap-_auth.js | 109 --- test/tap/shrinkwrap-default-dev.js | 93 -- test/tap/shrinkwrap-dev-dependency.js | 70 -- test/tap/shrinkwrap-empty-deps.js | 58 -- test/tap/shrinkwrap-extra-metadata.js | 60 -- test/tap/shrinkwrap-global-auth.js | 97 -- test/tap/shrinkwrap-lifecycle-cwd.js | 87 -- test/tap/shrinkwrap-lifecycle.js | 37 - test/tap/shrinkwrap-local-dependency.js | 124 --- test/tap/shrinkwrap-nested.js | 165 ---- test/tap/shrinkwrap-optional-dependency.js | 91 -- test/tap/shrinkwrap-optional-platform.js | 107 --- test/tap/shrinkwrap-optional-property.js | 87 -- test/tap/shrinkwrap-prod-dependency-also.js | 85 -- test/tap/shrinkwrap-prod-dependency.js | 76 -- test/tap/shrinkwrap-resolve-conflict.js | 117 --- .../shrinkwrap-save-dev-with-existing-deps.js | 92 -- .../shrinkwrap-save-with-existing-dev-deps.js | 79 -- test/tap/shrinkwrap-scoped-auth.js | 96 -- test/tap/shrinkwrap-shared-dev-dependency.js | 89 -- test/tap/shrinkwrap-version-match.js | 115 --- test/tap/sorted-package-json.js | 58 -- test/tap/spawn-enoent-help.js | 35 - test/tap/spawn-enoent.js | 38 - test/tap/spec-local-specifiers.js | 752 ---------------- .../splat-with-only-prerelease-to-latest.js | 95 -- test/tap/startstop.js | 61 -- test/tap/symlink-cycle.js | 41 - test/tap/tag-version-prefix.js | 73 -- test/tap/tagged-version-matching.js | 151 ---- test/tap/team.js | 189 ---- test/tap/test-run-ls.js | 33 - test/tap/tree-style.js | 127 --- test/tap/umask-lifecycle.js | 61 -- test/tap/uninstall-link-clean.js | 113 --- test/tap/uninstall-package.js | 85 -- test/tap/uninstall-save.js | 72 -- test/tap/unit-child-path.js | 16 - test/tap/unit-deps-earliestInstallable.js | 114 --- test/tap/unit-deps-removeObsoleteDep.js | 44 - test/tap/unit-deps-replaceModule.js | 65 -- test/tap/unit-module-name.js | 40 - test/tap/unit-package-id.js | 17 - test/tap/unit-token-validate-cidr.js | 18 - test/tap/unpack-foreign-tarball.js | 84 -- test/tap/unpublish-config.js | 70 -- test/tap/update-examples.js | 221 ----- test/tap/update-path.js | 35 - test/tap/update-symlink.js | 109 --- test/tap/upgrade-lifecycles.js | 88 -- test/tap/url-dependencies.js | 61 -- test/tap/version.js | 96 -- test/tap/whoami.js | 76 -- 316 files changed, 30397 deletions(-) delete mode 100644 test/common-config.js delete mode 100644 test/common-tap.js delete mode 100644 test/fake-registry.js delete mode 100644 test/fake-registry.md delete mode 100644 test/fixtures/config/.npmrc delete mode 100644 test/fixtures/config/builtin delete mode 100644 test/fixtures/config/globalconfig delete mode 100644 test/fixtures/config/malformed delete mode 100644 test/fixtures/config/multi-ca delete mode 100644 test/fixtures/config/userconfig delete mode 100644 test/fixtures/forked-underscore-1.5.1.tgz delete mode 100644 test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-bar.git.tar.gz delete mode 100644 test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-buzz.git.tar.gz delete mode 100644 test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-foo.git.tar.gz delete mode 100644 test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-npm-git-test.git.tar.gz delete mode 100644 test/fixtures/gitignore-and-npmignore-2.tar delete mode 100644 test/fixtures/gitignore-and-npmignore.tar delete mode 100644 test/fixtures/gitignore-and-npmignore.tgz delete mode 100644 test/fixtures/gitignore.tgz delete mode 100644 test/fixtures/npmignore.tgz delete mode 100644 test/fixtures/onload.js delete mode 100644 test/fixtures/scoped-underscore-1.3.1.tgz delete mode 100644 test/fixtures/third-party.md delete mode 100644 test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js delete mode 100644 test/need-npm5-update/belongs-in-pacote/git-races.js delete mode 100644 test/need-npm5-update/ignore-shrinkwrap.js delete mode 100644 test/need-npm5-update/legacy-array-bin.js delete mode 100644 test/need-npm5-update/legacy-dir-bin.js delete mode 100644 test/need-npm5-update/legacy-npm-self-install.js delete mode 100644 test/need-npm5-update/legacy-optional-deps.js delete mode 100644 test/need-npm5-update/legacy-shrinkwrap.js delete mode 100644 test/need-npm5-update/lifecycle-signal.js delete mode 100644 test/need-npm5-update/move-no-clobber-dest-node-modules.js delete mode 100644 test/need-npm5-update/need-only-update-save-optional/update-save.js delete mode 100644 test/need-npm5-update/need-outdated/update-symlink.js delete mode 100644 test/need-npm5-update/outdated-depth-deep.js delete mode 100644 test/need-npm5-update/outdated-depth-integer.js delete mode 100644 test/need-npm5-update/outdated-include-devdependencies.js delete mode 100644 test/need-npm5-update/outdated-local.js delete mode 100644 test/need-npm5-update/outdated-new-versions.js delete mode 100644 test/need-npm5-update/outdated-notarget.js delete mode 100644 test/need-npm5-update/outdated-private.js delete mode 100644 test/need-npm5-update/outdated-symlink.js delete mode 100644 test/need-npm5-update/peer-deps-invalid.js delete mode 100644 test/need-npm5-update/peer-deps-toplevel.js delete mode 100644 test/need-npm5-update/peer-deps-without-package-json.js delete mode 100644 test/need-npm5-update/rm-linked.js delete mode 100644 test/need-npm5-update/shrinkwrap-complete-except-dev.js delete mode 100644 test/need-npm5-update/shrinkwrap-dev-dep-cycle.js delete mode 100644 test/network/git-cache-locking.js delete mode 100644 test/network/git-cache-no-hooks.js delete mode 100644 test/network/legacy-bundled-git.js delete mode 100644 test/network/legacy-url-dep.js delete mode 100644 test/network/registry.js delete mode 100644 test/tap/00-check-mock-dep.js delete mode 100644 test/tap/00-config-setup.js delete mode 100644 test/tap/00-verify-bundle-deps.js delete mode 100644 test/tap/00-verify-ls-ok.js delete mode 100644 test/tap/404-parent.js delete mode 100644 test/tap/404-private-registry-scoped.js delete mode 100644 test/tap/404-private-registry.js delete mode 100644 test/tap/404.js delete mode 100644 test/tap/add-named-update-protocol-port.js delete mode 100644 test/tap/add-remote-git-file.js delete mode 100644 test/tap/add-remote-git-shrinkwrap.js delete mode 100644 test/tap/add-remote-git-submodule.js delete mode 100644 test/tap/add-remote-git.js delete mode 100644 test/tap/adduser-always-auth.js delete mode 100644 test/tap/adduser-legacy-auth.js delete mode 100644 test/tap/adduser-oauth.js delete mode 100644 test/tap/adduser-saml.js delete mode 100644 test/tap/aliases.js delete mode 100644 test/tap/anon-cli-metrics.js delete mode 100644 test/tap/audit-fix.js delete mode 100644 test/tap/audit.js delete mode 100644 test/tap/auto-prune.js delete mode 100644 test/tap/bearer-token-check.js delete mode 100644 test/tap/bin.js delete mode 100644 test/tap/bitbucket-https-url-with-creds-package.js delete mode 100644 test/tap/bitbucket-https-url-with-creds.js delete mode 100644 test/tap/bitbucket-shortcut-package.js delete mode 100644 test/tap/bitbucket-shortcut.js delete mode 100644 test/tap/build-already-built.js delete mode 100644 test/tap/builtin-config.js delete mode 100644 test/tap/bundled-dependencies-nonarray.js delete mode 100644 test/tap/bundled-dependencies.js delete mode 100644 test/tap/bundled-no-add-to-move.js delete mode 100644 test/tap/bundled-transitive-deps.js delete mode 100644 test/tap/cache-add-unpublished.js delete mode 100644 test/tap/cache-eacces-error-message.js delete mode 100644 test/tap/cache-shasum-fork.js delete mode 100644 test/tap/check-cpu-reqs.js delete mode 100644 test/tap/check-engine-reqs.js delete mode 100644 test/tap/check-install-self.js delete mode 100644 test/tap/check-os-reqs.js delete mode 100644 test/tap/check-permissions.js delete mode 100644 test/tap/ci-header.js delete mode 100644 test/tap/ci-permissions.js delete mode 100644 test/tap/circular-dep.js delete mode 100644 test/tap/config-basic.js delete mode 100644 test/tap/config-builtin.js delete mode 100644 test/tap/config-certfile.js delete mode 100644 test/tap/config-credentials.js delete mode 100644 test/tap/config-edit.js delete mode 100644 test/tap/config-envReplace.js delete mode 100644 test/tap/config-list.js delete mode 100644 test/tap/config-malformed.js delete mode 100644 test/tap/config-new-cafile.js delete mode 100644 test/tap/config-private.js delete mode 100644 test/tap/config-project.js delete mode 100644 test/tap/config-save.js delete mode 100644 test/tap/cruft-test.js delete mode 100644 test/tap/debug-logs.js delete mode 100644 test/tap/deprecate.js delete mode 100644 test/tap/dist-tag.js delete mode 100644 test/tap/doctor.js delete mode 100644 test/tap/extraneous-dep-cycle-ls-ok.js delete mode 100644 test/tap/false-name.js delete mode 100644 test/tap/format-package-lock.js delete mode 100644 test/tap/full-warning-messages.js delete mode 100644 test/tap/gently-rm-linked-module.js delete mode 100644 test/tap/gently-rm-overeager.js delete mode 100644 test/tap/gently-rm-symlinked-global-dir.js delete mode 100644 test/tap/gist-short-shortcut-package.js delete mode 100644 test/tap/gist-short-shortcut.js delete mode 100644 test/tap/gist-shortcut-package.js delete mode 100644 test/tap/gist-shortcut.js delete mode 100644 test/tap/git-dependency-install-link.js delete mode 100644 test/tap/git-npmignore.js delete mode 100644 test/tap/git-prepare.js delete mode 100644 test/tap/github-shortcut-package.js delete mode 100644 test/tap/github-shortcut.js delete mode 100644 test/tap/gitlab-shortcut-package.js delete mode 100644 test/tap/gitlab-shortcut.js delete mode 100644 test/tap/global-prefix-set-in-userconfig.js delete mode 100644 test/tap/graceful-restart.js delete mode 100644 test/tap/help.js delete mode 100644 test/tap/hook.js delete mode 100644 test/tap/ignore-install-link.js delete mode 100644 test/tap/ignore-scripts.js delete mode 100644 test/tap/init-create.js delete mode 100644 test/tap/init-interrupt.js delete mode 100644 test/tap/install-actions.js delete mode 100644 test/tap/install-at-locally.js delete mode 100644 test/tap/install-at-sub-path-locally.js delete mode 100644 test/tap/install-bad-dep-format.js delete mode 100644 test/tap/install-bad-man.js delete mode 100644 test/tap/install-before.js delete mode 100644 test/tap/install-bin-null.js delete mode 100644 test/tap/install-cli-only-development.js delete mode 100644 test/tap/install-cli-only-production.js delete mode 100644 test/tap/install-cli-only-shrinkwrap.js delete mode 100644 test/tap/install-cli-production-nosave.js delete mode 100644 test/tap/install-cli-production.js delete mode 100644 test/tap/install-cli-unicode.js delete mode 100644 test/tap/install-contributors-count.js delete mode 100644 test/tap/install-dep-classification.js delete mode 100644 test/tap/install-duplicate-deps-warning.js delete mode 100644 test/tap/install-from-local-multipath.js delete mode 100644 test/tap/install-from-local.js delete mode 100644 test/tap/install-into-likenamed-folder.js delete mode 100644 test/tap/install-link-metadeps-locally.js delete mode 100644 test/tap/install-link-metadeps-subfolders.js delete mode 100644 test/tap/install-link-scripts.js delete mode 100644 test/tap/install-local-dep-cycle.js delete mode 100644 test/tap/install-local-from-local.js delete mode 100644 test/tap/install-man.js delete mode 100644 test/tap/install-mention-funding.js delete mode 100644 test/tap/install-noargs-dev.js delete mode 100644 test/tap/install-order.js delete mode 100644 test/tap/install-package-json-order.js delete mode 100644 test/tap/install-package-lock-only.js delete mode 100644 test/tap/install-parse-error.js delete mode 100644 test/tap/install-property-conflicts.js delete mode 100644 test/tap/install-report-just-installed.js delete mode 100644 test/tap/install-save-consistent-newlines.js delete mode 100644 test/tap/install-save-exact.js delete mode 100644 test/tap/install-save-local.js delete mode 100644 test/tap/install-save-prefix.js delete mode 100644 test/tap/install-scoped-already-installed.js delete mode 100644 test/tap/install-scoped-link.js delete mode 100644 test/tap/install-scoped-with-bundled-dependency.js delete mode 100644 test/tap/install-scoped-with-peer-dependency.js delete mode 100644 test/tap/install-shrinkwrapped-git.js delete mode 100644 test/tap/install-test-cli-with-broken-package-lock.js delete mode 100644 test/tap/install-test-cli-without-package-lock.js delete mode 100644 test/tap/install-windows-newlines.js delete mode 100644 test/tap/install-with-dev-dep-duplicate.js delete mode 100644 test/tap/install-without-registry-config.js delete mode 100644 test/tap/invalid-cmd-exit-code.js delete mode 100644 test/tap/invalid-dep-version-filtering.js delete mode 100644 test/tap/is-fs-access-available.js delete mode 100644 test/tap/is-registry.js delete mode 100644 test/tap/it.js delete mode 100644 test/tap/legacy-ignore-nested-nm.js delete mode 100644 test/tap/legacy-missing-bindir.js delete mode 100644 test/tap/legacy-no-auth-leak.js delete mode 100644 test/tap/legacy-platform-all.js delete mode 100644 test/tap/legacy-platform.js delete mode 100644 test/tap/legacy-private.js delete mode 100644 test/tap/legacy-test-package.js delete mode 100644 test/tap/lifecycle-INIT_CWD.js delete mode 100644 test/tap/lifecycle-order.js delete mode 100644 test/tap/lifecycle-path.js delete mode 100644 test/tap/link.js delete mode 100644 test/tap/local-args-relative-to-cwd.js delete mode 100644 test/tap/lockfile-http-deps.js delete mode 100644 test/tap/logout-scoped.js delete mode 100644 test/tap/logout.js delete mode 100644 test/tap/meta-test-flaky-root-ownership-test.js delete mode 100644 test/tap/nerf-dart.js delete mode 100644 test/tap/nested-extraneous.js delete mode 100644 test/tap/no-global-warns.js delete mode 100644 test/tap/no-scan-full-global-dir.js delete mode 100644 test/tap/noargs-install-config-save.js delete mode 100644 test/tap/node-modules-path-munge.js delete mode 100644 test/tap/normalize-package-explode.js delete mode 100644 test/tap/npm-api-not-loaded-error.js delete mode 100644 test/tap/onload.js delete mode 100644 test/tap/optional-metadep-rollback-collision.js delete mode 100644 test/tap/org.js delete mode 100644 test/tap/outdated-bad-read-tree.js delete mode 100644 test/tap/outdated-color.js delete mode 100644 test/tap/outdated-depth.js delete mode 100644 test/tap/outdated-git.js delete mode 100644 test/tap/outdated-json.js delete mode 100644 test/tap/outdated-latest.js delete mode 100644 test/tap/outdated-long.js delete mode 100644 test/tap/outdated-remote.js delete mode 100644 test/tap/outdated-symlink.js delete mode 100644 test/tap/outdated.js delete mode 100644 test/tap/override-bundled.js delete mode 100644 test/tap/owner.js delete mode 100644 test/tap/pack-files-and-ignores.js delete mode 100644 test/tap/pack-scoped.js delete mode 100644 test/tap/pack.js delete mode 100644 test/tap/peer-deps.js delete mode 100644 test/tap/pick-manifest-from-registry-metadata.js delete mode 100644 test/tap/ping.js delete mode 100644 test/tap/prepare.js delete mode 100644 test/tap/prepublish-only.js delete mode 100644 test/tap/prepublish.js delete mode 100644 test/tap/process-logger.js delete mode 100644 test/tap/progress-config.js delete mode 100644 test/tap/publish-access-scoped.js delete mode 100644 test/tap/publish-access-unscoped-restricted-fails.js delete mode 100644 test/tap/publish-access-unscoped.js delete mode 100644 test/tap/publish-config.js delete mode 100644 test/tap/publish-invalid-semver-tag.js delete mode 100644 test/tap/publish-scoped.js delete mode 100644 test/tap/publish.js delete mode 100644 test/tap/pwd-prefix.js delete mode 100644 test/tap/repo.js delete mode 100644 test/tap/retry-on-stale-cache.js delete mode 100644 test/tap/run-script-filter-private.js delete mode 100644 test/tap/run-script.js delete mode 100644 test/tap/save-optional.js delete mode 100644 test/tap/scope-header.js delete mode 100644 test/tap/scripts-whitespace-windows.js delete mode 100644 test/tap/search.all-package-search.js delete mode 100644 test/tap/search.js delete mode 100644 test/tap/semver-doc.js delete mode 100644 test/tap/shared-linked.js delete mode 100644 test/tap/shrinkwrap-_auth.js delete mode 100644 test/tap/shrinkwrap-default-dev.js delete mode 100644 test/tap/shrinkwrap-dev-dependency.js delete mode 100644 test/tap/shrinkwrap-empty-deps.js delete mode 100644 test/tap/shrinkwrap-extra-metadata.js delete mode 100644 test/tap/shrinkwrap-global-auth.js delete mode 100644 test/tap/shrinkwrap-lifecycle-cwd.js delete mode 100644 test/tap/shrinkwrap-lifecycle.js delete mode 100644 test/tap/shrinkwrap-local-dependency.js delete mode 100644 test/tap/shrinkwrap-nested.js delete mode 100644 test/tap/shrinkwrap-optional-dependency.js delete mode 100644 test/tap/shrinkwrap-optional-platform.js delete mode 100644 test/tap/shrinkwrap-optional-property.js delete mode 100644 test/tap/shrinkwrap-prod-dependency-also.js delete mode 100644 test/tap/shrinkwrap-prod-dependency.js delete mode 100644 test/tap/shrinkwrap-resolve-conflict.js delete mode 100644 test/tap/shrinkwrap-save-dev-with-existing-deps.js delete mode 100644 test/tap/shrinkwrap-save-with-existing-dev-deps.js delete mode 100644 test/tap/shrinkwrap-scoped-auth.js delete mode 100644 test/tap/shrinkwrap-shared-dev-dependency.js delete mode 100644 test/tap/shrinkwrap-version-match.js delete mode 100644 test/tap/sorted-package-json.js delete mode 100644 test/tap/spawn-enoent-help.js delete mode 100644 test/tap/spawn-enoent.js delete mode 100644 test/tap/spec-local-specifiers.js delete mode 100644 test/tap/splat-with-only-prerelease-to-latest.js delete mode 100644 test/tap/startstop.js delete mode 100644 test/tap/symlink-cycle.js delete mode 100644 test/tap/tag-version-prefix.js delete mode 100644 test/tap/tagged-version-matching.js delete mode 100644 test/tap/team.js delete mode 100644 test/tap/test-run-ls.js delete mode 100644 test/tap/tree-style.js delete mode 100644 test/tap/umask-lifecycle.js delete mode 100644 test/tap/uninstall-link-clean.js delete mode 100644 test/tap/uninstall-package.js delete mode 100644 test/tap/uninstall-save.js delete mode 100644 test/tap/unit-child-path.js delete mode 100644 test/tap/unit-deps-earliestInstallable.js delete mode 100644 test/tap/unit-deps-removeObsoleteDep.js delete mode 100644 test/tap/unit-deps-replaceModule.js delete mode 100644 test/tap/unit-module-name.js delete mode 100644 test/tap/unit-package-id.js delete mode 100644 test/tap/unit-token-validate-cidr.js delete mode 100644 test/tap/unpack-foreign-tarball.js delete mode 100644 test/tap/unpublish-config.js delete mode 100644 test/tap/update-examples.js delete mode 100644 test/tap/update-path.js delete mode 100644 test/tap/update-symlink.js delete mode 100644 test/tap/upgrade-lifecycles.js delete mode 100644 test/tap/url-dependencies.js delete mode 100644 test/tap/version.js delete mode 100644 test/tap/whoami.js diff --git a/test/common-config.js b/test/common-config.js deleted file mode 100644 index 003150335483a..0000000000000 --- a/test/common-config.js +++ /dev/null @@ -1,90 +0,0 @@ -if (module === require.main) { - console.log('1..1') - console.log('ok 1 setup done') - process.exit(0) -} - -var fs = require('graceful-fs') -var path = require('path') -var userconfigSrc = path.resolve(__dirname, 'fixtures', 'config', 'userconfig') -exports.userconfig = userconfigSrc + '-with-gc' -exports.globalconfig = path.resolve(__dirname, 'fixtures', 'config', 'globalconfig') - -// if this hasn't been written yet, then do it now. -try { - fs.statSync(exports.userconfig) -} catch (er) { - var uc = fs.readFileSync(userconfigSrc) - var gcini = 'globalconfig = ' + exports.globalconfig + '\n' - // atomic! - fs.writeFileSync(exports.userconfig + '.' + process.pid, gcini + uc) - fs.renameSync(exports.userconfig + '.' + process.pid, exports.userconfig) -} - -exports.builtin = path.resolve(__dirname, 'fixtures', 'config', 'builtin') -exports.malformed = path.resolve(__dirname, 'fixtures', 'config', 'malformed') -exports.ucData = - { globalconfig: exports.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'init.version': '1.2.3', - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': path.normalize(process.env.HOME + '/.tmp'), - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - -// set the userconfig in the env -// unset anything else that npm might be trying to foist on us -Object.keys(process.env).forEach(function (k) { - if (k.match(/^npm_config_/i)) { - delete process.env[k] - } -}) -process.env.npm_config_userconfig = exports.userconfig -process.env.npm_config_other_env_thing = '1000' -process.env.random_env_var = 'asdf' -process.env.npm_config__underbar_env_thing = 'underful' -process.env.NPM_CONFIG_UPPERCASE_ENV_THING = '42' - -exports.envData = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': '42', - 'other-env-thing': '1000' -} -exports.envDataFix = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': 42, - 'other-env-thing': 1000 -} - -var projectConf = path.resolve(__dirname, '..', '.npmrc') -try { - fs.statSync(projectConf) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectConf, '') -} - -var projectRc = path.join(__dirname, 'fixtures', 'config', '.npmrc') -try { - fs.statSync(projectRc) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectRc, 'just = testing') -} diff --git a/test/common-tap.js b/test/common-tap.js deleted file mode 100644 index f570cfa6b8cd5..0000000000000 --- a/test/common-tap.js +++ /dev/null @@ -1,276 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ - -const configCommon = require('./common-config.js') -var fs = require('graceful-fs') -var isWindows = require('../lib/utils/is-windows.js') -var Bluebird = require('bluebird') - -if (isWindows) { - var PATH = process.env.PATH ? 'PATH' : 'Path' - process.env[PATH] += ';C:\\Program Files\\Git\\mingw64\\libexec\\git-core' -} - -// remove any git envs so that we don't mess with the main repo -// when running git subprocesses in tests -Object.keys(process.env).filter(k => /^GIT/.test(k)).forEach( - k => delete process.env[k] -) - -// cheesy hackaround for test deps (read: nock) that rely on setImmediate -if (!global.setImmediate || !require('timers').setImmediate) { - require('timers').setImmediate = global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -var spawn = require('child_process').spawn -const spawnSync = require('child_process').spawnSync -var path = require('path') - -// space these out to help prevent collisions -const testId = 3 * (+process.env.TAP_CHILD_ID || 0) - -// provide a working dir unique to each test -const main = require.main.filename -const testName = path.basename(main, '.js') -exports.pkg = path.resolve(path.dirname(main), testName) -var commonCache = path.resolve(__dirname, 'npm_cache_' + testName) -exports.cache = commonCache - -const mkdirp = require('mkdirp') -const rimraf = require('rimraf') -rimraf.sync(exports.pkg) -rimraf.sync(commonCache) -mkdirp.sync(exports.pkg) -mkdirp.sync(commonCache) -// if we're in sudo mode, make sure that the cache is not root-owned -const isRoot = process.getuid && process.getuid() === 0 -const isSudo = isRoot && process.env.SUDO_UID && process.env.SUDO_GID -if (isSudo) { - const sudoUid = +process.env.SUDO_UID - const sudoGid = +process.env.SUDO_GID - fs.chownSync(commonCache, sudoUid, sudoGid) -} - -const returnCwd = path.dirname(__dirname) -const find = require('which').sync('find') -require('tap').teardown(() => { - // work around windows folder locking - process.chdir(returnCwd) - process.on('exit', () => { - try { - if (isSudo) { - // running tests as sudo. ensure we didn't leave any root-owned - // files in the cache by mistake. - const args = [ commonCache, '-uid', '0' ] - const found = spawnSync(find, args) - const output = found && found.stdout && found.stdout.toString() - if (output.length) { - const er = new Error('Root-owned files left in cache!') - er.testName = main - er.files = output.trim().split('\n') - throw er - } - } - if (!process.env.NO_TEST_CLEANUP) { - rimraf.sync(exports.pkg) - rimraf.sync(commonCache) - } - } catch (e) { - if (process.platform !== 'win32') { - throw e - } - } - }) -}) - -var port = exports.port = 15443 + testId -exports.registry = 'http://localhost:' + port - -exports.altPort = 7331 + testId - -exports.gitPort = 4321 + testId - -var fakeRegistry = require('./fake-registry.js') -exports.fakeRegistry = fakeRegistry - -const ourenv = {} -ourenv.npm_config_loglevel = 'error' -ourenv.npm_config_progress = 'false' -ourenv.npm_config_metrics = 'false' -ourenv.npm_config_audit = 'false' - -ourenv.npm_config_unsafe_perm = 'true' -ourenv.npm_config_cache = commonCache -ourenv.npm_config_userconfig = exports.npm_config_userconfig = configCommon.userconfig -ourenv.npm_config_globalconfig = exports.npm_config_globalconfig = configCommon.globalconfig -ourenv.npm_config_global_style = 'false' -ourenv.npm_config_legacy_bundling = 'false' -ourenv.npm_config_fetch_retries = '0' -ourenv.npm_config_update_notifier = 'false' -ourenv.random_env_var = 'foo' -// suppress warnings about using a prerelease version of node -ourenv.npm_config_node_version = process.version.replace(/-.*$/, '') -for (let key of Object.keys(ourenv)) process.env[key] = ourenv[key] - -var bin = exports.bin = require.resolve('../bin/npm-cli.js') - -var chain = require('slide').chain -var once = require('once') - -var nodeBin = exports.nodeBin = process.env.npm_node_execpath || process.env.NODE || process.execPath - -exports.npm = function (cmd, opts, cb) { - if (!cb) { - var prom = new Bluebird((resolve, reject) => { - cb = function (err, code, stdout, stderr) { - if (err) return reject(err) - return resolve([code, stdout, stderr]) - } - }) - } - cb = once(cb) - cmd = [bin].concat(cmd) - opts = Object.assign({}, opts || {}) - - opts.env = opts.env || process.env - if (opts.env._storage) opts.env = Object.assign({}, opts.env._storage) - if (!opts.env.npm_config_cache) { - opts.env.npm_config_cache = commonCache - } - if (!opts.env.npm_config_unsafe_perm) { - opts.env.npm_config_unsafe_perm = 'true' - } - if (!opts.env.npm_config_send_metrics) { - opts.env.npm_config_send_metrics = 'false' - } - if (!opts.env.npm_config_audit) { - opts.env.npm_config_audit = 'false' - } - - nodeBin = opts.nodeExecPath || nodeBin - - var stdout = '' - var stderr = '' - var child = spawn(nodeBin, cmd, opts) - - if (child.stderr) { - child.stderr.on('data', function (chunk) { - stderr += chunk - }) - } - - if (child.stdout) { - child.stdout.on('data', function (chunk) { - stdout += chunk - }) - } - - child.on('error', cb) - - child.on('close', function (code) { - cb(null, code, stdout, stderr) - }) - return prom || child -} - -exports.makeGitRepo = function (params, cb) { - // git must be called after npm.load because it uses config - var git = require('../lib/utils/git.js') - - var root = params.path || process.cwd() - var user = params.user || 'PhantomFaker' - var email = params.email || 'nope@not.real' - var added = params.added || ['package.json'] - var message = params.message || 'stub repo' - - var opts = { cwd: root, env: { PATH: process.env.PATH || process.env.Path } } - var commands = [ - git.chainableExec(['init'], opts), - git.chainableExec(['config', 'user.name', user], opts), - git.chainableExec(['config', 'user.email', email], opts), - // don't time out tests waiting for a gpg passphrase or 2fa - git.chainableExec(['config', 'commit.gpgSign', 'false'], opts), - git.chainableExec(['config', 'tag.gpgSign', 'false'], opts), - git.chainableExec(['config', 'tag.forceSignAnnotated', 'false'], opts), - git.chainableExec(['add'].concat(added), opts), - git.chainableExec(['commit', '-m', message], opts) - ] - - if (Array.isArray(params.commands)) { - commands = commands.concat(params.commands) - } - - chain(commands, cb) -} - -exports.skipIfWindows = function (why) { - if (!isWindows) return - if (!why) why = 'this test not available on windows' - require('tap').plan(0, why) - process.exit(0) -} - -exports.pendIfWindows = function (why) { - if (!isWindows) return - if (!why) why = 'this test is pending further changes on windows' - require('tap').fail(' ', { todo: why, diagnostic: false }) - process.exit(0) -} - -exports.withServer = cb => { - return fakeRegistry.compat().tap(cb).then(server => server.close()) -} - -exports.newEnv = function () { - return new Environment(process.env) -} - -exports.emptyEnv = function () { - const filtered = {} - for (let key of Object.keys(process.env)) { - if (!/^npm_/.test(key)) filtered[key] = process.env[key] - } - for (let key of Object.keys(ourenv)) { - filtered[key] = ourenv[key] - } - return new Environment(filtered) -} - -function Environment (env) { - if (env instanceof Environment) return env.clone() - - Object.defineProperty(this, '_storage', { - value: Object.assign({}, env) - }) -} -Environment.prototype = {} - -Environment.prototype.delete = function (key) { - var args = Array.isArray(key) ? key : arguments - var ii - for (ii = 0; ii < args.length; ++ii) { - delete this._storage[args[ii]] - } - return this -} - -Environment.prototype.clone = function () { - return new Environment(this._storage) -} - -Environment.prototype.extend = function (env) { - var self = this.clone() - var args = Array.isArray(env) ? env : arguments - var ii - for (ii = 0; ii < args.length; ++ii) { - var arg = args[ii] - if (!arg) continue - Object.keys(arg).forEach(function (name) { - self._storage[name] = arg[name] - }) - } - return self -} diff --git a/test/fake-registry.js b/test/fake-registry.js deleted file mode 100644 index e09e154c76514..0000000000000 --- a/test/fake-registry.js +++ /dev/null @@ -1,156 +0,0 @@ -'use strict' -const common = require('./common-tap.js') -const Bluebird = require('bluebird') -const silentLogger = { - http: () => {}, - silly: () => {} -} - -const log = process.env.TAP_CHILD_ID - ? silentLogger - : require('npmlog') - -const http = require('http') -const EventEmitter = require('events') -// See fake-registry.md for details - -class FakeRegistry extends EventEmitter { - constructor (opts) { - if (!opts) opts = {} - super(opts) - this.mocks = {} - this.port = opts.port || common.port - this.registry = 'http://localhost:' + this.port - this.server = http.createServer() - if (!opts.keepNodeAlive) this.server.unref() - this.server.on('request', (req, res) => { - if (this.mocks[req.method] && this.mocks[req.method][req.url]) { - this.mocks[req.method][req.url](req, res) - } else { - res.statusCode = 404 - res.end(JSON.stringify({error: 'not found'})) - } - log.http('fake-registry', res.statusCode || 'unknown', '→', req.method, req.url) - }) - this._error = err => { - log.silly('fake-registry', err) - this.emit('error', err) - } - this._addErrorHandler() - } - reset () { - this.mocks = {} - return this - } - close () { - this.reset() - this._removeErrorHandler() - return new Promise((resolve, reject) => { - this.server.once('error', reject) - this.server.once('close', () => { - this.removeListener('error', reject) - resolve(this) - }) - this.server.close() - }) - } - _addErrorHandler () { - this.server.on('error', this._error) - } - _removeErrorHandler () { - if (!this._error) return - this.server.removeListener('error', this._error) - } - listen (cb) { - this._removeErrorHandler() - return this._findPort(this.port).then(port => { - this._addErrorHandler() - this.port = port - this.registry = 'http://localhost:' + port - common.port = this.port - common.registry = this.registry - return this - }).asCallback(cb) - } - _findPort (port) { - return new Bluebird((resolve, reject) => { - let onListening - const onError = err => { - this.server.removeListener('listening', onListening) - if (err.code === 'EADDRINUSE') { - return resolve(this._findPort(++port)) - } else { - return reject(err) - } - } - onListening = () => { - this.server.removeListener('error', onError) - resolve(port) - } - this.server.once('error', onError) - this.server.once('listening', onListening) - this.server.listen(port) - }) - } - - mock (method, url, respondWith) { - log.http('fake-registry', 'mock', method, url, respondWith) - if (!this.mocks[method]) this.mocks[method] = {} - if (typeof respondWith === 'function') { - this.mocks[method][url] = respondWith - } else if (Array.isArray(respondWith)) { - const [status, body] = respondWith - this.mocks[method][url] = (req, res) => { - res.statusCode = status - if (typeof body === 'object') { - res.end(JSON.stringify(body)) - } else { - res.end(String(body)) - } - } - } else { - throw new Error('Invalid args, expected: mr.mock(method, url, [status, body])') - } - return this - } - - // compat - done () { - this.reset() - } - filteringRequestBody () { - return this - } - post (url, matchBody) { - return this._createReply('POST', url) - } - get (url) { - return this._createReply('GET', url) - } - put (url, matchBody) { - return this._createReply('PUT', url) - } - delete (url) { - return this._createReply('DELETE', url) - } - _createReply (method, url) { - const mr = this - return { - twice: function () { return this }, - reply: function (status, responseBody) { - mr.mock(method, url, [status, responseBody]) - return mr - } - } - } -} - -module.exports = new FakeRegistry() -module.exports.FakeRegistry = FakeRegistry -module.exports.compat = function (opts, cb) { - if (arguments.length === 1 && typeof opts === 'function') { - cb = opts - opts = {} - } - return new FakeRegistry(Object.assign({keepNodeAlive: true}, opts || {})).listen(cb) -} diff --git a/test/fake-registry.md b/test/fake-registry.md deleted file mode 100644 index 604fda41670be..0000000000000 --- a/test/fake-registry.md +++ /dev/null @@ -1,198 +0,0 @@ -# FakeRegistry - -This is a replacement for npm-registry-mock in times where its fixtures are -not used. (Adding support for its standard fixtures is TODO, but should be -straightforward—tacks-ify them and call `mr.mock…` - -# Usage - -The intent is for this to be a drop in replacement for npm-registry-mock -(and by extension hock). New scripts will be better served using its native -interface, however. - -# Main Interface - -## Logging - -All requests the mock registry receives are logged at the `http` level. You can -see these by running your tests with: - -``` -npm --loglevel=http run tap test/tap/name-of-test.js -``` - -Or directly with: - -``` -npm_config_loglevel=http node test/tap/name-of-test.js -``` - -## Construction - -Ordinarily there's no reason to construct more than one FakeRegistyr object -at a time, as it can be entirely reset between tests, so best practice -would be to use its singleton. - -``` -const common = require('../common-tap.js') -const mr = common.fakeRegistry -``` - -If you have need of multiple registries at the same time, you can construct -them by hand: - -``` -const common = require('../common-tap.js') -const FakeRegistry = common.fakeRegistry.FakeRegistry -const mr = new FakeRegistry(opts) -``` - -## new FakeRegistry(opts) - -Valid options are: - -* `opts.port` is the first port to try when looking for an available port. If it - is unavialable it will be incremented until one available is found. - - The default value of `port` is taken from `common.npm`. - -* `opts.keepNodeAlive` will instruct FakeRegistry to not unref the - underlying server. - -## mr.reset() → this - -Reset all mocks to their default values. Further requests - -## mr.listen() → Promise(mr) - -Start listening for connections. The promise resolves when the server is -online and ready to accept connections. - -`mr.port` and `mr.registry` contain the port that was actually selected. - -To ease compatibility, `common` will also have its `port` and `registry` -values updated at this time. Note that this means `common.port` refers -to the port of the most recent listening server. Each server will maintain -its own `mr.port`. - -Any errors emitted by the server while it was coming online will result in a -promise rejection. - -## mr.mock(method, url, respondWith) → this - -Adds a new route that matches `method` (should be all caps) and `url`. - -`respondWith` can be: - -* A function, that takes `(request, response)` as arguments and calls - [`response` methods](https://nodejs.org/api/http.html#http_class_http_serverresponse) - to do what it wants. Does not have a return value. This function may be - async (the response isn't complete till its stream completes), typically - either because you piped something into it or called `response.end()`. -* An array of `[statusCode, responseBody]`. `responseBody` may be a string or - an object. Objects are serialized with `JSON.stringify`. - -## mr.close() → Promise(mr) - -Calls `mr.reset()` to clear the mocks. - -Calls `.close()` on the http server. The promise resolves when the http -server completes closing. Any errors while the http server was closing will -result in a rejection. If running with `keepNodeAlive` set this call -is required for node to exit the event loop. - -# Events - -## mr.on('error', err => { … }) - -Error events from the http server are forwarded to the associated fake -registry instance. - -The exception to this is while the `mr.listen()` and `mr.close()` promises -are waiting to complete. Those promises capture any errors during their duration -and turn them into rejections. (Errors during those phases are very rare.) - -# Compat Interface - -## Differences - -### Ports - -You aren't guaranteed to get the port you ask for. If the port you asked -for is in use, it will be incremented until an available port is found. - -`server.port` and `server.registry` contain the port that was actually selected. - -For compatibility reasons: - -`common.port` and `common.registry` will contain the port of the most recent -instance of FakeRegistry. Usually these there is only one instance and so -this has the same value as the per-server attributes. - -This means that if your fixtures make use of the port or server address they -need to be configured _after_ you construct - -### Request Bodies - -Request bodies are NOT matched against. Two routes for the same URL but different -request bodies will overwrite one another. - -### Call Count Assertions - -That is, things like `twice()` that assert that the end point will be hit -two times are not supported. This library does not provide any assertions, -just a barebones http server. - -### Default Route Behavior - -If no route can be found then a `404` response will be provided. - -## Construction - -const common = require('../common-tap.js') -const mr = common.fakeRegistry.compat - -### mr(options[, callback]) → Promise(server) - -Construct a new mock server. Hybrid, callback/promise constructor. Options -are `port` and `keepNodeAlive`. `keepNodeAlive` defaults to `true` for -compatibility mode and the default value of port comes from `common.port`. - -### done() - -Resets all of the configured mocks. - -### close() - -Calls `this.reset()` and `this.server.close()`. To reopen this instance use -`this.listen()`. - -### filteringRequestBody() - -Does nothing. Bodies are never matched when routing anyway so this is unnecessary. - -### get(url) → MockReply -### delete(url) → MockReply -### post(url, body) → MockReply -### put(url, body) → MockReply - -Begins to add a route for an HTTP method and URL combo. Does not actually -add it till `reply()` is called on the returned object. - -Note that the body argument for post and put is always ignored. - -## MockReply methods - -### twice() → this - -Does nothing. Call count assertions are not supported. - -### reply(status, responseBody) - -Actually adds the route, set to reply with the associated status and -responseBody. - -Currently no mime-types are set. - -If `responseBody` is `typeof === 'object'` then `JSON.stringify()` will be -called on it to serialize it, otherwise `String()` will be used. diff --git a/test/fixtures/config/.npmrc b/test/fixtures/config/.npmrc deleted file mode 100644 index 7d59bd8be1b82..0000000000000 --- a/test/fixtures/config/.npmrc +++ /dev/null @@ -1 +0,0 @@ -just = testing diff --git a/test/fixtures/config/builtin b/test/fixtures/config/builtin deleted file mode 100644 index dcd542c0ceacf..0000000000000 --- a/test/fixtures/config/builtin +++ /dev/null @@ -1 +0,0 @@ -builtin-config = true diff --git a/test/fixtures/config/globalconfig b/test/fixtures/config/globalconfig deleted file mode 100644 index 41c0b70c80f05..0000000000000 --- a/test/fixtures/config/globalconfig +++ /dev/null @@ -1 +0,0 @@ -package-config:foo = boo diff --git a/test/fixtures/config/malformed b/test/fixtures/config/malformed deleted file mode 100644 index 182c4d2c71ce2..0000000000000 --- a/test/fixtures/config/malformed +++ /dev/null @@ -1 +0,0 @@ -email = """ \ No newline at end of file diff --git a/test/fixtures/config/multi-ca b/test/fixtures/config/multi-ca deleted file mode 100644 index 0bc922b25c59a..0000000000000 --- a/test/fixtures/config/multi-ca +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICjTCCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx -NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz -dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw -ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu -ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 -ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp -miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ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2UgQWRtaW5pc3RyYXRpb24x -DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR -MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB -AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 -X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 -WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO ------END CERTIFICATE----- diff --git a/test/fixtures/config/userconfig b/test/fixtures/config/userconfig deleted file mode 100644 index ecc2f043f7fbf..0000000000000 --- a/test/fixtures/config/userconfig +++ /dev/null @@ -1,22 +0,0 @@ -email = i@izs.me -env-thing = ${random_env_var} -init.author.name = Isaac Z. Schlueter -init.author.email = i@izs.me -init.author.url = http://blog.izs.me/ -init.version = 1.2.3 -npm:publishtest = true -_npmjs.org:couch = https://admin:password@localhost:5984/registry -npm-www:nocache = 1 -nodedir = /Users/isaacs/dev/js/node-v0.8 -sign-git-tag = true -message = v%s -strict-ssl = false -tmp = ~/.tmp -_auth = dXNlcm5hbWU6cGFzc3dvcmQ= - -[_token] -AuthSession = yabba-dabba-doodle -version = 1 -expires = 1345001053415 -path = / -httponly = true diff --git a/test/fixtures/forked-underscore-1.5.1.tgz b/test/fixtures/forked-underscore-1.5.1.tgz deleted file mode 100644 index 5aca6247ac395de449e8dd6bc758591aff21a0b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 583 zcmV-N0=WGjiwFS5j@nZI1MQYeZ`&{o$8*l75OmoFbbh3^gLQ9UmlfD)y$w4k4r42k zC4-XF1x3I6B-?plK)Xw`VHkf1ESsW8%74>NE6RN1RvUzBH-~V}Dq}2a^g1aeWT#E)cJ8;E#=RXH% zOM}2Kg2xhUiL!OlXg+vci>>(D+n!mr>U0_Agkmk43PsaMU9lQe3&@mQpuk-;gsM#g zt$)<`AzAHQdlkpWoNF5ytOoZD>~0M%?ZN#U@0?Wpg7IV4aOK6@0*13vNzg8wEzsP0 zJOAE?5}m6J@{?^|146T7A8ow>Ei8Mp?hPN7rtBIYqg19_hFabY#UQlCN@sA#hX{Av z?ONbIR3-b29jful@5mqPZV{EHiPvJxak9-Qthw(4H$v)%6!1McWcS;%qX45*8s$;C zS7`eQTJWoMDZ%<8g0z03t%Y``SqGC}@G44Prrb{ri3eFv+#OgKJP*rQu*6#**U8CM>Qz^3$%D#2j!7+i7C1?vLMSuBx!>9N3T_Fg9AP9mW2!bF8f*=Tj VAP9mW2!eQ0egb=Ui0l9;005~gBh>%^ diff --git a/test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-bar.git.tar.gz b/test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-bar.git.tar.gz deleted file mode 100644 index fb27e17f4812fa2bc5bb5630e195df0fcc1c9d58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12585 zcmV+^G1kr>iwFQ8PC-=w1MNKtcoWsufFd*?6a@to7}7!)nq+2@nIwg_l$L#m0tzkd zWR^BG$%IToTM7z35L7@^7D3>bO%N0m5oJ?BksY22MNmOO7C}%zL_zVt_s(SL0&Vj& zeLi#iu*u{u=brtXdvB6!b?1338dkJxy10rMN4n?`$1n~J=ds(1G!Ca-V_{s{T&r7G zD`>!R+(=Ov`b*1yand0FRRAMMiUbd7BTiyCNl-Xl3!{Rcvg+WG+>8sL;^Hkl%QClZ z2bu}O9mY}C;rshHf!r$dpA{W~H8+?!06l1f;r9F|X}S#mN${r@hX2`%tqA_%{2#%J zEYR*xa{u2aIM*sCj0~OZ)P{0s}gR%1*=GXs@7|&VV zm^;rZVNmh0m;lblU~UnEJ;3LDKqqZjCI6mKb^Y(rH8nlBIV#hCoHUm8|Ad|h>whS~ z#S4i*j|EAW$1|Lyvon&L4?Ea@3{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wDvdP)Riw}J_7hqsMeM&rLi zA}oWYZ)hC}2F;FZE-*Llgb#+{!+p4T3UQeuVNyICN_3C4c0E;Y>+)k|v7e6w94|HK zrQbH8qMv0#rE9$6mT-a*MMJiXLvcq(Ne?EBRUqNjg%%`OKlp$G6pNuF`ZhY~2;`>v z88uK7{k6+#cC26oUTe@#S?bpi@a~*ZX|)oSMMT1;s3E z+Q>6I5_t(n<@NfVzEOuy3^owPgm^MEe$&oG4vEhFq0@i*dfCgp5A@#g_xd2smKjBnUEwiiZ9b{V2W&}_4M%I2U=o_zEX}07wcd$sZI)yKJx1^3 zrcLGsmLC2BgWZ5|z1Fj8HP%%D52}#3*1ooVYfE zs91B7EiZ0x4E~jx(F2pP1O4Bz(8Rt4NlRWtGcVH~dHcEW)g!57dTZ$JVLYsAxkF3J z)U4mnvDTzf|Eopk>-d(KH(QXUhA2ukZ{sCCA8fNUF;4o?d*pBn!TzCLZwWgjRF{j! z&gG-ielev(1ya4qEoO}~d@?HR~G1~QO=3}oOK@c#ksBw7&w@Bjey CYO7cP diff --git a/test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-foo.git.tar.gz b/test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-foo.git.tar.gz deleted file mode 100644 index 8e1abc6d05e704f29f8699e6e44e63e4e6a6f2dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12712 zcmb8TWmjEI(>2P*-QC?SxFom)2oAwLXmIz<#)Ae61b24{?g4_kdvJG$z202Ueg44t zvc~8h)pJ#is_r?fsG^Z!xKt#yVc^a_pm^iWFR)|PftJ+?!)Q3%m3er7{-jT?PpNnM zp&Y8g*wC1#z-X1oX&)6F%uF4OjM_qt988V+rS{4O!jciA?-5 z=JNPyo)(dOh=VUSuRG?Nh>2yd29;QHhTi*+E;4z)LNH^Q9WljIG67QesYNFYL5(Sq zP+X_2=+q~Cr+0B}aa)_+D7#u|K;|wXg>b?c=&)C9Zv07==Mx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btTQO((}9*wOCpUbz-*&PHDYFJ>u^= zuoA?d88T<^+v^rw~x%4*9HO#M=R6fYLQt#>U8(kz;YfS}7 zzOb`Vo>_eH?B_!4t%$J4ybY1I2qTK@`=Ax$i0X&mR<0E@D{cZtO4IW;!@O)RV}R781RDN*yx}T{-_;CI3rZc@}E!AH8*f z$gzr3xrU!v=1m43T8{DIS+KcHH#TswW$fh5}cisB#iNQ{(J>!I>We_3;B*&dF z@r&eAw&Kj>89y86Rk$}K)z0-l)V&><;<~9=6>q^(NO*;{vMwIgrbIH;p+zUv*@ACe d$xUB#A&8_l|NlO{0R5|YmG0d&j06bg{{f#JN)`YB diff --git a/test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-npm-git-test.git.tar.gz b/test/fixtures/mygithub.libinneed.workers.dev-BryanDonovan-npm-git-test.git.tar.gz deleted file mode 100644 index 7a4b9e813173126fa20aa514672041140f7b3174..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9521 zcmb7KWmB9@ltqHS1a}MW?gSWIf&>W(?hxEvGPrw!ySuwikl;3WumpE^nRzx_`wR9< zf9Sr|_tcf{bE=yr79HVPOBQ0Ndu~7X_gv!z5S4 zFOB(|hvp}*O zzEvn`ZIimjm2zwR-Qti2#(mHXqXBb%@pm9^_A3lzYq+!WZ5o;lN0YfS2XGYnp@3Tu zQ|YmEqIMTVXIpL~f6GI5j?xj{CY65&(a~AEgC6`bX=DqHvzXMdVHT%%4g%(D8xuX~*mQ4APdGBPT#ACiXm* zknZ&UhPynjyQukoSvGyz_wpx|b3&KfiHUJ+TR?$$p8w9mV?Q>yQWxmWoacr;bya`s z+Z438zrSgMh7 zAZxA>CqIBE*&msbLzt*2%1awoq9hX)@x6b5viAu5j+A=|uo;2^O;RI&zqf<r8$9&Y8$>CNv8NnHK6 zzUFef_x^45zS3)t>(%s5N;HDkD~Sh2SNT&WmoFRbv`OzxVTF+=v3X*a&xu0k?Phb* z2axJN0hh`riCy=X_RO%S;EOtH|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$-Vc|RBp93O^hsGndw(IJJvQG!?}Dz8$qwPH_1xZMCw8gKSFQR P<6R4`LIpwvE~^5cBD1?? diff --git a/test/fixtures/gitignore-and-npmignore.tar b/test/fixtures/gitignore-and-npmignore.tar deleted file mode 100644 index 8b638b114a5e0881218f55aa7fa07addb49c2bc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10240 zcmeH~QE!4U5XX7;Qy88nYfDRI$v%szSea8O0k$kz_T6{Qh8i#`ijIZr%R#Tbw!iDY zluUih;*FWB&Fn?1h0dMs3xN^@fnzO{x&kiMyXlGvZrOsvL&Q zjVYVnUCk-~&)Rm2+x6`AlVIb>B#BPTXE7CQK_VJby40Z*OsNI)L#m||(bA_xMPwfO z(^0P%gp+GUAXCv=#rm;TrU6asTtF5BG(e&1f(1!1Z6{AMOErP`Z7*DF4F8 z{CAs%gVCz||61?0FzLaDS5%(Nzohm5KQ1}u{|e-1cl{iV$8M?;?LL9cl1ZtHal;@yj;= diff --git a/test/fixtures/gitignore-and-npmignore.tgz b/test/fixtures/gitignore-and-npmignore.tgz deleted file mode 100644 index 4be4364104f570e282888cc7b321d212a29d0002..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmV-u0hj(CiwFo=pX*Zs17~S;X=iS4a%C-HZe%TPaBXR4Zf|mBE_7jX0PWY^PJ=K2 z1>j!u6bsi5`nwJjpJnM-hv;ZYL1SWkcROReU~%3^gXVlUC6t7a!zraVFT3XC_vW;_ zx8`62`F%9nY&IWbG#%rlB#aBqHPednc%DhcDQQRoPs3BNSiN zzU!Z4%P)O25oZAReV=uQ1-8e7hJk8>a5JM?}3 z;CV0|1b7`f(eQKC(J+Y1D2J)639Pc{-0y zG9*sM+KxsvErrr|Z!Dz?rFK)LE$7=@F@Yf0d$cppr|Rmhxt{KvIlG?xJQ^vb-fJ|i zaZwP)3(YmtijDV~kerf=Y~XPSrjJMV-iM`q->pv{?vIc>Eq&9tHr$@AvfK*GE|xMW zN@4Ut7-{ovcp`>)w7 z|FuB>xA2mrY1W#?Wye^%W*6KLcAq~3+0D5AKG^bheijM{W0000000000 R006-6^ahDOx=;Wp0079{r6vFX diff --git a/test/fixtures/npmignore.tgz b/test/fixtures/npmignore.tgz deleted file mode 100644 index 765593decb0a7be1b2c9965e4f542d539d1979ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 320 zcmV-G0l)qqiwFq6pX*Zs18#6_X=iS4a%C=bVR8WN*3C|YFc1guo_Pww*=76P#l&aX zRJP#iLJ3r3VtjXtdV+`-A!`1=kPKm(G|eyroqaym7k_In$2(_Ft|vc_Mq2Cl7)@hL zO2W7>+%TgJkI$J@f|8nS;Bg4Hk6ZTMhoyDj<)?@HBNR_d-!!fbH_T9R5(g@kiWe&i zYAb3LS4HUx#mu3sq|=Ng1pbZAmJhae`!)9%`@tCXb^pivN&j=H4N>U-&FY`GU30Em z-@CQuzg(#QeEv%v^QiyoD(^ARG5`1RJy>=AFZcg!{tKoB`hUavf5!ZN@a^XHH*7Zl zjY9pm@RFoy*4oBp*D-d@F1R7=>T~$`8OW~2{FCd4vv0>GJf}I$l2?2*0000000000 S00000ey2D5RPjmxC;$Mm)}o*Q diff --git a/test/fixtures/onload.js b/test/fixtures/onload.js deleted file mode 100644 index 90c1a3aa55e77..0000000000000 --- a/test/fixtures/onload.js +++ /dev/null @@ -1 +0,0 @@ -console.error('called onload') diff --git a/test/fixtures/scoped-underscore-1.3.1.tgz b/test/fixtures/scoped-underscore-1.3.1.tgz deleted file mode 100644 index d98a345996b5b4eb6aaa9f82233f0b1f9ef503eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55415 zcmV(%K;pk2iwFRW#G6zA1MI!~e%nT}FnIpfQ^3rQMaCpW%9fpxO!+9boG9blTF&Im zPw}UK1W3XH0R{jqF}5CPUtnM0d$Fxs-$3vp*_kEb#--hU8nxw!XJe@ z|M4gObvm6#dwU*zKIG5N?gRdmKd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X^2H>-B7j}MXa$Gz-jj9t za2hO%O~8=^T@k>U0bSx$1b~?nmdZ&fG5vQ-W9a_hVJAKC;hzuB_Q%n*Fwy=8;@P4% diff --git a/test/fixtures/third-party.md b/test/fixtures/third-party.md deleted file mode 100644 index 625a798bcd7f7..0000000000000 --- a/test/fixtures/third-party.md +++ /dev/null @@ -1,25 +0,0 @@ -"scoped-underscore-1.3.1.tgz" includes content from the Underscore package, -including code adapted from ES 5.1 section 15.12.3, abstract operation -`JO`, used under the following license: - -Copyright (c) Ecma International 2010 - -DISCLAIMER This document may be copied and furnished to others, and -derivative works that comment on or otherwise explain it or assist in its -implementation may be prepared, copied, published, and distributed, in -whole or in part, without restriction of any kind, provided that the above -copyright notice and this section are included on all such copies and -derivative works. However, this document itself may not be modified in any -way, including by removing the copyright notice or references to Ecma -International, except as needed for the purpose of developing any document -or deliverable produced by Ecma International. - -The limited permissions are granted through the standardization phase and -will not be revoked by Ecma International or its successors or assigns -during this time. - -This document and the information contained herein is provided on an "AS -IS" basis and ECMA INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE -INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED -WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. diff --git a/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js b/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js deleted file mode 100644 index fadfc330fb851..0000000000000 --- a/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict' -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') -var npa = require('npm-package-arg') - -var getResolved = null - -/** - * Note: This is here because `normalizeGitUrl` is usually called - * before getResolved is, and receives *that* URL. - */ -function tryGetResolved (uri, treeish) { - return getResolved(npa(uri), uri, treeish) -} - -test('setup', function (t) { - var opts = { - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - getResolved = require('../../lib/cache/add-remote-git.js').getResolved - t.end() - }) -}) - -test('add-remote-git#get-resolved git: passthru', function (t) { - verify('git:github.com/foo/repo') - verify('git:github.com/foo/repo.git') - verify('git://github.com/foo/repo#decadacefadabade') - verify('git://github.com/foo/repo.git#decadacefadabade') - - function verify (uri) { - t.equal( - tryGetResolved(uri, 'decadacefadabade'), - 'git://github.com/foo/repo.git#decadacefadabade', - uri + ' normalized to canonical form git://github.com/foo/repo.git#decadacefadabade' - ) - } - t.end() -}) - -test('add-remote-git#get-resolved SSH', function (t) { - t.comment('tests for https://github.com/npm/npm/issues/7961') - verify('git+ssh://git@github.com:foo/repo') - verify('git+ssh://git@github.com:foo/repo#master') - verify('git+ssh://git@github.com/foo/repo#master') - verify('git+ssh://git@github.com/foo/repo#decadacefadabade') - - function verify (uri) { - t.equal( - tryGetResolved(uri, 'decadacefadabade'), - 'git+ssh://git@github.com/foo/repo.git#decadacefadabade', - uri + ' normalized to canonical form git+ssh://git@github.com/foo/repo.git#decadacefadabade' - ) - } - t.end() -}) - -test('add-remote-git#get-resolved HTTPS', function (t) { - verify('https://github.com/foo/repo') - verify('https://github.com/foo/repo#master') - verify('git+https://github.com/foo/repo.git#master') - verify('git+https://github.com/foo/repo#decadacefadabade') - // DEPRECATED - // this is an invalid URL but we normalize it - // anyway. Users shouldn't use this in the future. See note - // below for how this affected non-hosted URLs. - // See https://github.com/npm/npm/issues/8881 - verify('git+https://github.com:foo/repo.git#master') - - function verify (uri) { - t.equal( - tryGetResolved(uri, 'decadacefadabade'), - 'git+https://github.com/foo/repo.git#decadacefadabade', - uri + ' normalized to canonical form git+https://github.com/foo/repo.git#decadacefadabade' - ) - } - t.end() -}) - -test('add-remote-git#get-resolved edge cases', function (t) { - t.equal( - tryGetResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'), - 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade', - 'don\'t break non-hosted scp-style locations' - ) - /* - t.equal( - tryGetResolved('git+ssh://bananaboat:galbi/blah', 'decadacefadabade'), - 'git+ssh://bananaboat:galbi/blah#decadacefadabade', - 'don\'t break non-hosted scp-style locations' - ) - - // DEPRECATED - // When we were normalizing all git URIs, git+https: was being - // automatically converted to ssh:. Some users were relying - // on this funky behavior, so after removing the aggressive - // normalization from non-hosted URIs, we brought this back. - // See https://github.com/npm/npm/issues/8881 - t.equal( - tryGetResolved('git+https://bananaboat:galbi/blah', 'decadacefadabade'), - 'git+https://bananaboat/galbi/blah#decadacefadabade', - 'don\'t break non-hosted scp-style locations' - ) - - t.equal( - tryGetResolved('git+ssh://git.bananaboat.net/foo', 'decadacefadabade'), - 'git+ssh://git.bananaboat.net/foo#decadacefadabade', - 'don\'t break non-hosted SSH URLs' - ) - - t.equal( - tryGetResolved('git+ssh://git.bananaboat.net:/foo', 'decadacefadabade'), - 'git+ssh://git.bananaboat.net:/foo#decadacefadabade', - 'don\'t break non-hosted SSH URLs' - ) - - t.equal( - tryGetResolved('git://gitbub.com/foo/bar.git', 'decadacefadabade'), - 'git://gitbub.com/foo/bar.git#decadacefadabade', - 'don\'t break non-hosted git: URLs' - ) -*/ - t.end() -}) diff --git a/test/need-npm5-update/belongs-in-pacote/git-races.js b/test/need-npm5-update/belongs-in-pacote/git-races.js deleted file mode 100644 index 60136125d4094..0000000000000 --- a/test/need-npm5-update/belongs-in-pacote/git-races.js +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable camelcase */ -var execFile = require('child_process').execFile -var path = require('path') -var zlib = require('zlib') - -var asyncMap = require('slide').asyncMap -var deepEqual = require('deep-equal') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var once = require('once') -var requireInject = require('require-inject') -var rimraf = require('rimraf') -var tar = require('tar') -var test = require('tap').test -var tmpdir = require('osenv').tmpdir -var which = require('which') - -var wd = path.resolve(tmpdir(), 'git-races') -var fixtures = path.resolve(__dirname, '../fixtures') -var testcase = 'mygithub.libinneed.workers.dev-BryanDonovan-npm-git-test' -var testcase_git = path.resolve(wd, testcase + '.git') -var testcase_path = path.resolve(wd, testcase) -var testcase_tgz = path.resolve(fixtures, testcase + '.git.tar.gz') - -var testtarballs = [] -var testrepos = {} -var testurls = {} - -/* -This test is specifically for #7202, where the bug was if you tried installing multiple git urls that -pointed at the same repo but had different comittishes, you'd sometimes get the wrong version. -The test cases, provided by @BryanDonovan, have a dependency tree like this: - - top - bar#4.0.0 - buzz#3.0.0 - foo#3.0.0 - buzz#3.0.0 - foo#4.0.0 - buzz#2.0.0 - -But what would happen is that buzz#2.0.0 would end up installed under bar#4.0.0. - -bar#4.0.0 shouldn't have gotten its own copy if buzz, and if it did, it shouldn've been buzz#3.0.0 -*/ - -;['bar', 'foo', 'buzz'].forEach(function (name) { - var mockurl = 'ssh://git@github.com/BryanDonovan/dummy-npm-' + name + '.git' - var realrepo = path.resolve(wd, 'mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-' + name + '.git') - var tgz = path.resolve(fixtures, 'mygithub.libinneed.workers.dev-BryanDonovan-dummy-npm-' + name + '.git.tar.gz') - - testrepos[mockurl] = realrepo - testtarballs.push(tgz) -}) - -function cleanup () { - process.chdir(tmpdir()) - rimraf.sync(wd) -} - -var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - // on win 32, the following prefix is added in utils/git.js - // $ git -c core.longpaths=true clone - var i = process.platform === 'win32' ? 2 : 0 - // If it's a clone we swap any requests for any of the urls we're mocking - // with the path to the bare repo - if (args[i] === 'clone') { - var m2 = args.length - 2 - var m1 = args.length - 1 - if (testrepos[args[m2]]) { - testurls[args[m1]] = args[m2] - args[m2] = testrepos[args[m2]] - } - execFile(cmd, args, options, cb) - // here, we intercept npm validating the remote origin url on one of the - // clones we've done previously and return the original url that was requested - } else if (args[i] === 'config' && args[i + 1] === '--get' && args[i + 2] === 'remote.origin.url') { - process.nextTick(function () { - cb(null, testurls[options.cwd], '') - }) - } else { - execFile(cmd, args, options, cb) - } - } - } -}) - -function extract (tarball, target, cb) { - cb = once(cb) - fs.createReadStream(tarball).on('error', function (er) { cb(er) }) - .pipe(zlib.createGunzip()).on('error', function (er) { cb(er) }) - .pipe(tar.Extract({path: target})).on('error', function (er) { cb(er) }) - .on('end', function () { - cb() - }) -} - -// Copied from lib/utils/git, because we need to use -// it before calling npm.load and lib/utils/git uses npm.js -// which doesn't allow that. =( =( - -function prefixGitArgs () { - return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : [] -} - -var gitcmd - -function execGit (args, options, cb) { - var fullArgs = prefixGitArgs().concat(args || []) - return execFile(gitcmd, fullArgs, options, cb) -} - -function gitWhichAndExec (args, options, cb) { - if (gitcmd) return execGit(args, options, cb) - - which('git', function (err, pathtogit) { - if (err) { - err.code = 'ENOGIT' - return cb(err) - } - gitcmd = pathtogit - - execGit(args, options, cb) - }) -} - -function andClone (gitdir, repodir, cb) { - return function (er) { - if (er) return cb(er) - gitWhichAndExec(['clone', gitdir, repodir], {}, cb) - } -} - -function setup (cb) { - cleanup() - mkdirp.sync(wd) - - extract(testcase_tgz, wd, andClone(testcase_git, testcase_path, andExtractPackages)) - - function andExtractPackages (er) { - if (er) return cb(er) - asyncMap(testtarballs, function (tgz, done) { - extract(tgz, wd, done) - }, andChdir) - } - function andChdir (er) { - if (er) return cb(er) - process.chdir(testcase_path) - andLoadNpm() - } - function andLoadNpm () { - var opts = { - cache: path.resolve(wd, 'cache') - } - npm.load(opts, cb) - } -} - -// there are two (sic) valid trees that can result we don't care which one we -// get in npm@2 -var oneTree = [ - 'npm-git-test@1.0.0', [ - ['dummy-npm-bar@4.0.0', [ - ['dummy-npm-foo@3.0.0', []], - ['dummy-npm-buzz@3.0.0', []] - ]], - ['dummy-npm-buzz@3.0.0', []], - ['dummy-npm-foo@4.0.0', [ - ['dummy-npm-buzz@2.0.0', []] - ]] - ] -] -var otherTree = [ - 'npm-git-test@1.0.0', [ - ['dummy-npm-bar@4.0.0', [ - ['dummy-npm-buzz@3.0.0', []], - ['dummy-npm-foo@3.0.0', []] - ]], - ['dummy-npm-buzz@3.0.0', []], - ['dummy-npm-foo@4.0.0', [ - ['dummy-npm-buzz@2.0.0', []] - ]] - ] -] - -function toSimple (tree) { - var deps = [] - Object.keys(tree.dependencies || {}).forEach(function (dep) { - deps.push(toSimple(tree.dependencies[dep])) - }) - return [ tree['name'] + '@' + tree['version'], deps ] -} - -test('setup', function (t) { - setup(function (er) { - t.ifError(er, 'setup ran OK') - t.end() - }) -}) - -test('correct versions are installed for git dependency', function (t) { - t.comment('test for https://github.com/npm/npm/issues/7202') - npm.commands.install([], function (er) { - t.ifError(er, 'installed OK') - npm.commands.ls([], true, function (er, result) { - t.ifError(er, 'ls OK') - var simplified = toSimple(result) - if (deepEqual(simplified, oneTree) || deepEqual(simplified, otherTree)) { - t.pass('install tree is correct') - } else { - t.isDeeply(simplified, oneTree, 'oneTree matches') - t.isDeeply(simplified, otherTree, 'otherTree matches') - } - t.done() - }) - }) -}) diff --git a/test/need-npm5-update/ignore-shrinkwrap.js b/test/need-npm5-update/ignore-shrinkwrap.js deleted file mode 100644 index 4980b659fd23f..0000000000000 --- a/test/need-npm5-update/ignore-shrinkwrap.js +++ /dev/null @@ -1,135 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = require('path').join(__dirname, 'ignore-shrinkwrap') - -var EXEC_OPTS = { cwd: pkg } - -var customMocks = { - 'get': { - '/package.js': [200, { ente: true }], - '/shrinkwrap.js': [200, { ente: true }] - } -} - -var json = { - author: 'Rocko Artischocko', - name: 'ignore-shrinkwrap', - version: '0.0.0', - dependencies: { - 'npm-test-ignore-shrinkwrap-file': 'http://localhost:' + common.port + '/package.js' - } -} - -var shrinkwrap = { - name: 'ignore-shrinkwrap', - version: '0.0.0', - dependencies: { - 'npm-test-ignore-shrinkwrap-file': { - version: '1.2.3', - from: 'http://localhost:' + common.port + '/shrinkwrap.js', - resolved: 'http://localhost:' + common.port + '/shrinkwrap.js', - dependencies: { - opener: { - version: '1.3.0', - from: 'opener@1.3.0' - } - } - } - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('npm install --no-shrinkwrap', function (t) { - mr({ port: common.port, mocks: customMocks }, function (err, s) { - t.ifError(err, 'mock registry bootstrapped without issue') - s._server.on('request', function (req) { - switch (req.url) { - case '/shrinkwrap.js': - t.fail('npm-shrinkwrap.json used instead of package.json') - break - case '/package.js': - t.pass('package.json used') - } - }) - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install', '--no-shrinkwrap' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm ran without issue') - t.ok(code, "install isn't going to succeed") - s.close() - t.end() - } - ) - }) -}) - -test('npm install (with shrinkwrap)', function (t) { - mr({ port: common.port, mocks: customMocks }, function (err, s) { - t.ifError(err, 'mock registry bootstrapped without issue') - s._server.on('request', function (req) { - switch (req.url) { - case '/shrinkwrap.js': - t.pass('shrinkwrap used') - break - case '/package.js': - t.fail('shrinkwrap ignored') - } - }) - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm ran without issue') - t.ok(code, "install isn't going to succeed") - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/need-npm5-update/legacy-array-bin.js b/test/need-npm5-update/legacy-array-bin.js deleted file mode 100644 index 3e421ee23e3ff..0000000000000 --- a/test/need-npm5-update/legacy-array-bin.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-array-bin') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-array-bin') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fixture = new Tacks( - Dir({ - bin: Dir({ - 'array-bin': File( - '#!/usr/bin/env node\n' + - "console.log('test ran ok')\n" - ) - }), - 'package.json': File({ - name: 'npm-test-array-bin', - version: '1.2.5', - bin: [ - 'bin/array-bin' - ], - scripts: { - test: 'node test.js' - } - }), - 'test.js': File( - "require('child_process').exec('array-bin', { env: process.env },\n" + - ' function (err, stdout, stderr) {\n' + - " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + - ' console.log(stdout)\n' + - ' console.error(stderr)\n' + - ' }\n' + - ')\n' - ) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('array-bin', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.equal(stderr, '', 'no error output') - common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) - } - function testCheckAndRemove (err, code, stdout, stderr) { - t.ifError(err, 'npm test on array bin') - t.equal(code, 0, 'exited OK') - t.equal(stderr.trim(), '', 'no error output') - t.match(stdout, /test ran ok/, 'child script ran properly') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/need-npm5-update/legacy-dir-bin.js b/test/need-npm5-update/legacy-dir-bin.js deleted file mode 100644 index e9e6bdfe1320f..0000000000000 --- a/test/need-npm5-update/legacy-dir-bin.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-dir-bin') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-dir-bin') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fixture = new Tacks( - Dir({ - bin: Dir({ - 'dir-bin': File( - '#!/usr/bin/env node\n' + - "console.log('test ran ok')\n" - ) - }), - 'package.json': File({ - name: 'npm-test-dir-bin', - version: '1.2.5', - directories: { - bin: './bin' - }, - scripts: { - test: 'node test.js' - } - }), - 'test.js': File( - "require('child_process').exec('dir-bin', { env: process.env },\n" + - ' function (err, stdout, stderr) {\n' + - " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + - ' console.log(stdout)\n' + - ' console.error(stderr)\n' + - ' }\n' + - ')\n' - ) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('dir-bin', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) - } - function testCheckAndRemove (err, code, stdout, stderr) { - t.ifError(err, 'npm test on array bin') - t.equal(code, 0, 'exited OK') - t.equal(stderr.trim(), '', 'no error output') - t.match(stdout, /test ran ok/, 'child script ran properly') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/need-npm5-update/legacy-npm-self-install.js b/test/need-npm5-update/legacy-npm-self-install.js deleted file mode 100644 index 6bcd8073621d0..0000000000000 --- a/test/need-npm5-update/legacy-npm-self-install.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict' -var test = require('tap').test -var fs = require('graceful-fs') -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var npmpath = path.resolve(__dirname, '../..') -var basepath = path.resolve(osenv.tmpdir(), path.basename(__filename, '.js')) -var globalpath = path.resolve(basepath, 'global') -var isWin32 = process.platform === 'win32' - -test('setup', function (t) { - setup() - t.done() -}) - -var tarball - -test('build-tarball', function (t) { - common.npm(['pack'], {cwd: npmpath, stdio: ['ignore', 'pipe', process.stderr]}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'pack went ok') - tarball = path.resolve(npmpath, stdout.trim().replace(/^(?:.|\n)*(?:^|\n)(.*?[.]tgz)$/, '$1')) - t.match(tarball, /[.]tgz$/, 'got a tarball') - t.done() - }) -}) - -function exists () { - try { - fs.statSync(path.resolve.apply(null, arguments)) - return true - } catch (ex) { - return false - } -} - -test('npm-self-install', function (t) { - if (!tarball) return t.done() - - var env = Object.assign({}, process.env) - var pathsep = isWin32 ? ';' : ':' - env.npm_config_prefix = globalpath - env.npm_config_global = 'true' - env.NODE_PATH = null - env.npm_config_user_agent = null - env.npm_config_color = 'always' - env.npm_config_progress = 'always' - env.npm_config_shrinkwrap = 'false' - var PATH = env.PATH ? env.PATH.split(pathsep) : [] - var binpath = isWin32 ? globalpath : path.join(globalpath, 'bin') - var cmdname = isWin32 ? 'npm.cmd' : 'npm' - PATH.unshift(binpath) - env.PATH = PATH.join(pathsep) - - var opts = {cwd: basepath, env: env, stdio: ['ignore', 'ignore', process.stderr]} - - common.npm(['install', '--ignore-scripts', tarball], opts, installCheckAndTest) - function installCheckAndTest (err, code) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.is(exists(binpath, cmdname), true, 'binary was installed') - t.is(exists(globalpath, isWin32 ? '' : 'lib', 'node_modules', 'npm'), true, 'module path exists') - common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, lsCheckAndRemove) - } - function lsCheckAndRemove (err, code, stdout, stderr) { - t.ifError(err, 'npm test on array bin') - t.equal(code, 0, 'exited OK') - t.equal(stderr.trim(), '', 'no error output') - var installed = JSON.parse(stdout.trim()) - t.is(Object.keys(installed.dependencies).length, 1, 'one thing installed') - t.is(path.resolve(globalpath, installed.dependencies.npm.from), tarball, 'and it was our npm tarball') - common.npm(['rm', 'npm'], {cwd: basepath, env: env}, removeCheck) - } - function removeCheck (err, code) { - if (err) throw err - t.is(code, 0, 'remove went ok') - common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, andDone) - } - function andDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.equal(stderr.trim(), '', 'no error output') - var installed = JSON.parse(stdout.trim()) - t.ok(!installed.dependencies || installed.dependencies.length === 0, 'nothing left') - t.is(exists(binpath, cmdname), false, 'binary was removed') - t.is(exists(globalpath, 'lib', 'node_modules', 'npm'), false, 'module was entirely removed') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - mkdirp.sync(globalpath) -} - -function cleanup () { - rimraf.sync(basepath) -} diff --git a/test/need-npm5-update/legacy-optional-deps.js b/test/need-npm5-update/legacy-optional-deps.js deleted file mode 100644 index 08ac98522de8c..0000000000000 --- a/test/need-npm5-update/legacy-optional-deps.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var common = require('../common-tap.js') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-optional-deps') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-optional-deps', - version: '1.2.5', - optionalDependencies: { - 'npm-test-foobarzaaakakaka': common.registry + '/not-a-package', - async: '10.999.14234', - mkdirp: '0.3.5', - optimist: 'some invalid version 99 #! $$ x y z', - 'npm-test-failer': '*' - } - }) - }) -) - -var server - -test('setup', function (t) { - setup() - mr({port: common.port}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('optional-deps', function (t) { - server.get('/npm-test-failer').reply(404, {error: 'nope'}) - server.get('/not-a-package').reply(200, 'HI THERE') - - var opts = ['--registry=' + common.registry, '--timeout=100'] - common.npm(opts.concat(['install', fixturepath]), {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - if (stderr) console.error(stderr) - server.done() - t.is(code, 0, 'install went ok') - var dir = fs.readdirSync(modulepath).sort() - t.isDeeply(dir, ['mkdirp', 'npm-test-optional-deps'], 'only one optional dep should be there') - t.is(require(path.resolve(modulepath, 'mkdirp', 'package.json')).version, '0.3.5', 'mkdirp version right') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - server.close() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/need-npm5-update/legacy-shrinkwrap.js b/test/need-npm5-update/legacy-shrinkwrap.js deleted file mode 100644 index 6f5303037707a..0000000000000 --- a/test/need-npm5-update/legacy-shrinkwrap.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'npm-shrinkwrap.json': File({ - name: 'npm-test-shrinkwrap', - version: '0.0.0', - dependencies: { - glob: { - version: '3.1.5', - from: 'git://github.com/isaacs/node-glob.git#npm-test', - resolved: 'git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f', - dependencies: { - 'graceful-fs': { - version: '1.1.5', - resolved: 'https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz', - dependencies: { - 'fast-list': { - version: '1.0.2', - resolved: 'https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz' - } - } - }, - inherits: { - version: '1.0.0', - resolved: 'https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz' - }, - minimatch: { - version: '0.2.1', - dependencies: { - 'lru-cache': { - version: '1.0.5' - } - } - } - } - }, - minimatch: { - version: '0.1.5', - resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz', - dependencies: { - 'lru-cache': { - version: '1.0.5', - resolved: 'https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz' - } - } - }, - 'npm-test-single-file': { - version: '1.2.3', - resolved: 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js' - } - } - }), - 'package.json': File({ - author: 'Isaac Z. Schlueter (http://blog.izs.me/)', - name: 'npm-test-shrinkwrap', - version: '0.0.0', - dependencies: { - 'npm-test-single-file': 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js', - glob: 'git://github.com/isaacs/node-glob.git#npm-test', - minimatch: '~0.1.0' - }, - scripts: { - test: 'node test.js' - } - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('shrinkwrap', function (t) { - common.npm(['install'], {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - t.is(code, 0, 'install went ok') - - common.npm(['ls', '--json'], {cwd: basepath}, verifyLsMatchesShrinkwrap) - } - - function verifyLsMatchesShrinkwrap (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - t.is(code, 0, 'ls went ok') - var actual = JSON.parse(stdout) - var expected = require(path.resolve(basepath, 'npm-shrinkwrap.json')) - // from is expected to vary - t.isDeeply(rmFrom(actual), rmFrom(expected)) - t.done() - } - - function rmFrom (obj) { - for (var i in obj) { - if (i === 'from') { - delete obj[i] - } else if (i === 'dependencies') { - for (var j in obj[i]) { - rmFrom(obj[i][j]) - } - } - } - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(basepath) -} - -function cleanup () { - fixture.remove(basepath) -} diff --git a/test/need-npm5-update/lifecycle-signal.js b/test/need-npm5-update/lifecycle-signal.js deleted file mode 100644 index 5f9f4c43cfeb0..0000000000000 --- a/test/need-npm5-update/lifecycle-signal.js +++ /dev/null @@ -1,140 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var spawn = require('child_process').spawn - -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var node = process.execPath -var npm = require.resolve('../../bin/npm-cli.js') - -var pkg = path.resolve(__dirname, 'lifecycle-signal') - -var asyncScript = 'console.error(process.pid);process.on(\'SIGINT\',function (){' -asyncScript += 'setTimeout(function(){console.error(process.pid);process.exit()},10)' -asyncScript += '});setInterval(function(){},10);' - -var zombieScript = 'console.error(process.pid);process.on(\'SIGINT\',function (){' -zombieScript += '});setInterval(function(){console.error(process.pid)},10);' - -var SIGSEGV = require('constants').SIGSEGV // eslint-disable-line node/no-deprecated-api - -var json = { - name: 'lifecycle-signal', - version: '1.2.5', - scripts: { - preinstall: 'node -e "process.kill(process.pid,\'SIGSEGV\')"', - forever: 'node -e "console.error(process.pid);setInterval(function(){},1000)"', - async: 'node -e "' + asyncScript + '"', - zombie: 'node -e "' + zombieScript + '"' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('lifecycle signal abort', { - skip: process.platform === 'win32' && 'windows does not use lifecycle signals' -}, function (t) { - var child = spawn(node, [npm, 'install'], { - cwd: pkg - }) - child.on('close', function (code, signal) { - // The error may be forwarded by the shell as an exit code rather than - // the signal itself. - t.ok((code === 128 + SIGSEGV) || signal === 'SIGSEGV') - t.end() - }) -}) - -test('lifecycle propagate signal term to child', { - /* This feature is broken. npm runs its lifecycle processes in a shell, and at - * least `bash` doesn’t forward SIGTERM to its children. */ - skip: process.platform !== 'darwin' && 'broken' -}, function (t) { - var innerChildPid - var child = spawn(npm, ['run', 'forever'], { - cwd: pkg - }) - child.stderr.on('data', function (data) { - innerChildPid = parseInt(data.toString(), 10) - t.doesNotThrow(function () { - process.kill(innerChildPid, 0) // inner child should be running - }) - child.kill() // send SIGTERM to npm - }) - child.on('exit', function (code, signal) { - t.equal(code, null) - t.equal(signal, 'SIGTERM') - t.throws(function () { - process.kill(innerChildPid, 0) // SIGTERM should have reached inner child - }) - t.end() - }) -}) - -test('lifecycle wait for async child process exit', { - skip: process.platform !== 'darwin' && 'broken' -}, function (t) { - var innerChildPid - var interrupted - var child = spawn(npm, ['run', 'async'], { - cwd: pkg - }) - child.stderr.on('data', function (data) { - if (!interrupted) { - interrupted = true - child.kill('SIGINT') - } else { - innerChildPid = parseInt(data.toString(), 10) - } - }) - child.on('exit', function (code, signal) { - t.ok(innerChildPid) - t.end() - }) -}) - -test('lifecycle force kill using multiple SIGINT signals', { - skip: process.platform !== 'darwin' && 'broken' -}, function (t) { - var innerChildPid - var interrupted - var child = spawn(npm, ['run', 'zombie'], { - cwd: pkg - }) - child.stderr.on('data', function (data) { - if (!interrupted) { - interrupted = true - child.kill('SIGINT') - } else { - innerChildPid = parseInt(data.toString(), 10) - child.kill('SIGINT') - } - }) - child.on('exit', function (code, signal) { - t.ok(innerChildPid) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/move-no-clobber-dest-node-modules.js b/test/need-npm5-update/move-no-clobber-dest-node-modules.js deleted file mode 100644 index a00c720243ed7..0000000000000 --- a/test/need-npm5-update/move-no-clobber-dest-node-modules.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var base = path.join(__dirname, path.basename(__filename, '.js')) -var common = require('../common-tap.js') - -function fixturepath () { - return path.join(base, path.join.apply(path, arguments)) -} - -function File (contents) { - return { - type: 'file', - contents: typeof contents === 'object' - ? JSON.stringify(contents) - : contents - } -} - -function Dir (contents) { - return { - type: 'dir', - contents: contents || {} - } -} - -function createFixtures (filename, fixture) { - if (fixture.type === 'dir') { - mkdirp.sync(filename) - Object.keys(fixture.contents).forEach(function (content) { - createFixtures(path.resolve(filename, content), fixture.contents[content]) - }) - } else if (fixture.type === 'file') { - fs.writeFileSync(filename, fixture.contents) - } else { - throw new Error('Unknown fixture type: ' + fixture.type) - } -} - -var fixtures = Dir({ -// The fixture modules - 'moda@1.0.1': Dir({ - 'package.json': File({ - name: 'moda', - version: '1.0.1' - }) - }), - 'modb@1.0.0': Dir({ - 'package.json': File({ - name: 'modb', - version: '1.0.0', - bundleDependencies: ['modc'], - dependencies: { - modc: fixturepath('modc@1.0.0') - } - }) - }), - 'modc@1.0.0': Dir({ - 'package.json': File({ - name: 'modc', - version: '1.0.0' - }) - }), - // The local config - 'package.json': File({ - dependencies: { - moda: fixturepath('moda@1.0.1'), - modb: fixturepath('modb@1.0.0') - } - }), - 'node_modules': Dir({ - 'moda': Dir({ - 'package.json': File({ - name: 'moda', - version: '1.0.0', - _requested: { rawSpec: fixturepath('moda@1.0.0') }, - dependencies: { - modb: fixturepath('modb@1.0.0') - }, - bundleDependencies: [ 'modb' ] - }) - }) - }) -}) - -function setup () { - cleanup() - createFixtures(base, fixtures) -} - -function cleanup () { - rimraf.sync(base) -} - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -test('setup', function (t) { - setup() - common.npm('install', {cwd: fixturepath('modb@1.0.0')}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'modb') - common.npm('install', { - cwd: fixturepath('node_modules', 'moda') - }, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed moda') - t.done() - }) - }) -}) - -test('no-clobber', function (t) { - common.npm('install', {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed ok') - exists(t, fixturepath('node_modules', 'moda'), 'moda') - exists(t, fixturepath('node_modules', 'modb'), 'modb') - exists(t, fixturepath('node_modules', 'modb', 'node_modules', 'modc'), 'modc') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.pass() - t.done() -}) diff --git a/test/need-npm5-update/need-only-update-save-optional/update-save.js b/test/need-npm5-update/need-only-update-save-optional/update-save.js deleted file mode 100644 index f01fa0f5421cf..0000000000000 --- a/test/need-npm5-update/need-only-update-save-optional/update-save.js +++ /dev/null @@ -1,219 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = path.resolve(__dirname, 'update-save') -var cache = path.resolve(pkg, 'cache') - -var EXEC_OPTS = { - cwd: pkg, - stdio: 'ignore', - env: { - npm_config_registry: common.registry, - npm_config_loglevel: 'verbose', - npm_config_save_prefix: '^' - } -} - -var json = { - name: 'update-save-example', - version: '1.2.3', - dependencies: { - mkdirp: '~0.3.0' - }, - devDependencies: { - underscore: '~1.3.1' - } -} - -function clone (a) { - return extend({}, a) -} - -function extend (a, b) { - for (var key in b) { a[key] = b[key] } - return a -} - -test('setup', function (t) { - setup() - - mr({ port: common.port }, function (er, s) { - t.ifError(er) - server = s - t.end() - }) -}) - -test('update regular dependencies only', function (t) { - setup() - - common.npm(['update', '--save'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - { mkdirp: '^0.3.5' }, - 'only dependencies updated' - ) - t.deepEqual( - pkgdata.devDependencies, - json.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - json.optionalDependencies, - 'optional dependencies should be untouched' - ) - - t.end() - }) -}) - -test('update devDependencies only', function (t) { - setup() - - common.npm(['update', '--save-dev'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - json.dependencies, - 'dependencies should be untouched' - ) - t.deepEqual( - pkgdata.devDependencies, - { underscore: '^1.3.3' }, - 'dev dependencies should be updated' - ) - t.deepEqual( - pkgdata.optionalDependencies, - json.optionalDependencies, - 'optional dependencies should be untouched' - ) - - t.end() - }) -}) - -test('update optionalDependencies only', function (t) { - setup({ optionalDependencies: { underscore: '~1.3.1' } }) - - common.npm(['update', '--save-optional'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - json.dependencies, - 'dependencies should be untouched' - ) - t.deepEqual( - pkgdata.devDependencies, - json.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - { underscore: '^1.3.3' }, - 'optional dependencies should be updated' - ) - - t.end() - }) -}) - -test('optionalDependencies are merged into dependencies during --save', function (t) { - var cloned = setup({ optionalDependencies: { underscore: '~1.3.1' } }) - - common.npm(['update', '--save'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - { mkdirp: '^0.3.5' }, - 'dependencies should not include optional dependencies' - ) - t.deepEqual( - pkgdata.devDependencies, - cloned.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - cloned.optionalDependencies, - 'optional dependencies should be untouched' - ) - - t.end() - }) -}) - -test('semver prefix is replaced with configured save-prefix', function (t) { - setup() - - common.npm(['update', '--save', '--save-prefix', '~'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - { mkdirp: '~0.3.5' }, - 'dependencies should be updated' - ) - t.deepEqual( - pkgdata.devDependencies, - json.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - json.optionalDependencies, - 'optional dependencies should be updated' - ) - - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup (extendWith) { - cleanup() - mkdirp.sync(cache) - process.chdir(pkg) - - var template = clone(json) - extend(template, extendWith) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(template, null, 2) - ) - return template -} diff --git a/test/need-npm5-update/need-outdated/update-symlink.js b/test/need-npm5-update/need-outdated/update-symlink.js deleted file mode 100644 index 7de80b110d33d..0000000000000 --- a/test/need-npm5-update/need-outdated/update-symlink.js +++ /dev/null @@ -1,127 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var testdir = path.join(__dirname, path.basename(__filename, '.js')) -var pkg = path.resolve(testdir, 'update-symlink') -var cachedir = path.join(testdir, 'cache') -var globaldir = path.join(testdir, 'global') -var OPTS = { - env: { - 'npm_config_cache': cachedir, - 'npm_config_prefix': globaldir, - 'npm_config_registry': common.registry - }, - cwd: pkg -} - -var jsonLocal = { - name: 'my-local-package', - description: 'fixture', - version: '1.0.0', - dependencies: { - 'async': '*', - 'underscore': '*' - } -} - -var server -test('setup', function (t) { - cleanup() - mkdirp.sync(cachedir) - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(jsonLocal, null, 2) - ) - - mr({ port: common.port }, thenInstallUnderscore) - - function thenInstallUnderscore (er, s) { - server = s - common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, thenLink) - } - - function thenLink (err, c, out) { - t.ifError(err, 'global install did not error') - common.npm(['link', 'underscore'], OPTS, thenInstallAsync) - } - - function thenInstallAsync (err, c, out) { - t.ifError(err, 'link did not error') - common.npm(['install', 'async@0.2.9'], OPTS, thenVerify) - } - - function thenVerify (err, c, out) { - t.ifError(err, 'local install did not error') - common.npm(['ls'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /async@0.2.9/, 'installed ok') - t.has(out, /underscore@1.3.1/, 'creates local link ok') - t.end() - }) - } -}) - -test('when update is called linked packages should be excluded', function (t) { - common.npm(['update', '--parseable'], OPTS, function (err, c, out, stderr) { - if (err) throw err - t.equal(c, 0) - t.has(out, /^update\tasync\t0.2.10\t/m, 'updated ok') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - t.end() - }) -}) - -test('when install is called and the package already exists as a link, outputs a warning if the requested version is not the same as the linked one', function (t) { - common.npm(['install', 'underscore', '--parseable'], OPTS, function (err, c, out, stderr) { - if (err) throw err - t.equal(c, 0) - - t.comment(out.trim()) - t.comment(stderr.trim()) - t.has(out, /^update-linked\tunderscore\t/m) - t.has(stderr, /underscore/, 'warning output relating to linked package') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - t.end() - }) -}) - -test('when install is called and the package already exists as a link, does not warn if the requested version is same as the linked one', function (t) { - common.npm(['install', 'underscore@1.3.1', '--parseable'], OPTS, function (err, c, out, stderr) { - if (err) throw err - t.equal(c, 0) - t.comment(out.trim()) - t.comment(stderr.trim()) - t.has(out, /^update-linked\tunderscore\t/m) - t.doesNotHave(stderr, /underscore/, 'no warning or error relating to linked package') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - common.npm(['rm', 'underscore', 'async'], OPTS, function (err, code) { - if (err) throw err - t.equal(code, 0, 'cleanup in local ok') - common.npm(['rm', '-g', 'underscore'], OPTS, function (err, code) { - if (err) throw err - t.equal(code, 0, 'cleanup in global ok') - - cleanup() - t.end() - }) - }) -}) - -function cleanup () { - rimraf.sync(testdir) -} diff --git a/test/need-npm5-update/outdated-depth-deep.js b/test/need-npm5-update/outdated-depth-deep.js deleted file mode 100644 index 14d4f1faf8474..0000000000000 --- a/test/need-npm5-update/outdated-depth-deep.js +++ /dev/null @@ -1,92 +0,0 @@ -var common = require('../common-tap') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') -var pkg = path.resolve(__dirname, 'outdated-depth-deep') -var cache = path.resolve(pkg, 'cache') - -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('fs') - -var pj = JSON.stringify({ - 'name': 'whatever', - 'description': 'yeah idk', - 'version': '1.2.3', - 'main': 'index.js', - 'dependencies': { - 'underscore': '1.3.1', - 'npm-test-peer-deps': '0.0.0' - }, - 'repository': 'git://github.com/luk-/whatever' -}, null, 2) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup () { - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('outdated depth deep (9999)', function (t) { - var conf = [ - '--registry', common.registry, - '--cache', cache - ] - - var server - mr({ port: common.port }, thenTopLevelInstall) - - function thenTopLevelInstall (err, s) { - if (err) throw err - server = s - common.npm(conf.concat(['install', '.']), {cwd: pkg}, thenDeepInstall) - } - - function thenDeepInstall (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install completed successfully') - t.is('', stderr, 'no error output') - var depPath = path.join(pkg, 'node_modules', 'npm-test-peer-deps') - common.npm(conf.concat(['install', 'underscore']), {cwd: depPath}, thenRunOutdated) - } - - function thenRunOutdated (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'deep install completed successfully') - t.is('', stderr, 'no error output') - common.npm(conf.concat(['outdated', '--depth', 9999]), {cwd: pkg}, thenValidateOutput) - } - - function thenValidateOutput (err, code, stdout, stderr) { - if (err) throw err - t.ifError(err) - t.is(code, 1, 'npm outdated exited with code 1') - t.match( - stdout, - /underscore.*1\.3\.1.*1\.3\.1.*1\.5\.1.*whatever\n/g, - 'child package listed') - t.match( - stdout, - /underscore.*1\.3\.1.*1\.3\.1.*1\.5\.1.*whatever > npm-test-peer-deps/g, - 'child package listed') - server.close() - t.end() - } -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/need-npm5-update/outdated-depth-integer.js b/test/need-npm5-update/outdated-depth-integer.js deleted file mode 100644 index 98c08fa192fca..0000000000000 --- a/test/need-npm5-update/outdated-depth-integer.js +++ /dev/null @@ -1,80 +0,0 @@ -var common = require('../common-tap') -var test = require('tap').test -var rimraf = require('rimraf') -var npm = require('../../') -var mr = require('npm-registry-mock') -var path = require('path') -var pkg = path.resolve('outdated-depth-integer') - -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('fs') - -var pj = JSON.stringify({ - 'name': 'whatever', - 'description': 'yeah idk', - 'version': '1.2.3', - 'main': 'index.js', - 'dependencies': { - 'underscore': '1.3.1' - }, - 'repository': 'git://github.com/luk-/whatever' -}, null, 2) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup () { - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync('package.json', pj) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('outdated depth integer', function (t) { - // todo: update with test-package-with-one-dep once the new - // npm-registry-mock is published - var expected = [[ - pkg, - 'underscore', - undefined, // no version installed - '1.3.1', // wanted - '1.5.1', // latest - '1.3.1', - null - ]] - - mr({ port: common.port }, function (er, s) { - npm.load({ - cache: pkg + '/cache', - loglevel: 'silent', - registry: common.registry, - depth: 5 - } - , function () { - npm.install('request@0.9.0', function (er) { - if (er) throw new Error(er) - npm.outdated(function (err, d) { - t.ifError(err, 'outdated did not error') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.deepEqual(d, expected) - s.close() - t.end() - }) - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/need-npm5-update/outdated-include-devdependencies.js b/test/need-npm5-update/outdated-include-devdependencies.js deleted file mode 100644 index 331d0b3b33ada..0000000000000 --- a/test/need-npm5-update/outdated-include-devdependencies.js +++ /dev/null @@ -1,58 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -// config -var pkg = path.resolve(__dirname, 'outdated-include-devdependencies') -var cache = path.resolve(pkg, 'cache') - -var json = { - author: 'Rocko Artischocko', - name: 'ignore-shrinkwrap', - version: '0.0.0', - devDependencies: { - underscore: '>=1.3.1' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('includes devDependencies in outdated', function (t) { - process.chdir(pkg) - mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry }, function () { - npm.outdated(function (er, d) { - t.ifError(er, 'npm outdated completed successfully') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.equal('1.5.1', d[0][3]) - s.close() - t.end() - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/outdated-local.js b/test/need-npm5-update/outdated-local.js deleted file mode 100644 index c253331d07e57..0000000000000 --- a/test/need-npm5-update/outdated-local.js +++ /dev/null @@ -1,195 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') - -var pkg = path.resolve(__dirname, 'outdated-local') -var pkgLocal = path.resolve(pkg, 'local-module') -var pkgScopedLocal = path.resolve(pkg, 'another-local-module') -var pkgLocalUnderscore = path.resolve(pkg, 'underscore') -var pkgLocalOptimist = path.resolve(pkg, 'optimist') - -var pjParent = JSON.stringify({ - name: 'outdated-local', - version: '1.0.0', - dependencies: { - 'local-module': 'file:local-module', // updated locally, not on repo - '@scoped/another-local-module': 'file:another-local-module', // updated locally, scoped, not on repo - 'underscore': 'file:underscore', // updated locally, updated but lesser version on repo - 'optimist': 'file:optimist' // updated locally, updated and greater version on repo - } -}, null, 2) + '\n' - -var pjLocal = JSON.stringify({ - name: 'local-module', - version: '1.0.0' -}, null, 2) + '\n' - -var pjLocalBumped = JSON.stringify({ - name: 'local-module', - version: '1.1.0' -}, null, 2) + '\n' - -var pjScopedLocal = JSON.stringify({ - name: '@scoped/another-local-module', - version: '1.0.0' -}, null, 2) + '\n' - -var pjScopedLocalBumped = JSON.stringify({ - name: '@scoped/another-local-module', - version: '1.2.0' -}, null, 2) + '\n' - -var pjLocalUnderscore = JSON.stringify({ - name: 'underscore', - version: '1.3.1' -}, null, 2) + '\n' - -var pjLocalUnderscoreBumped = JSON.stringify({ - name: 'underscore', - version: '1.6.1' -}, null, 2) + '\n' - -var pjLocalOptimist = JSON.stringify({ - name: 'optimist', - version: '0.4.0' -}, null, 2) + '\n' - -var pjLocalOptimistBumped = JSON.stringify({ - name: 'optimist', - version: '0.5.0' -}, null, 2) + '\n' - -function mocks (server) { - server.get('/local-module') - .reply(404) - server.get('/@scoped%2fanother-local-module') - .reply(404) -} - -test('setup', function (t) { - bootstrap() - t.end() -}) - -test('outdated support local modules', function (t) { - t.plan(5) - process.chdir(pkg) - mr({ port: common.port, plugin: mocks }, function (err, s) { - t.ifError(err, 'mock registry started without problems') - - function verify (actual, expected) { - for (var i = 0; i < expected.length; i++) { - var current = expected[i] - - var found = false - for (var j = 0; j < actual.length; j++) { - var target = actual[j] - - var k - for (k = 0; k < current.length; k++) { - if (current[k] !== target[k]) break - } - if (k === current.length) found = true - } - - if (!found) return false - } - - return true - } - - npm.load( - { - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - bumpLocalModules() - npm.outdated(function (er, d) { - t.ifError(err, 'npm outdated ran without error') - t.is(process.exitCode, 1, 'errorCode set to 1') - process.exitCode = 0 - t.ok(verify(d, [ - [ - path.resolve(__dirname, 'outdated-local'), - 'local-module', - '1.0.0', - '1.1.0', - '1.1.0', - 'file:local-module' - ], - [ - path.resolve(__dirname, 'outdated-local'), - '@scoped/another-local-module', - '1.0.0', - '1.2.0', - '1.2.0', - 'file:another-local-module' - ], - [ - path.resolve(__dirname, 'outdated-local'), - 'underscore', - '1.3.1', - '1.6.1', - '1.5.1', - 'file:underscore' - ], - [ - path.resolve(__dirname, 'outdated-local'), - 'optimist', - '0.4.0', - '0.6.0', - '0.6.0', - 'optimist@0.6.0' - ] - ]), 'got expected outdated output') - s.close() - }) - }) - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function bootstrap () { - mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent) - - mkdirp.sync(pkgLocal) - fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocal) - - mkdirp.sync(pkgScopedLocal) - fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocal) - - mkdirp.sync(pkgLocalUnderscore) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore) - - mkdirp.sync(pkgLocalOptimist) - fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimist) -} - -function bumpLocalModules () { - fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocalBumped) - fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocalBumped) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscoreBumped) - fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimistBumped) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/outdated-new-versions.js b/test/need-npm5-update/outdated-new-versions.js deleted file mode 100644 index bfd63e18c355e..0000000000000 --- a/test/need-npm5-update/outdated-new-versions.js +++ /dev/null @@ -1,65 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = path.resolve(__dirname, 'outdated-new-versions') -var cache = path.resolve(pkg, 'cache') - -var json = { - name: 'new-versions-with-outdated', - author: 'Rockbert', - version: '0.0.0', - dependencies: { - underscore: '~1.3.1' - }, - devDependencies: { - request: '~0.9.0' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('dicovers new versions in outdated', function (t) { - process.chdir(pkg) - t.plan(4) - - mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry }, function () { - npm.outdated(function (er, d) { - t.ifError(er, 'npm outdated completed successfully') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - for (var i = 0; i < d.length; i++) { - if (d[i][1] === 'underscore') t.equal('1.5.1', d[i][4]) - if (d[i][1] === 'request') t.equal('2.27.0', d[i][4]) - } - s.close() - t.end() - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/outdated-notarget.js b/test/need-npm5-update/outdated-notarget.js deleted file mode 100644 index 14388a80bc292..0000000000000 --- a/test/need-npm5-update/outdated-notarget.js +++ /dev/null @@ -1,47 +0,0 @@ -// Fixes Issue #1770 -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var osenv = require('osenv') -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var pkg = path.resolve(__dirname, 'outdated-notarget') -var cache = path.resolve(pkg, 'cache') -var mr = require('npm-registry-mock') - -test('outdated-target: if no viable version is found, show error', function (t) { - t.plan(1) - setup() - mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry }, function () { - npm.commands.update(function (er) { - t.equal(er.code, 'ETARGET') - s.close() - t.end() - }) - }) - }) -}) - -test('cleanup', function (t) { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - mkdirp.sync(cache) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Evan Lucas', - name: 'outdated-notarget', - version: '0.0.0', - description: 'Test for outdated-target', - dependencies: { - underscore: '~199.7.1' - } - }), 'utf8') - process.chdir(pkg) -} diff --git a/test/need-npm5-update/outdated-private.js b/test/need-npm5-update/outdated-private.js deleted file mode 100644 index 39bd6f1ac990f..0000000000000 --- a/test/need-npm5-update/outdated-private.js +++ /dev/null @@ -1,115 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') - -var pkg = path.resolve(__dirname, 'outdated-private') -var pkgLocalPrivate = path.resolve(pkg, 'local-private') -var pkgScopedLocalPrivate = path.resolve(pkg, 'another-local-private') -var pkgLocalUnderscore = path.resolve(pkg, 'underscore') - -var pjParent = JSON.stringify({ - name: 'outdated-private', - version: '1.0.0', - dependencies: { - 'local-private': 'file:local-private', - '@scoped/another-local-private': 'file:another-local-private', - 'underscore': 'file:underscore' - } -}, null, 2) + '\n' - -var pjLocalPrivate = JSON.stringify({ - name: 'local-private', - version: '1.0.0', - 'private': true -}, null, 2) + '\n' - -var pjLocalPrivateBumped = JSON.stringify({ - name: 'local-private', - version: '1.1.0', - 'private': true -}, null, 2) + '\n' - -var pjScopedLocalPrivate = JSON.stringify({ - name: '@scoped/another-local-private', - version: '1.0.0', - 'private': true -}, null, 2) + '\n' - -var pjLocalUnderscore = JSON.stringify({ - name: 'underscore', - version: '1.3.1' -}, null, 2) + '\n' - -test('setup', function (t) { - bootstrap() - t.end() -}) - -test('outdated ignores private modules', function (t) { - t.plan(4) - process.chdir(pkg) - mr({ port: common.port }, function (er, s) { - npm.load( - { - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - bumpLocalPrivate() - npm.outdated(function (er, d) { - t.ifError(err, 'npm outdated ran without error') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.deepEqual(d, [[ - path.resolve(__dirname, 'outdated-private'), - 'underscore', - '1.3.1', - '1.5.1', - '1.5.1', - 'underscore@1.5.1', - null - ]]) - s.close() - }) - }) - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function bootstrap () { - mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent) - - mkdirp.sync(pkgLocalPrivate) - fs.writeFileSync(path.resolve(pkgLocalPrivate, 'package.json'), pjLocalPrivate) - - mkdirp.sync(pkgScopedLocalPrivate) - fs.writeFileSync(path.resolve(pkgScopedLocalPrivate, 'package.json'), pjScopedLocalPrivate) - - mkdirp.sync(pkgLocalUnderscore) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore) -} - -function bumpLocalPrivate () { - fs.writeFileSync(path.resolve(pkgLocalPrivate, 'package.json'), pjLocalPrivateBumped) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/outdated-symlink.js b/test/need-npm5-update/outdated-symlink.js deleted file mode 100644 index 2f74e0551a85b..0000000000000 --- a/test/need-npm5-update/outdated-symlink.js +++ /dev/null @@ -1,103 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = path.resolve(__dirname, 'outdated-symlink') -var cache = path.resolve(pkg, 'cache') - -var fakeRoot = path.join(pkg, 'fakeRoot') -var OPTS = { - env: Object.assign({}, process.env, { - 'npm_config_prefix': fakeRoot, - 'registry': common.registry - }) -} - -var json = { - name: 'my-local-package', - description: 'fixture', - version: '1.0.0' -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - common.npm(['install', '-g', 'async@0.2.9', 'underscore@1.3.1'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - common.npm(['link'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0) - common.npm(['ls', '-g'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0) - t.is(stderr, '', 'got expected stderr') - t.match(stdout, /my-local-package@1.0.0/, 'creates global link ok') - t.end() - }) - }) - }) -}) - -test('when outdated is called linked packages should be displayed as such', function (t) { - var regOutLinked = /my-local-package\s*1.0.0\s*linked\s*linked\n/ - var regOutInstallOne = /async\s*0.2.9\s*0.2.9\s*0.2.10\n/ - var regOutInstallTwo = /underscore\s*1.3.1\s*1.3.1\s*1.5.1\n/ - - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - 'outdated', '-g' - ], - OPTS, - function (err, c, out, stderr) { - if (err) throw err - t.is(stderr, '') - t.match(out, regOutLinked, 'Global Link format as expected') - t.match(out, regOutInstallOne, 'Global Install format as expected') - t.match(out, regOutInstallTwo, 'Global Install format as expected') - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - process.chdir(osenv.tmpdir()) - common.npm(['rm', 'outdated'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'cleanup outdated in local ok') - common.npm(['rm', '-g', 'outdated', 'async', 'underscore'], OPTS, function (err, code) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'cleanup outdated in global ok') - - cleanup() - t.end() - }) - }) -}) - -function cleanup () { - rimraf.sync(pkg) - rimraf.sync(fakeRoot) -} diff --git a/test/need-npm5-update/peer-deps-invalid.js b/test/need-npm5-update/peer-deps-invalid.js deleted file mode 100644 index 15fda253ecc48..0000000000000 --- a/test/need-npm5-update/peer-deps-invalid.js +++ /dev/null @@ -1,100 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap') - -var pkg = path.resolve(__dirname, 'peer-deps-invalid') -var cache = path.resolve(pkg, 'cache') - -var json = { - author: 'Domenic Denicola (http://domenicdenicola.com/)', - name: 'peer-deps-invalid', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps-file': 'http://localhost:' + common.port + '/ok.js', - 'npm-test-peer-deps-file-invalid': 'http://localhost:' + common.port + '/invalid.js' - } -} - -var fileFail = function () { -/**package -* { "name": "npm-test-peer-deps-file-invalid" -* , "main": "index.js" -* , "version": "1.2.3" -* , "description":"This one should conflict with the other one" -* , "peerDependencies": { "underscore": "1.3.3" } -* } -**/ - module.exports = 'I\'m just a lonely index, naked as the day I was born.' -}.toString().split('\n').slice(1, -1).join('\n') - -var fileOK = function () { -/**package -* { "name": "npm-test-peer-deps-file" -* , "main": "index.js" -* , "version": "1.2.3" -* , "description":"No package.json in sight!" -* , "peerDependencies": { "underscore": "1.3.1" } -* , "dependencies": { "mkdirp": "0.3.5" } -* } -**/ - module.exports = 'I\'m just a lonely index, naked as the day I was born.' -}.toString().split('\n').slice(1, -1).join('\n') - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'file-ok.js'), fileOK) - fs.writeFileSync(path.join(pkg, 'file-fail.js'), fileFail) - - process.chdir(pkg) - t.end() -}) - -test('installing dependencies that have conflicting peerDependencies', function (t) { - var customMocks = { - 'get': { - '/ok.js': [200, path.join(pkg, 'file-ok.js')], - '/invalid.js': [200, path.join(pkg, 'file-fail.js')] - } - } - mr({port: common.port, mocks: customMocks}, function (err, s) { - t.ifError(err, 'mock registry started') - npm.load( - { - cache: cache, - registry: common.registry - }, - function () { - npm.commands.install([], function (err, additions, tree) { - t.error(err) - var invalid = tree.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' }) - t.is(invalid.length, 2) - s.close() - t.end() - }) - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/peer-deps-toplevel.js b/test/need-npm5-update/peer-deps-toplevel.js deleted file mode 100644 index 137375a232428..0000000000000 --- a/test/need-npm5-update/peer-deps-toplevel.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = path.join(__dirname, path.basename(__filename, '.js')) -var testdir = path.join(basedir, 'testdir') -var cachedir = path.join(basedir, 'cache') -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var expected = { - name: 'npm-test-peer-deps-toplevel', - version: '0.0.0', - problems: [ - 'peer dep missing: mkdirp@*, required by npm-test-peer-deps-toplevel@0.0.0', - 'peer dep missing: request@0.9.x, required by npm-test-peer-deps@0.0.0' - ], - dependencies: { - 'npm-test-peer-deps': { - version: '0.0.0', - resolved: common.registry + '/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz', - dependencies: { - underscore: { - version: '1.3.1', - resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' - } - } - }, - mkdirp: { - peerMissing: true, - required: { - _id: 'mkdirp@*', - name: 'mkdirp', - version: '*', - peerMissing: [ - {requiredBy: 'npm-test-peer-deps-toplevel@0.0.0', requires: 'mkdirp@*'} - ], - dependencies: {} - } - }, - request: { - peerMissing: true, - required: { - _id: 'request@0.9.x', - dependencies: {}, - name: 'request', - peerMissing: [ - {requiredBy: 'npm-test-peer-deps@0.0.0', requires: 'request@0.9.x'} - ], - version: '0.9.x' - } - } - } -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'npm-test-peer-deps-toplevel', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps': '*' - }, - peerDependencies: { - mkdirp: '*' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('installs the peer dependency directory structure', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install ran ok even w/ missing peeer deps') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - - common.npm(['ls', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'missing peer deps _are_ an ls error though') - t.comment(stderr.trim()) - var results = JSON.parse(stdout) - - t.deepEqual(results, expected, 'got expected output from ls') - t.done() - }) - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/need-npm5-update/peer-deps-without-package-json.js b/test/need-npm5-update/peer-deps-without-package-json.js deleted file mode 100644 index ad863e9f974f3..0000000000000 --- a/test/need-npm5-update/peer-deps-without-package-json.js +++ /dev/null @@ -1,79 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -var pkg = path.resolve(__dirname, 'peer-deps-without-package-json') -var cache = path.resolve(pkg, 'cache') -var nodeModules = path.resolve(pkg, 'node_modules') - -var fileJS = function () { -/**package -* { "name": "npm-test-peer-deps-file" -* , "main": "index.js" -* , "version": "1.2.3" -* , "description":"No package.json in sight!" -* , "peerDependencies": { "underscore": "1.3.1" } -* , "dependencies": { "mkdirp": "0.3.5" } -* } -**/ - - module.exports = 'I\'m just a lonely index, naked as the day I was born.' -}.toString().split('\n').slice(1, -1).join('\n') - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/3049') - cleanup() - mkdirp.sync(cache) - mkdirp.sync(nodeModules) - fs.writeFileSync(path.join(pkg, 'file-js.js'), fileJS) - process.chdir(pkg) - - t.end() -}) - -test('installing a peerDeps-using package without package.json', function (t) { - var customMocks = { - 'get': { - '/ok.js': [200, path.join(pkg, 'file-js.js')] - } - } - mr({port: common.port, mocks: customMocks}, function (err, s) { - t.ifError(err, 'mock registry booted') - npm.load({ - registry: common.registry, - cache: cache - }, function () { - npm.install(common.registry + '/ok.js', function (err, additions, result) { - t.ifError(err, 'installed ok.js') - - t.ok( - fs.existsSync(path.join(nodeModules, 'npm-test-peer-deps-file')), - 'passive peer dep installed' - ) - var invalid = result.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' }) - t.is(invalid.length, 1, 'got a warning for a missing/invalid peer dep') - - t.end() - s.close() // shutdown mock registry. - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/test/need-npm5-update/rm-linked.js b/test/need-npm5-update/rm-linked.js deleted file mode 100644 index f80421b9892cd..0000000000000 --- a/test/need-npm5-update/rm-linked.js +++ /dev/null @@ -1,139 +0,0 @@ -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var path = require('path') -var rimraf = require('rimraf') -var test = require('tap').test -var writeFileSync = require('fs').writeFileSync - -var common = require('../common-tap.js') - -var link = path.join(__dirname, 'rmlinked') -var linkDep = path.join(link, 'node_modules', 'baz') -var linkInstall = path.join(__dirname, 'rmlinked-install') -var linkRoot = path.join(__dirname, 'rmlinked-root') - -var config = 'prefix = ' + linkRoot -var configPath = path.join(link, '_npmrc') - -var OPTS = { - env: { - 'npm_config_userconfig': configPath - } -} - -var linkedJSON = { - name: 'foo', - version: '1.0.0', - description: '', - main: 'index.js', - dependencies: { - 'baz': '1.0.0' - }, - author: '', - license: 'ISC' -} - -var linkedDepJSON = { - name: 'baz', - version: '1.0.0', - description: '', - main: 'index.js', - author: '', - license: 'ISC' -} - -var installJSON = { - name: 'bar', - version: '1.0.0', - description: '', - main: 'index.js', - dependencies: { - 'foo': '1.0.0' - }, - author: '', - license: 'ISC' -} - -test('setup', function (t) { - setup() - common.npm(['ls', '-g', '--depth=0'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'ls -g') - t.notMatch(stdout, /UNMET DEPENDENCY foo@/, "foo isn't in global") - t.end() - }) -}) - -test('creates global link', function (t) { - process.chdir(link) - common.npm(['link'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'link') - t.comment(stdout) - t.comment(stderr) - common.npm(['ls', '-g'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'ls -g') - t.equal(stderr, '', 'got expected stderr') - t.match(stdout, /foo@1.0.0/, 'creates global link ok') - t.end() - }) - }) -}) - -test('uninstall the global linked package', function (t) { - process.chdir(osenv.tmpdir()) - common.npm(['uninstall', '-g', 'foo'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'uninstall -g foo') - t.comment(stdout) - t.comment(stderr) - process.chdir(link) - common.npm(['ls'], OPTS, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'ls') - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /baz@1.0.0/, "uninstall didn't remove dep") - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - try { rimraf.sync(linkRoot) } catch (e) { } - try { rimraf.sync(linkDep) } catch (e) { } - try { rimraf.sync(link) } catch (e) { } - try { rimraf.sync(linkInstall) } catch (e) { } -} - -function setup () { - cleanup() - mkdirp.sync(linkRoot) - mkdirp.sync(link) - writeFileSync( - path.join(link, 'package.json'), - JSON.stringify(linkedJSON, null, 2) - ) - mkdirp.sync(linkDep) - writeFileSync( - path.join(linkDep, 'package.json'), - JSON.stringify(linkedDepJSON, null, 2) - ) - mkdirp.sync(linkInstall) - writeFileSync( - path.join(linkInstall, 'package.json'), - JSON.stringify(installJSON, null, 2) - ) - writeFileSync(configPath, config) -} diff --git a/test/need-npm5-update/shrinkwrap-complete-except-dev.js b/test/need-npm5-update/shrinkwrap-complete-except-dev.js deleted file mode 100644 index abafde0afefcb..0000000000000 --- a/test/need-npm5-update/shrinkwrap-complete-except-dev.js +++ /dev/null @@ -1,158 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = path.join(__dirname, path.basename(__filename, '.js')) -var testdir = path.join(basedir, 'testdir') -var cachedir = path.join(basedir, 'cache') -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') -var appdir = path.join(testdir, 'app') -var installedModuleA = path.join(appdir, 'node_modules', 'module-a') -var installedModuleB = path.join(installedModuleA, 'node_modules', 'module-b') -var installedModuleC = path.join(appdir, 'node_modules', 'module-c') -var installedModuleD = path.join(appdir, 'node_modules', 'module-d') - -var conf = { - cwd: appdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - app: Dir({ - 'npm-shrinkwrap.json': File({ - name: 'app', - version: '1.0.0', - dependencies: { - 'module-a': { - version: '1.0.0', - from: '../module-a', - resolved: 'file:../module-a', - dependencies: { - 'module-b': { - version: '1.0.0', - from: '../module-b', - resolved: 'file:../module-b' - } - } - } - } - }), - 'package.json': File({ - name: 'app', - version: '1.0.0', - dependencies: { - 'module-a': '../module-a' - }, - devDependencies: { - 'module-d': '../module-d' - } - }) - }), - 'module-a': Dir({ - 'package.json': File({ - name: 'module-a', - version: '1.0.0', - dependencies: { - 'module-b': 'file:' + path.join(testdir, 'module-b'), - 'module-c': 'file:' + path.join(testdir, 'module-c') - } - }) - }), - 'module-b': Dir({ - 'package.json': File({ - name: 'module-b', - version: '1.0.0' - }) - }), - 'module-c': Dir({ - 'package.json': File({ - name: 'module-c', - version: '1.0.0' - }) - }), - 'module-d': Dir({ - 'package.json': File({ - name: 'module-d', - version: '1.0.0' - }) - }) - }) -})) - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: ex, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -function notExists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.fail(msg, {found: true, wanted: 'does not exist', compare: 'fs.stat(' + filepath + ')'}) - return true - } catch (ex) { - t.pass(msg) - return false - } -} - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('example', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment('1> ' + stdout.trim()) - t.comment('2> ' + stderr.trim()) - exists(t, installedModuleA, 'module-a: dep in shrinkwrap installed') - exists(t, installedModuleB, 'module-b: nested dep from shrinkwrap nested') - notExists(t, installedModuleC, 'module-c: dependency not installed because not in shrinkwrap') - exists(t, installedModuleD, 'module-d: dev dependency installed despite not being in shrinkwrap') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js b/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js deleted file mode 100644 index 8e4155d8ac274..0000000000000 --- a/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var testdir = path.join(__dirname, path.basename(__filename, '.js')) - -var fixture = new Tacks( - Dir({ - node_modules: Dir({ - 'a': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/a' - }, - dependencies: { - 'b': 'file:///mods/b' - }, - name: 'a', - version: '1.0.0' - }) - }), - 'b': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/b' - }, - dependencies: { - 'a': 'file:///mods/a' - }, - name: 'b', - version: '1.0.0' - }) - }) - }), - 'package.json': File({ - name: 'test', - version: '1.0.0', - devDependencies: { - 'a': 'file:///mods/a' - } - }) - }) -) - -var expectedShrinkwrap = { - name: 'test', - version: '1.0.0', - dependencies: { - a: { - version: '1.0.0', - dev: true - }, - b: { - version: '1.0.0', - dev: true - } - } -} - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -function readJson (file) { - try { - var contents = fs.readFileSync(file) - return JSON.parse(contents) - } catch (ex) { - return ex - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('shrinkwrap cycle in dev deps', function (t) { - common.npm(['shrinkwrap', '--only=prod'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'result code = ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var actualShrinkwrap = readJson(path.join(testdir, 'npm-shrinkwrap.json')) - t.isDeeply(actualShrinkwrap, expectedShrinkwrap, 'shrinkwrap is right') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/network/git-cache-locking.js b/test/network/git-cache-locking.js deleted file mode 100644 index 9c3e903bea52c..0000000000000 --- a/test/network/git-cache-locking.js +++ /dev/null @@ -1,44 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var pkg = path.resolve(__dirname, 'git-cache-locking') -var tmp = path.join(pkg, 'tmp') -var cache = path.join(pkg, 'cache') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - t.end() -}) - -test('git-cache-locking: install a git dependency', function (t) { - // disable git integration tests on Travis. - if (process.env.TRAVIS) return t.end() - - var gitEnv = Object.assign({}, process.env) - gitEnv.npm_config_cache = cache - gitEnv.npm_config_tmp = tmp - gitEnv.npm_config_prefix = pkg - gitEnv.npm_config_global = 'false' - - // package c depends on a.git#master and b.git#master - // package b depends on a.git#master - common.npm([ - 'install', - 'git://github.com/nigelzor/npm-4503-c.git' - ], { - cwd: pkg, - env: gitEnv - }, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(0, code, 'npm install should succeed') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/network/git-cache-no-hooks.js b/test/network/git-cache-no-hooks.js deleted file mode 100644 index 0021064ceaac7..0000000000000 --- a/test/network/git-cache-no-hooks.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tap').test -var fs = require('fs') -var path = require('path') -var common = require('../common-tap.js') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var pkg = path.resolve(__dirname, 'git-cache-no-hooks') -var osenv = require('osenv') -var tmp = path.join(pkg, 'tmp') -var cache = path.join(pkg, 'cache') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - mkdirp.sync(cache) - mkdirp.sync(tmp) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - t.end() -}) - -test('git-cache-no-hooks: install a git dependency', function (t) { - // disable git integration tests on Travis. - if (process.env.TRAVIS) return t.end() - - common.npm([ - 'install', 'git://github.com/nigelzor/npm-4503-a.git', - '--cache', cache, - '--tmp', tmp - ], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm completed') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'npm install should succeed') - - // verify permissions on git hooks - var repoDir = 'git-mygithub.libinneed.workers.dev-nigelzor-npm-4503-a-git-40c5cb24' - var hooksPath = path.join(cache, '_git-remotes', repoDir, 'hooks') - fs.readdir(hooksPath, function (err) { - t.equal(err && err.code, 'ENOENT', 'hooks are not brought along with repo') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) - t.end() -}) diff --git a/test/network/legacy-bundled-git.js b/test/network/legacy-bundled-git.js deleted file mode 100644 index 15fbac84eaeb8..0000000000000 --- a/test/network/legacy-bundled-git.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-bundled-git') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-bundled-git') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var minimatchExpected = { - name: 'minimatch', - description: 'a glob matcher in javascript', - version: '0.2.1', - repository: { - type: 'git', - url: 'git://github.com/isaacs/minimatch.git' - }, - main: 'minimatch.js', - scripts: { - test: 'tap test' - }, - engines: { - node: '*' - }, - dependencies: { - 'lru-cache': '~1.0.5' - }, - devDependencies: { - tap: '~0.1.3' - }, - licenses: [ - { - type: 'MIT', - url: 'http://github.com/isaacs/minimatch/raw/master/LICENSE' - } - ] -} - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-bundled-git', - scripts: { - test: 'node test.js' - }, - version: '1.2.5', - dependencies: { - glob: 'git://github.com/isaacs/node-glob.git#npm-test' - }, - bundledDependencies: [ - 'glob' - ] - }) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('bundled-git', function (t) { - common.npm(['install', '--global-style', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - - var actual = require(path.resolve(installedpath, 'node_modules/glob/node_modules/minimatch/package.json')) - Object.keys(minimatchExpected).forEach(function (key) { - t.isDeeply(actual[key], minimatchExpected[key], key + ' set to the right value') - }) - - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/network/legacy-url-dep.js b/test/network/legacy-url-dep.js deleted file mode 100644 index 46378cd3ef8e5..0000000000000 --- a/test/network/legacy-url-dep.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-url-dep') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-url-dep', - version: '1.2.3', - dependencies: { - jsonify: 'https://github.com/substack/jsonify/tarball/master', - sax: 'isaacs/sax-js', - 'canonical-host': 'git://github.com/isaacs/canonical-host' - } - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('url-dep', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/network/registry.js b/test/network/registry.js deleted file mode 100644 index d7e11c6007111..0000000000000 --- a/test/network/registry.js +++ /dev/null @@ -1,68 +0,0 @@ -// Run all the tests in the `npm-registry-couchapp` suite -// This verifies that the server-side stuff still works. - -var common = require('../common-tap') -var t = require('tap') - -var npmExec = require.resolve('../../bin/npm-cli.js') -var path = require('path') -var ca = path.resolve(__dirname, '../../node_modules/npm-registry-couchapp') - -var which = require('which') - -var v = process.versions.node.split('.').map(function (n) { return parseInt(n, 10) }) -if (v[0] === 0 && v[1] < 10) { - console.error( - 'WARNING: need a recent Node for npm-registry-couchapp tests to run, have', - process.versions.node - ) -} else { - try { - which.sync('couchdb') - t.test(runTests) - } catch (er) { - console.error('WARNING: need couch to run test: ' + er.message) - } -} - -function runTests (t) { - var env = Object.assign({ TAP: 1 }, process.env) - env.npm = npmExec - // TODO: fix tap and / or nyc to handle nested invocations properly - env.COVERALLS_REPO_TOKEN = '' - - var opts = { - cwd: ca, - stdio: 'inherit' - } - common.npm(['install'], opts, function (err, code) { - if (err) { throw err } - if (code) { - t.fail('install failed with: ' + code) - return t.end() - } else { - opts = { - cwd: ca, - env: env, - stdio: 'inherit' - } - common.npm(['test', '--', '-Rtap', '--no-coverage'], opts, function (err, code) { - if (err) { throw err } - if (code) { - t.fail('test failed with: ' + code) - return t.end() - } - opts = { - cwd: ca, - env: env, - stdio: 'inherit' - } - common.npm(['prune', '--production'], opts, function (err, code) { - t.ifError(err) - t.equal(code, 0) - return t.end() - }) - }) - } - }) -} diff --git a/test/tap/00-check-mock-dep.js b/test/tap/00-check-mock-dep.js deleted file mode 100644 index cdc7af852b344..0000000000000 --- a/test/tap/00-check-mock-dep.js +++ /dev/null @@ -1,17 +0,0 @@ -console.log('TAP Version 13') - -process.on('uncaughtException', function (er) { - if (er) { throw er } - console.log('not ok - Failed checking mock registry dep. Expect much fail!') - console.log('1..1') - process.exit(1) -}) - -var assert = require('assert') -var semver = require('semver') -var mock = require('npm-registry-mock/package.json').version -var req = require('../../package.json').devDependencies['npm-registry-mock'] - -assert(semver.satisfies(mock, req)) -console.log('ok') -console.log('1..1') diff --git a/test/tap/00-config-setup.js b/test/tap/00-config-setup.js deleted file mode 100644 index 448453eded4fd..0000000000000 --- a/test/tap/00-config-setup.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var userconfigSrc = path.resolve(__dirname, '..', 'fixtures', 'config', 'userconfig') -exports.userconfig = userconfigSrc + '-with-gc' -exports.globalconfig = path.resolve(__dirname, '..', 'fixtures', 'config', 'globalconfig') -exports.builtin = path.resolve(__dirname, '..', 'fixtures', 'config', 'builtin') -exports.malformed = path.resolve(__dirname, '..', 'fixtures', 'config', 'malformed') -exports.ucData = - { globalconfig: exports.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'init.version': '1.2.3', - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': path.normalize(process.env.HOME + '/.tmp'), - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - -// set the userconfig in the env -// unset anything else that npm might be trying to foist on us -Object.keys(process.env).forEach(function (k) { - if (k.match(/^npm_config_/i)) { - delete process.env[k] - } -}) -process.env.npm_config_userconfig = exports.userconfig -process.env.npm_config_other_env_thing = '1000' -process.env.random_env_var = 'asdf' -process.env.npm_config__underbar_env_thing = 'underful' -process.env.NPM_CONFIG_UPPERCASE_ENV_THING = '42' - -exports.envData = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': '42', - 'other-env-thing': '1000' -} -exports.envDataFix = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': 42, - 'other-env-thing': 1000 -} - -var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') -try { - fs.statSync(projectConf) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectConf, function () { /* -save-prefix = ~ -legacy-bundling = true - */ }.toString().split('\n').slice(1, -1).join('\n')) -} - -var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') -try { - fs.statSync(projectRc) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectRc, 'just = testing') -} - -if (module === require.main) { - // set the globalconfig in the userconfig - var uc = fs.readFileSync(userconfigSrc) - var gcini = 'globalconfig = ' + exports.globalconfig + '\n' - fs.writeFileSync(exports.userconfig, gcini + uc) - - console.log('1..1') - console.log('ok 1 setup done') -} diff --git a/test/tap/00-verify-bundle-deps.js b/test/tap/00-verify-bundle-deps.js deleted file mode 100644 index 75ea81c593e76..0000000000000 --- a/test/tap/00-verify-bundle-deps.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tap').test - -var manifest = require('../../package.json') -var deps = Object.keys(manifest.dependencies) -var bundled = manifest.bundleDependencies - -test('all deps are bundled deps or dev deps', function (t) { - deps.forEach(function (name) { - t.assert( - bundled.indexOf(name) !== -1, - name + ' is in bundledDependencies' - ) - }) - - t.end() -}) diff --git a/test/tap/00-verify-ls-ok.js b/test/tap/00-verify-ls-ok.js deleted file mode 100644 index edff251d76a13..0000000000000 --- a/test/tap/00-verify-ls-ok.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common-tap') -var test = require('tap').test -var path = require('path') -var cwd = path.resolve(__dirname, '..', '..') -var fs = require('fs') - -test('npm ls in npm', function (t) { - t.ok(fs.existsSync(cwd), 'ensure that the path we are calling ls within exists') - var files = fs.readdirSync(cwd) - t.notEqual(files.length, 0, 'ensure there are files in the directory we are to ls') - - var opt = { cwd: cwd, stdio: [ 'ignore', 'pipe', 2 ] } - common.npm(['ls', '--json'], opt, function (err, code, stdout) { - t.ifError(err, 'error should not exist') - t.equal(code, 0, 'npm ls exited with code') - const tree = JSON.parse(stdout).dependencies - // We need to have a toplevel `node-gyp` available, but we also need to - // make sure npm-lifecycle's version is updated in concert. - // See https://github.com/npm/npm/issues/20163 - t.deepEqual( - tree['npm-lifecycle'].dependencies['node-gyp'].version, - tree['node-gyp'].version, - 'npm-lifecycle and npm using same version of node-gyp' - ) - t.end() - }) -}) diff --git a/test/tap/404-parent.js b/test/tap/404-parent.js deleted file mode 100644 index ee9623c545505..0000000000000 --- a/test/tap/404-parent.js +++ /dev/null @@ -1,54 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -const pkg = common.pkg -var mr = require('npm-registry-mock') - -test('404-parent: if parent exists, specify parent in error message', function (t) { - setup() - rimraf(path.resolve(pkg, 'node_modules'), () => { - performInstall(function (err) { - t.ok(err instanceof Error, 'error was returned') - t.equal(err.parent, '404-parent', "error's parent set") - t.end() - }) - }) -}) - -function setup () { - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Evan Lucas', - name: '404-parent-test', - version: '0.0.0', - description: 'Test for 404-parent', - dependencies: { - 'test-npm-404-parent-test': '*' - } - }), 'utf8') - process.chdir(pkg) -} - -function performInstall (cb) { - mr({port: common.port}, function (er, s) { // create mock registry. - if (er) { - return cb(er) - } - s.get('/test-npm-404-parent-test') - .many().reply(404, {'error': 'version not found'}) - npm.load({ - registry: common.registry - }, function () { - npm.config.set('fetch-retries', 0) - var pwd = process.cwd() - process.chdir(pkg) - npm.commands.install([], function (err) { - process.chdir(pwd) - cb(err) - s.close() // shutdown mock npm server. - }) - }) - }) -} diff --git a/test/tap/404-private-registry-scoped.js b/test/tap/404-private-registry-scoped.js deleted file mode 100644 index 0aa262f54628c..0000000000000 --- a/test/tap/404-private-registry-scoped.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap.js') -var mr = common.fakeRegistry.compat -var server - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('scoped package names not mangled on error with non-root registry', function (t) { - server.get('/@scope%2ffoo').reply(404, {}) - common.npm( - [ - '--registry=' + common.registry, - '--cache=' + common.cache, - 'cache', - 'add', - '@scope/foo@*', - '--force' - ], - {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'correctly handled 404') - t.equal(code, 1, 'exited with error') - t.match(stderr, /E404/, 'should notify the sort of error as a 404') - t.match(stderr, /@scope(?:%2f|\/)foo/, 'should have package name in error') - server.done() - server.close() - t.end() - } - ) -}) diff --git a/test/tap/404-private-registry.js b/test/tap/404-private-registry.js deleted file mode 100644 index 0ca05105dc9f3..0000000000000 --- a/test/tap/404-private-registry.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tap').test -var path = require('path') -var common = require('../common-tap.js') -var mr = common.fakeRegistry.compat -var server - -var packageName = path.basename(__filename, '.js') - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('package names not mangled on error with non-root registry', function (t) { - server.get('/' + packageName).reply(404, {}) - common.npm( - [ - '--registry=' + common.registry, - '--cache=' + common.cache, - 'cache', - 'add', - packageName + '@*' - ], - {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'correctly handled 404') - t.equal(code, 1, 'exited with error') - t.match(stderr, packageName, 'should have package name in error') - server.done() - server.close() - t.end() - } - ) -}) diff --git a/test/tap/404.js b/test/tap/404.js deleted file mode 100644 index af146371c7933..0000000000000 --- a/test/tap/404.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const e404 = /test-npm-404@latest' is not in the npm registry/ -const invalidPackage = /Your package name is not valid, because[\s\S]+1\. name can only contain URL-friendly characters/ - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' -}) - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'test', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - return common.fakeRegistry.listen() -}) - -test('404 message for basic package', function (t) { - return common.npm(['install', 'test-npm-404'], {cwd: testdir, env}).then(([code, stdout, stderr]) => { - t.is(code, 1, 'error code') - t.match(stderr, e404, 'error output') - t.notMatch(stderr, invalidPackage, 'no invalidity error') - }) -}) - -test('404 message for scoped package', function (t) { - return common.npm(['install', '@npm/test-npm-404'], {cwd: testdir, env}).then(([code, stdout, stderr]) => { - t.is(code, 1, 'error code') - t.match(stderr, e404, 'error output') - t.notMatch(stderr, invalidPackage, 'no invalidity error') - }) -}) - -test('cleanup', function (t) { - common.fakeRegistry.close() - cleanup() - t.done() -}) diff --git a/test/tap/add-named-update-protocol-port.js b/test/tap/add-named-update-protocol-port.js deleted file mode 100644 index 2876b6cdbc480..0000000000000 --- a/test/tap/add-named-update-protocol-port.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var common = require('../common-tap') -var mr = require('npm-registry-mock') -var server1 -var server2 - -var packageName = path.basename(__filename, '.js') - -var fooPkg = { - name: packageName, - versions: { - '0.0.0': { - name: packageName, - version: '0.0.0', - dist: { - tarball: 'https://localhost:' + common.altPort + '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz', - shasum: '356a192b7913b04c54574d18c28d46e6395428ab' - } - } - } -} - -var iPackageName = packageName + 'i' -var fooiPkg = { - name: iPackageName, - versions: { - '0.0.0': { - name: iPackageName, - version: '0.0.0', - dist: { - tarball: 'http://127.0.0.1:' + common.altPort + '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz', - shasum: '356a192b7913b04c54574d18c28d46e6395428ab' - } - } - } -} - -test('setup', function (t) { - mr({ - port: common.port, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server1 = s - mr({ - port: common.altPort, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server2 = s - t.end() - }) - }) -}) - -test('tarball paths should update port if updating protocol', function (t) { - server1.get('/registry/' + packageName).reply(200, fooPkg) - server1.get( - '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz' - ).reply(200, '1') - - common.npm( - [ - 'cache', - 'add', - packageName + '@0.0.0', - '--registry', - 'http://localhost:' + common.port + '/registry' - ], - {}, - function (er, code, stdout, stderr) { - if (er) { throw er } - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'addNamed worked') - server1.done() - t.end() - } - ) -}) - -test('tarball paths should NOT update if different hostname', function (t) { - server1.get('/registry/' + iPackageName).reply(200, fooiPkg) - server2.get( - '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz' - ).reply(200, '1') - - common.npm( - [ - 'cache', - 'add', - iPackageName + '@0.0.0', - '--registry', - 'http://localhost:' + common.port + '/registry' - ], - {}, - function (er, code, stdout, stderr) { - if (er) { throw er } - t.equal(code, 0, 'addNamed worked') - server1.done() - server2.done() - t.end() - } - ) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server1.close() - server2.close() - t.end() -}) diff --git a/test/tap/add-remote-git-file.js b/test/tap/add-remote-git-file.js deleted file mode 100644 index 17e06eaf3587f..0000000000000 --- a/test/tap/add-remote-git-file.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict' - -const pacote = require('pacote') -const fs = require('fs') -const resolve = require('path').resolve -const url = require('url') - -const mkdirp = require('mkdirp') -const test = require('tap').test - -const npm = require('../../lib/npm.js') -const common = require('../common-tap.js') - -const cache = common.cache -const pkg = resolve(common.pkg, 'package') -const repo = resolve(common.pkg, 'repo') -mkdirp.sync(pkg) - -let git -const cloneURL = 'git+file://' + resolve(pkg, 'child.git') - -const pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', { bail: true }, function (t) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ - cache, - registry: common.registry, - loglevel: 'silent' - }, function () { - git = require('../../lib/utils/git.js') - - common.makeGitRepo({ - path: repo, - commands: [git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - )] - }, er => { - t.ifError(er) - t.end() - }) - }) -}) - -test('cache from repo', async t => { - process.chdir(pkg) - const manifest = await pacote.manifest(cloneURL, npm.flatOptions) - t.equal( - url.parse(manifest._resolved).protocol, - 'git+file:', - 'npm didn\'t go crazy adding git+git+git+git' - ) -}) - -test('save install', function (t) { - process.chdir(pkg) - fs.writeFileSync('package.json', JSON.stringify({ - name: 'parent', - version: '5.4.3' - }, null, 2) + '\n') - const prev = npm.config.get('save') - npm.config.set('save', true) - npm.commands.install('.', [cloneURL], function (er) { - npm.config.set('save', prev) - t.ifError(er, 'npm installed via git') - const pj = JSON.parse(fs.readFileSync('package.json', 'utf-8')) - const dep = pj.dependencies.child - t.equal( - url.parse(dep).protocol, - 'git+file:', - 'npm didn\'t strip the git+ from git+file://' - ) - - t.end() - }) -}) diff --git a/test/tap/add-remote-git-shrinkwrap.js b/test/tap/add-remote-git-shrinkwrap.js deleted file mode 100644 index 01a033e89451f..0000000000000 --- a/test/tap/add-remote-git-shrinkwrap.js +++ /dev/null @@ -1,137 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(common.pkg, 'repo') - -var daemon -var daemonPID -var git - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - 'child': 'git://localhost:' + common.gitPort + '/child.git#master' - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - t.end() - }) -}) - -test('install from repo', function (t) { - process.chdir(pkg) - common.npm(['install'], {cwd: pkg, stdio: [0, 1, 2]}, function (er, code) { - if (er) throw er - t.is(code, 0, 'npm installed via git') - - t.end() - }) -}) - -test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { - common.npm( - [ - 'shrinkwrap', - '--loglevel', 'error' - ], - { cwd: pkg, stdio: [0, 'pipe', 2] }, - function (er, code, stdout) { - if (er) throw er - t.is(code, 0, '`npm shrinkwrap` exited ok') - - var shrinkwrap = require(resolve(pkg, 'npm-shrinkwrap.json')) - git.whichAndExec( - ['rev-list', '-n1', 'master'], - { cwd: repo, env: process.env }, - function (er, stdout, stderr) { - t.ifErr(er, 'git rev-list ran without error') - t.notOk(stderr, 'no error output') - var treeish = stdout.trim() - - t.like(shrinkwrap, {dependencies: {child: {version: 'git://localhost:' + common.gitPort + '/child.git#' + treeish}}}, - 'npm shrinkwrapped resolved correctly' - ) - - t.end() - } - ) - } - ) -}) - -test('clean', function (t) { - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ prefix: pkg, registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) -} diff --git a/test/tap/add-remote-git-submodule.js b/test/tap/add-remote-git-submodule.js deleted file mode 100644 index 54f2819fb330e..0000000000000 --- a/test/tap/add-remote-git-submodule.js +++ /dev/null @@ -1,142 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var cwd = process.cwd() -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repos = resolve(common.pkg, 'repos') -var subwt = resolve(repos, 'subwt') -var topwt = resolve(repos, 'topwt') -var suburl = 'git://localhost:' + common.gitPort + '/sub.git' -var topurl = 'git://localhost:' + common.gitPort + '/top.git' - -var daemon -var daemonPID -var git - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - child: topurl - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - t.end() - }) -}) - -test('install from repo', function (t) { - bootstrap(t) - npm.commands.install('.', [], function (er) { - t.ifError(er, 'npm installed via git') - t.end() - }) -}) - -test('has file in submodule', function (t) { - bootstrap(t) - npm.commands.install('.', [], function (er) { - t.ifError(er, 'npm installed via git') - var fooPath = resolve('node_modules', 'child', 'subpath', 'foo.txt') - fs.stat(fooPath, function (er) { - t.ifError(er, 'file in submodule exists') - t.end() - }) - }) -}) - -test('clean', function (t) { - daemon.on('close', function () { - t.end() - }) - process.kill(daemonPID) -}) - -function bootstrap (t) { - process.chdir(cwd) - rimraf.sync(pkg) - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync('package.json', pjParent) -} - -function setup (cb) { - rimraf.sync(pkg) - rimraf.sync(repos) - - mkdirp.sync(topwt) - fs.writeFileSync(resolve(topwt, 'package.json'), pjChild) - mkdirp.sync(subwt) - fs.writeFileSync(resolve(subwt, 'foo.txt'), 'This is provided by submodule') - npm.load({ registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: repos, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - daemon = d - daemonPID = cpid[1] - cb(null) - } - } - } - - var env = { PATH: process.env.PATH } - var topopt = { cwd: topwt, env: env } - var reposopt = { cwd: repos, env: env } - common.makeGitRepo({ - path: subwt, - message: 'subwt repo: ' + subwt, - added: ['foo.txt'], - commands: [ - git.chainableExec(['clone', '--bare', subwt, 'sub.git'], reposopt), - startDaemon, - [common.makeGitRepo, { - path: topwt, - message: 'topwt repo: ' + topwt, - commands: [ - git.chainableExec(['submodule', 'add', suburl, 'subpath'], topopt), - git.chainableExec(['commit', '-m', 'added submodule'], topopt), - git.chainableExec(['clone', '--bare', topwt, 'top.git'], reposopt) - ] - }] - ] - }, cb) - }) -} diff --git a/test/tap/add-remote-git.js b/test/tap/add-remote-git.js deleted file mode 100644 index 2a61963439111..0000000000000 --- a/test/tap/add-remote-git.js +++ /dev/null @@ -1,104 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(pkg, 'repo') - -var daemon -var daemonPID -var git - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - child: 'git://localhost:' + common.gitPort + '/child.git' - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - t.end() - }) -}) - -test('install from repo', function (t) { - process.chdir(pkg) - npm.commands.install('.', [], function (er) { - t.ifError(er, 'npm installed via git') - t.end() - }) -}) - -test('clean', function (t) { - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 1, 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) -} diff --git a/test/tap/adduser-always-auth.js b/test/tap/adduser-always-auth.js deleted file mode 100644 index 26541eebbc7b6..0000000000000 --- a/test/tap/adduser-always-auth.js +++ /dev/null @@ -1,266 +0,0 @@ -var fs = require('fs') -var path = require('path') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var outfile = path.resolve(common.pkg, '_npmrc') -var responses = { - 'Username': 'u\n', - 'Password': 'p\n', - 'Email': 'u@p.me\n' -} - -function verifyStdout (runner, successMessage, t) { - var remaining = Object.keys(responses).length - return function (chunk) { - if (remaining > 0) { - remaining-- - - var label = chunk.toString('utf8').split(':')[0] - runner.stdin.write(responses[label]) - - if (remaining === 0) runner.stdin.end() - } else { - var message = chunk.toString('utf8').trim() - t.equal(message, successMessage) - } - } -} - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:u"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:u', 'auth') - .reply(201, { username: 'u', password: 'p', email: 'u@p.me' }) -} - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) -}) - -test('npm login --scope uses :registry as its URI', function (t) { - var port = common.port + 1 - var uri = 'http://localhost:' + port + '/' - var scope = '@myco' - common.npm( - [ - 'config', - '--userconfig', outfile, - 'set', - scope + ':registry', - uri - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - - mr({ port: port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--loglevel', 'silent', - '--userconfig', outfile, - '--scope', scope - ], - opts, - function (err, code) { - t.equal(code, 0, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, new RegExp(scope + ':registry=' + uri), 'scope:registry is set') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u to scope ' + scope + ' on ' + uri + '.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) - }) -}) - -test('npm login --scope makes sure is prefixed by an @', function (t) { - var port = common.port + 1 - var uri = 'http://localhost:' + port + '/' - var scope = 'myco' - var prefixedScope = '@' + scope - common.npm( - [ - '--userconfig', outfile, - 'config', - 'set', - prefixedScope + ':registry', - uri - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - - mr({ port: port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--loglevel', 'silent', - '--userconfig', outfile, - '--scope', scope - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, new RegExp(prefixedScope + ':registry=' + uri), 'scope:registry is set') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u to scope ' + prefixedScope + ' on ' + uri + '.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) - }) -}) - -test('npm login --scope --registry uses as its URI', function (t) { - var scope = '@myco' - common.npm( - [ - '--userconfig', outfile, - 'config', - 'set', - scope + ':registry', - 'invalidurl' - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--scope', scope - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, new RegExp(scope + ':registry=' + common.registry), 'scope:registry is set') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u to scope ' + scope + ' on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) - }) -}) - -test('npm login --always-auth', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--always-auth' - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=true/, 'always-auth is scoped and true') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) -}) - -test('npm login --no-always-auth', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--no-always-auth' - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(outfile) - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/adduser-legacy-auth.js b/test/tap/adduser-legacy-auth.js deleted file mode 100644 index e46901c2b95fe..0000000000000 --- a/test/tap/adduser-legacy-auth.js +++ /dev/null @@ -1,102 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') - -var contents = '_auth=' + Buffer.from('u:x').toString('base64') + '\n' + - 'registry=https://nonexistent.lvh.me/registry\n' + - 'email=u@p.me\n' - -var responses = { - 'Username': 'u\n', - 'Password': 'p\n', - 'Email': 'u@p.me\n' -} - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:u"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:u', 'auth') - .reply(409, { error: 'user exists' }) - server.get('/-/user/org.couchdb.user:u?write=true') - .reply(200, { _rev: '3-deadcafebabebeef' }) - server.put( - '/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef', - 'auth', - { authorization: 'Basic dTpw' } - ).reply(201, { username: 'u', password: 'p', email: 'u@p.me' }) -} - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp(pkg, function (er) { - t.ifError(er, pkg + ' made successfully') - - fs.writeFile(outfile, contents, function (er) { - t.ifError(er, 'wrote legacy config') - - t.end() - }) - }) -}) - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'error', - '--userconfig', outfile - ], - opts, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(stderr, '', 'no error output') - t.is(code, 0, 'exited OK') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - } - ) - - var remaining = Object.keys(responses).length - runner.stdout.on('data', function (chunk) { - if (remaining > 0) { - remaining-- - - var label = chunk.toString('utf8').split(':')[0] - if (responses[label]) runner.stdin.write(responses[label]) - - if (remaining === 0) runner.stdin.end() - } else { - var message = chunk.toString('utf8').trim() - t.equal(message, 'Logged in as u on ' + common.registry + '/.') - } - }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/adduser-oauth.js b/test/tap/adduser-oauth.js deleted file mode 100644 index 241fef2a2ed7f..0000000000000 --- a/test/tap/adduser-oauth.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var pkg = common.pkg -var fakeBrowser = path.resolve(pkg, '_script.sh') -var configfile = path.resolve(pkg, '_npmrc') -var outfile = path.resolve(pkg, '_outfile') -var ssoUri = common.registry + '/-/oauth/foo' - -common.pendIfWindows('This is trickier to convert without opening new shells') - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:npm_oauth_auth_dummy_user"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:npm_oauth_auth_dummy_user', 'auth') - .reply(201, { token: 'foo', sso: ssoUri }) -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(configfile, '') - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + outfile + '\n' - fs.writeFileSync(fakeBrowser, s, 'ascii') - fs.chmodSync(fakeBrowser, '0755') - t.pass('made script') - t.end() -}) - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).max(1).reply(401, {}) - common.npm( - [ - 'login', - '--registry', common.registry, - '--auth-type=oauth', - '--loglevel', 'silent', - '--userconfig', configfile, - '--browser', fakeBrowser - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.equal(code, 0, 'exited OK') - t.notOk(stderr, 'no error output') - stderr && t.comment('stderr - ', stderr) - t.matches(stdout, /Logged in as igotauthed/, - 'successfully authenticated and output the given username') - s.close() - rimraf.sync(configfile) - rimraf.sync(outfile) - t.end() - } - ) - - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).reply(200, { username: 'igotauthed' }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/adduser-saml.js b/test/tap/adduser-saml.js deleted file mode 100644 index 17a1a9f7b3de6..0000000000000 --- a/test/tap/adduser-saml.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var pkg = common.pkg -var fakeBrowser = path.resolve(pkg, '_script.sh') -var configfile = path.resolve(pkg, '_npmrc') -var outfile = path.resolve(pkg, '_outfile') -var ssoUri = common.registry + '/-/saml/foo' - -common.pendIfWindows('This is trickier to convert without opening new shells') - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:npm_saml_auth_dummy_user"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:npm_saml_auth_dummy_user', 'auth') - .reply(201, { token: 'foo', sso: ssoUri }) -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(configfile, '') - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + outfile + '\n' - fs.writeFileSync(fakeBrowser, s, 'ascii') - fs.chmodSync(fakeBrowser, '0755') - t.pass('made script') - t.end() -}) - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).max(1).reply(401, {}) - common.npm( - [ - 'login', - '--registry', common.registry, - '--auth-type=saml', - '--loglevel', 'silent', - '--userconfig', configfile, - '--browser', fakeBrowser - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.equal(code, 0, 'exited OK') - t.notOk(stderr, 'no error output') - stderr && t.comment('stderr - ', stderr) - t.matches(stdout, /Logged in as igotauthed/, - 'successfully authenticated and output the given username') - s.close() - rimraf.sync(configfile) - rimraf.sync(outfile) - t.end() - } - ) - - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).reply(200, { username: 'igotauthed' }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/aliases.js b/test/tap/aliases.js deleted file mode 100644 index 14251d311bc19..0000000000000 --- a/test/tap/aliases.js +++ /dev/null @@ -1,273 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap.js') -const fs = require('graceful-fs') -const pacote = require('pacote') -const mr = common.fakeRegistry.compat -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const { test } = require('tap') - -const { Dir, File } = Tacks -const readdirAsync = BB.promisify(fs.readdir) -const readFileAsync = BB.promisify(fs.readFile) - -const testDir = common.pkg - -let server -test('setup', t => { - mr({}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('installs an npm: protocol alias package', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}) - })) - - const testDir = t.testdir({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }, null, 2), - }) - - fixture.create(testDir) - const packument = { - name: 'foo', - 'dist-tags': { latest: '1.2.4' }, - versions: { - '1.2.3': { - name: 'foo', - version: '1.2.3', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.3.tgz` - } - }, - '1.2.4': { - name: 'foo', - version: '1.2.4', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.4.tgz` - } - } - } - } - server.get('/foo').reply(200, packument) - - return pacote.tarball(`file:${testDir}`) - .then(tarball => { - server.get('/foo/-/foo-1.2.3.tgz').reply(200, tarball) - server.get('/foo/-/foo-1.2.4.tgz').reply(200, tarball) - return common.npm([ - 'install', 'foo@1.2.3', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0) - t.comment(stdout) - t.comment(stderr) - return common.npm([ - 'install', 'bar@npm:foo@1.2.3', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0) - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /\+ foo@1\.2\.3 \(as bar\)/, 'useful message') - return readFileAsync( - path.join(testDir, 'node_modules', 'bar', 'package.json'), - 'utf8' - ) - }).then(JSON.parse).then(pkg => { - t.similar(pkg, { - name: 'foo', - version: '1.2.3' - }, 'successfully installed foo as bar in node_modules') - return common.npm(['ls', '--json'], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'ls is clean') - t.deepEqual(JSON.parse(stdout), { - dependencies: { - bar: { - version: '1.2.3', - from: 'bar@npm:foo@1.2.3', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.3.tgz' - }, - foo: { - version: '1.2.3', - from: 'foo@1.2.3', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.3.tgz' - } - } - }, 'both dependencies listed correctly') - return common.npm([ - 'outdated', '--json', - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'non-zero because some packages outdated') - t.comment(stdout) - t.comment(stderr) - const parsed = JSON.parse(stdout) - t.match(parsed, { - foo: { - current: '1.2.3', - wanted: '1.2.4', - latest: '1.2.4', - location: /node_modules[/\\]foo/ - }, - bar: { - current: 'npm:foo@1.2.3', - wanted: 'npm:foo@1.2.4', - latest: 'npm:foo@1.2.4', - location: /node_modules[/\\]bar/ - } - }, 'both regular and aliased dependency reported') - return common.npm([ - 'update', - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'update succeeded') - t.comment(stdout) - t.comment(stderr) - return common.npm(['ls', '--json'], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'ls succeeded') - t.comment(stdout) - t.comment(stderr) - const parsed = JSON.parse(stdout) - t.deepEqual(parsed, { - dependencies: { - bar: { - version: '1.2.4', - from: 'bar@npm:foo@1.2.4', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.4.tgz' - }, - foo: { - version: '1.2.4', - from: 'foo@1.2.4', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.4.tgz' - } - } - }, 'ls shows updated packages') - return common.npm([ - 'rm', 'bar', - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'rm succeeded') - t.comment(stdout) - t.comment(stderr) - t.match(stdout, 'removed 1 package', 'notified of removed package') - return readdirAsync(path.join(testDir, 'node_modules')) - }).then(dir => { - t.deepEqual(dir, ['foo'], 'regular foo left in place') - }).then(() => rimraf(testDir)) -}) - -test('installs a tarball dep as a different name than package.json', t => { - return mockTar({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }) - }).then(tarball => { - const fixture = new Tacks(Dir({ - 'package.json': File({}), - 'foo.tgz': File(tarball) - })) - fixture.create(testDir) - return common.npm([ - 'install', 'file:foo.tgz', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - return common.npm([ - 'install', 'bar@file:foo.tgz', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /^\+ foo@1\.2\.3 \(as bar\)/, 'useful message') - return readFileAsync( - path.join(testDir, 'node_modules', 'bar', 'package.json'), - 'utf8' - ) - }).then(JSON.parse).then(pkg => { - t.similar(pkg, { - name: 'foo', - version: '1.2.3' - }, 'successfully installed foo as bar in node_modules') - return common.npm(['ls', '--json'], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.similar(JSON.parse(stdout), { - dependencies: { - bar: { - version: '1.2.3', - from: 'file:foo.tgz' - }, - foo: { - version: '1.2.3', - from: 'file:foo.tgz' - } - } - }, 'both dependencies present') - }).then(() => rimraf(testDir)) -}) - -test('installs a symlink dep as a different name than package.json', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}), - 'foo': Dir({ - 'package.json': File({ - name: 'foo', - version: '1.2.3' - }) - }) - })) - fixture.create(testDir) - return common.npm([ - 'install', 'bar@file:foo', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /^\+ foo@1\.2\.3 \(as bar\)/, 'useful message') - return readFileAsync( - path.join(testDir, 'node_modules', 'bar', 'package.json'), - 'utf8' - ) - }).then(JSON.parse).then(pkg => { - t.similar(pkg, { - name: 'foo', - version: '1.2.3' - }, 'successfully installed foo as bar in node_modules') - }).then(() => rimraf(testDir)) -}) - -test('cleanup', t => { - server.close() - return rimraf(testDir) -}) - -test('npm audit supports aliases') -test('npm audit fix supports aliases') diff --git a/test/tap/anon-cli-metrics.js b/test/tap/anon-cli-metrics.js deleted file mode 100644 index 729d9e607a4a0..0000000000000 --- a/test/tap/anon-cli-metrics.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var rimraf = require('rimraf') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') -var metricsFile = path.join(cachedir, 'anonymous-cli-metrics.json') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_metrics_registry: null, - npm_config_loglevel: 'warn' - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - failure: Dir({ - 'package.json': File({ - name: 'failure', - version: '1.0.0', - scripts: { - preinstall: 'false' - } - }) - }), - success: Dir({ - 'package.json': File({ - name: 'success', - version: '1.0.0' - }) - }), - slow: Dir({ - 'package.json': File({ - name: 'slow', - version: '1.0.0', - scripts: { - preinstall: 'node -e "setTimeout(function(){}, 500)"' - } - }) - }), - 'package.json': File({ - name: 'anon-cli-metrics-test', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -function reset () { - rimraf.sync(testdir + '/' + 'node_modules') -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.filteringPathRegEx(/([/]-[/]npm[/]anon-metrics[/]v1[/]).*/, '$1:id') - server.filteringRequestBody(function (body) { - var metrics = typeof body === 'string' ? JSON.parse(body) : body - delete metrics.from - delete metrics.to - return JSON.stringify(metrics) - }) - t.done() - }) -}) - -test('record success', function (t) { - common.npm(['install', '--no-save', '--no-send-metrics', 'file:success'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'always succeeding install succeeded') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var data = JSON.parse(fs.readFileSync(metricsFile)) - t.is(data.metrics.successfulInstalls, 1, 'successes') - t.is(data.metrics.failedInstalls, 0, 'failures') - t.done() - }) -}) - -test('record failure', function (t) { - reset() - server.put('/-/npm/anon-metrics/v1/:id', { - successfulInstalls: 1, - failedInstalls: 0 - }).reply(500, {ok: false}) - common.npm(['install', '--no-save', '--send-metrics', 'file:failure'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.notEqual(code, 0, 'always failing install fails') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var data = JSON.parse(fs.readFileSync(metricsFile)) - t.is(data.metrics.successfulInstalls, 1, 'successes') - t.is(data.metrics.failedInstalls, 1, 'failures') - t.done() - }) -}) - -test('report', function (t) { - reset() - server.put('/-/npm/anon-metrics/v1/:id', { - successfulInstalls: 1, - failedInstalls: 1 - }).reply(200, {ok: true}) - common.npm(['install', '--no-save', '--send-metrics', 'file:slow'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - // todo check mock registry for post - var data = JSON.parse(fs.readFileSync(metricsFile)) - t.is(data.metrics.successfulInstalls, 1, 'successes') - t.is(data.metrics.failedInstalls, 0, 'failures') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/audit-fix.js b/test/tap/audit-fix.js deleted file mode 100644 index a832078ae9369..0000000000000 --- a/test/tap/audit-fix.js +++ /dev/null @@ -1,829 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = BB.promisifyAll(require('../common-tap.js')) -const fs = require('fs') -const mr = common.fakeRegistry.compat -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const tap = require('tap') -const test = tap.test - -const Dir = Tacks.Dir -const File = Tacks.File -const testDir = common.pkg - -const EXEC_OPTS = { cwd: testDir } - -tap.tearDown(function () { - process.chdir(__dirname) - try { - rimraf.sync(testDir) - } catch (e) { - if (process.platform !== 'win32') { - throw e - } - } -}) - -function tmock (t) { - return mr({port: common.port}).then(s => { - t.tearDown(function () { - s.done() - s.close() - rimraf.sync(testDir) - }) - return s - }) -} - -test('fixes shallow vulnerabilities', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.2.3' - }] - }, 'reported dependency update') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - baddep: { - version: '1.2.3', - resolved: common.registry + '/idk/-/idk-1.2.3.tgz', - integrity: 'sha1-3q2+7w==' - } - } - }, 'pkglock updated correctly') - }) - }) - }) -}) - -test('fixes nested dep vulnerabilities', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - gooddep: '^1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'c0ffee', - integrity: 'sha1-c0ffee', - tarball: common.registry + '/baddep/-/baddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'bada55', - integrity: 'sha1-bada55', - tarball: common.registry + '/baddep/-/baddep-1.2.3.tgz' - } - } - } - }) - - srv.get('/gooddep').reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - dependencies: { - baddep: '^1.0.0' - }, - _hasShrinkwrap: false, - dist: { - shasum: '1234', - tarball: common.registry + '/gooddep/-/gooddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dependencies: { - baddep: '^1.0.0' - }, - dist: { - shasum: '123456', - tarball: common.registry + '/gooddep/-/gooddep-1.2.3.tgz' - } - } - } - }) - - return common.npm([ - 'install', - '--audit', - '--json', - '--global-style', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'gooddep>baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--offline', - '--json', - '--global-style', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.2.3' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'reported dependency update') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - gooddep: { - version: '1.0.0', - resolved: common.registry + '/gooddep/-/gooddep-1.0.0.tgz', - integrity: 'sha1-EjQ=', - requires: { - baddep: '^1.0.0' - }, - dependencies: { - baddep: { - version: '1.2.3', - resolved: common.registry + '/baddep/-/baddep-1.2.3.tgz', - integrity: 'sha1-bada55' - } - } - } - } - }, 'pkglock updated correctly') - }) - }) - }) -}) - -test('no semver-major without --force', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '2.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '2.0.0': { - name: 'baddep', - version: '2.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-2.0.0.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'install', - module: 'baddep', - target: '2.0.0', - isMajor: true, - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--registry', common.registry, - '--loglevel=warn', - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.match(stdout, /breaking changes/, 'informs about semver-major') - t.match(stdout, /npm audit fix --force/, 'recommends --force') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - baddep: { - version: '1.0.0' - } - } - }, 'pkglock not updated') - }) - }) - }) -}) - -test('semver-major when --force', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '2.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '2.0.0': { - name: 'baddep', - version: '2.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-2.0.0.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'install', - module: 'baddep', - target: '2.0.0', - isMajor: true, - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--registry', common.registry, - '--force', - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.match(stdout, /breaking changes/, 'informs about semver-major') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - baddep: { - version: '2.0.0' - } - } - }, 'pkglock not updated') - }) - }) - }) -}) - -test('no installs for review-requires', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'k') - srv.post('/-/npm/v1/security/audits/quick', 'k').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'review', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'no update for dependency') - }) - }) - }) -}) - -test('nothing to fix', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - gooddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/gooddep').twice().reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'installed good version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [], - metadata: { - vulnerabilities: { } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'nothing to update') - }) - }) - }) -}) - -test('preserves deep deps dev: true', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - devDependencies: { - gooddep: '^1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'c0ffee', - integrity: 'sha1-c0ffee', - tarball: common.registry + '/baddep/-/baddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'bada55', - integrity: 'sha1-bada55', - tarball: common.registry + '/baddep/-/baddep-1.2.3.tgz' - } - } - } - }) - - srv.get('/gooddep').reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - dependencies: { - baddep: '^1.0.0' - }, - _hasShrinkwrap: false, - dist: { - shasum: '1234', - tarball: common.registry + '/gooddep/-/gooddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dependencies: { - baddep: '^1.0.0' - }, - dist: { - shasum: '123456', - tarball: common.registry + '/gooddep/-/gooddep-1.2.3.tgz' - } - } - } - }) - - return common.npm([ - 'install', - '--audit', - '--json', - '--global-style', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'gooddep>baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--offline', - '--json', - '--global-style', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.2.3' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'reported dependency update') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - gooddep: { - dev: true, - version: '1.0.0', - resolved: common.registry + '/gooddep/-/gooddep-1.0.0.tgz', - integrity: 'sha1-EjQ=', - requires: { - baddep: '^1.0.0' - }, - dependencies: { - baddep: { - dev: true, - version: '1.2.3', - resolved: common.registry + '/baddep/-/baddep-1.2.3.tgz', - integrity: 'sha1-bada55' - } - } - } - } - }, 'pkglock updated correctly') - }) - }) - }) -}) - -test('cleanup', t => { - return rimraf(testDir) -}) diff --git a/test/tap/audit.js b/test/tap/audit.js deleted file mode 100644 index ca3da87a3af62..0000000000000 --- a/test/tap/audit.js +++ /dev/null @@ -1,578 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = BB.promisifyAll(require('../common-tap.js')) -const mr = BB.promisify(require('npm-registry-mock')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const tap = require('tap') -const test = tap.test - -const Dir = Tacks.Dir -const File = Tacks.File -const testDir = common.pkg - -const EXEC_OPTS = { cwd: testDir } - -function tmock (t) { - return mr({port: common.port}).then(s => { - t.tearDown(function () { - s.done() - s.close() - rimraf.sync(testDir) - }) - return s - }) -} - -const quickAuditResult = { - actions: [], - advisories: { - '1316': { - findings: [ - { - version: '1.0.0', - paths: [ - 'baddep' - ] - } - ], - 'id': 1316, - 'created': '2019-11-14T15:29:41.991Z', - 'updated': '2019-11-14T19:35:30.677Z', - 'deleted': null, - 'title': 'Arbitrary Code Execution', - 'found_by': { - 'link': '', - 'name': 'François Lajeunesse-Robert', - 'email': '' - }, - 'reported_by': { - 'link': '', - 'name': 'François Lajeunesse-Robert', - 'email': '' - }, - 'module_name': 'baddep', - 'cves': [], - 'vulnerable_versions': '<4.5.2', - 'patched_versions': '>=4.5.2', - 'overview': 'a nice overview of the advisory', - 'recommendation': 'how you should fix it', - 'references': '', - 'access': 'public', - 'severity': 'high', - 'cwe': 'CWE-79', - 'metadata': { - 'module_type': '', - 'exploitability': 6, - 'affected_components': '' - }, - 'url': 'https://npmjs.com/advisories/1234542069' - } - }, - 'muted': [], - 'metadata': { - 'vulnerabilities': { - 'info': 0, - 'low': 0, - 'moderate': 0, - 'high': 1, - 'critical': 0 - }, - 'dependencies': 1, - 'devDependencies': 0, - 'totalDependencies': 1 - } -} - -test('exits with zero exit code for vulnerabilities below the `audit-level` flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, quickAuditResult) - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - const result = JSON.parse(stdout) - t.same(result.audit, quickAuditResult, 'printed quick audit result') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - low: 1 - } - } - }) - return common.npm([ - 'audit', - '--audit-level', 'high', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - }) - }) - }) -}) - -test('shows quick audit results summary for human', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, quickAuditResult) - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--no-json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.match(stdout, new RegExp('added 1 package and audited 1 package in .*\\n' + - 'found 1 high severity vulnerability\\n' + - ' run `npm audit fix` to fix them, or `npm audit` for details\\n'), - 'shows quick audit result') - }) - }) -}) - -test('exits with non-zero exit code for vulnerabilities at the `audit-level` flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - high: 1 - } - } - }) - return common.npm([ - 'audit', - '--audit-level', 'high', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'exited OK') - }) - }) - }) -}) - -test('exits with non-zero exit code for vulnerabilities at the `audit-level` flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - high: 1 - } - } - }) - return common.npm([ - 'audit', - '--audit-level', 'moderate', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'exited OK') - }) - }) - }) -}) - -test('exits with zero exit code for vulnerabilities in devDependencies when running with production flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - gooddep: '1.0.0' - }, - devDependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/gooddep').twice().reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--production', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [], - metadata: { - vulnerabilities: {} - } - }) - return common.npm([ - 'audit', - '--json', - '--production', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - }) - }) - }) -}) - -test('exits with non-zero exit code for vulnerabilities in dependencies when running with production flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - }, - devDependencies: { - gooddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - srv.get('/gooddep').twice().reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--production', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - low: 1 - } - } - }) - return common.npm([ - 'audit', - '--json', - '--production', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'exited OK') - }) - }) - }) -}) - -test('cleanup', t => { - return rimraf(testDir) -}) diff --git a/test/tap/auto-prune.js b/test/tap/auto-prune.js deleted file mode 100644 index aab3692a3b242..0000000000000 --- a/test/tap/auto-prune.js +++ /dev/null @@ -1,147 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - minimist: Dir({ - 'package.json': File({ - _integrity: 'sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=', - _resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz', - name: 'minimist', - version: '0.0.8' - }) - }), - mkdirp: Dir({ - 'package.json': File({ - _integrity: 'sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=', - _resolved: 'https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz', - dependencies: { - minimist: '0.0.8' - }, - name: 'mkdirp', - version: '0.5.1' - }) - }), - null: Dir({ - 'package.json': File({ - _integrity: 'sha1-WoIdUnAxMlyG06AasQFzKgkfoew=', - _resolved: 'https://registry.npmjs.org/null/-/null-1.0.1.tgz', - _spec: 'null', - name: 'null', - version: '1.0.1' - }) - }) - }), - 'package-lock.json': File({ - name: 'with-lock', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: { - version: '0.0.8', - resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz', - integrity: 'sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=' - }, - mkdirp: { - version: '0.5.1', - resolved: 'https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz', - integrity: 'sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=', - requires: { - minimist: '0.0.8' - } - } - } - }), - 'package.json': File({ - name: 'with-lock', - version: '1.0.0', - dependencies: { - mkdirp: '^0.5.1' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('auto-prune w/ package-lock', function (t) { - common.npm(['install', '--dry-run', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - const result = JSON.parse(stdout) - t.is(result.added.length, 0, 'nothing added') - t.is(result.updated.length, 0, 'nothing updated') - t.is(result.moved.length, 0, 'nothing moved') - t.is(result.failed.length, 0, 'nothing failed') - t.is(result.removed.length, 1, 'pruned 1') - t.like(result, {'removed': [{'name': 'null'}]}, 'pruned the right one') - t.done() - }) -}) - -test('auto-prune w/ --no-package-lock', function (t) { - common.npm(['install', '--dry-run', '--json', '--no-package-lock'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - const result = JSON.parse(stdout) - t.is(result.added.length, 0, 'nothing added') - t.is(result.updated.length, 0, 'nothing updated') - t.is(result.moved.length, 0, 'nothing moved') - t.is(result.failed.length, 0, 'nothing failed') - t.is(result.removed.length, 0, 'nothing pruned') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/bearer-token-check.js b/test/tap/bearer-token-check.js deleted file mode 100644 index 86602b303c9f0..0000000000000 --- a/test/tap/bearer-token-check.js +++ /dev/null @@ -1,109 +0,0 @@ -var resolve = require('path').resolve -var writeFileSync = require('graceful-fs').writeFileSync - -var fs = require('fs') -var mkdirp = require('mkdirp') -var http = require('http') -const t = require('tap') - -var common = require('../common-tap.js') -var toNerfDart = require('../../lib/config/nerf-dart.js') - -var pkg = common.pkg -var outfile = resolve(pkg, '_npmrc') -var modules = resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -// needs to be a different hostname to verify tokens (not) being sent correctly -var tarballURL = 'http://127.0.0.1:' + common.port + tarballPath -var tarball = resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 'pipe', 2] } - -var auth = 'Bearer 0xabad1dea' -var server = http.createServer() -server.on('request', (req, res) => { - if (req.method === 'GET' && req.url === tarballPath) { - if (req.headers.authorization === auth) { - res.writeHead(403, 'this token should not be sent') - res.end() - } else { - res.writeHead(200, 'ok') - res.end(fs.readFileSync(tarball)) - } - } else { - res.writeHead(500) - res.end() - } -}) - -var contents = '@scoped:registry=' + common.registry + '\n' + - toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.3.1' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - version: '1.3.1' - } - } -} - -t.teardown(() => server.close()) - -t.test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - server.listen(common.port, t.end) -}) - -t.test('authed npm install with tarball not on registry', function (t) { - common.npm( - [ - 'install', - '--json', - '--fetch-retries', 0, - '--registry', common.registry, - '--userconfig', outfile - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.notOk(stderr, 'no output on stderr') - try { - var results = JSON.parse(stdout) - } catch (ex) { - t.ifError(ex, 'stdout was valid JSON') - } - - if (results) { - var installedversion = [ - { - 'name': '@scoped/underscore', - 'version': '1.3.1' - } - ] - t.match(results.added, installedversion, '@scoped/underscore installed') - } - - t.end() - } - ) -}) diff --git a/test/tap/bin.js b/test/tap/bin.js deleted file mode 100644 index bf2397777ce40..0000000000000 --- a/test/tap/bin.js +++ /dev/null @@ -1,23 +0,0 @@ -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var opts = { cwd: common.pkg } -var binDir = '../../../node_modules/.bin' -var fixture = path.resolve(common.pkg, binDir) - -test('setup', function (t) { - rimraf.sync(path.join(common.pkg, 'node_modules')) - t.end() -}) - -test('npm bin', function (t) { - common.npm(['bin'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bin ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = path.resolve(stdout) - t.equal(res, fixture + '\n') - t.end() - }) -}) diff --git a/test/tap/bitbucket-https-url-with-creds-package.js b/test/tap/bitbucket-https-url-with-creds-package.js deleted file mode 100644 index f0f14dcb34475..0000000000000 --- a/test/tap/bitbucket-https-url-with-creds-package.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-https-url-with-creds-package', - version: '0.0.0', - dependencies: { - 'private': 'git+https://user:pass@bitbucket.org/foo/private.git' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-https-url-with-creds-package', function (t) { - var cloneUrls = [ - ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (err) { - t.match(err.message, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/bitbucket-https-url-with-creds.js b/test/tap/bitbucket-https-url-with-creds.js deleted file mode 100644 index 703d0d9a6ab60..0000000000000 --- a/test/tap/bitbucket-https-url-with-creds.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-https-url-with-creds', - version: '0.0.0' -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-https-url-with-creds', function (t) { - var cloneUrls = [ - ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['git+https://user:pass@bitbucket.org/foo/private.git'], function (err) { - t.match(err, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/bitbucket-shortcut-package.js b/test/tap/bitbucket-shortcut-package.js deleted file mode 100644 index a148c598c6870..0000000000000 --- a/test/tap/bitbucket-shortcut-package.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-shortcut-package', - version: '0.0.0', - dependencies: { - 'private': 'bitbucket:foo/private' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-shortcut', function (t) { - var cloneUrls = [ - ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs first'], - ['ssh://git@bitbucket.org/foo/private.git', 'Bitbucket shortcuts try SSH second'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (err) { - t.match(err.message, /fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/bitbucket-shortcut.js b/test/tap/bitbucket-shortcut.js deleted file mode 100644 index 6d750f869a306..0000000000000 --- a/test/tap/bitbucket-shortcut.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-shortcut', - version: '0.0.0' -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-shortcut', function (t) { - var cloneUrls = [ - ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs first'], - ['ssh://git@bitbucket.org/foo/private.git', 'Bitbucket shortcuts try SSH second'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['bitbucket:foo/private'], function (err) { - t.match(err.message, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/build-already-built.js b/test/tap/build-already-built.js deleted file mode 100644 index 3410432ab2244..0000000000000 --- a/test/tap/build-already-built.js +++ /dev/null @@ -1,60 +0,0 @@ -// if "npm rebuild" is run with bundled dependencies, -// message "already built" should not be error -var test = require('tap').test -var path = require('path') -var npmlog = require('npmlog') -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') - -var npm = require('../../lib/npm.js') - -const common = require('../common-tap.js') -var PKG_DIR = common.pkg -var fakePkg = path.resolve(PKG_DIR, 'foo') - -test("issue #6735 build 'already built' message", function (t) { - npm.load({ loglevel: 'warn' }, function () { - // capture log messages with level - var log = '' - npmlog.on('log', function (chunk) { - log += chunk.level + ' ' + chunk.message + '\n' - }) - - mkdirp.sync(fakePkg) - var folder = path.resolve(fakePkg) - - var global = npm.config.get('global') - - var build = requireInject('../../lib/build', { - }) - - t.test('pin previous behavior', function (t) { - build([fakePkg], global, false, false, function (err) { - t.ok(err, 'build failed as expected') - t.similar(err.message, /package.json/, 'missing package.json as expected') - t.notSimilar(log, /already built/, 'no already built message written') - - t.end() - }) - }) - - t.test('simulate rebuild of bundledDependency', function (t) { - log = '' - - build._didBuild[folder] = true - - build([fakePkg], global, false, false, function (err) { - t.ok(err, 'build failed as expected') - t.similar(err.message, /package.json/, 'missing package.json as expected') - - t.similar(log, /already built/, 'already built message written') - t.notSimilar(log, /ERR! already built/, 'already built message written is not error') - t.similar(log, /info already built/, 'already built message written is info') - - t.end() - }) - }) - - t.end() - }) -}) diff --git a/test/tap/builtin-config.js b/test/tap/builtin-config.js deleted file mode 100644 index dddd40565101a..0000000000000 --- a/test/tap/builtin-config.js +++ /dev/null @@ -1,136 +0,0 @@ -var fs = require('fs') - -if (process.argv[2] === 'write-builtin') { - var pid = process.argv[3] - fs.writeFileSync('npmrc', 'foo=bar\npid=' + pid + '\n') - process.exit(0) -} - -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var folder = common.pkg -var test = require('tap').test -var npm = path.resolve(__dirname, '../..') -var spawn = require('child_process').spawn -var node = common.nodeBin - -test('setup', function (t) { - t.plan(1) - rimraf.sync(folder) - mkdirp.sync(folder + '/first') - mkdirp.sync(folder + '/second') - mkdirp.sync(folder + '/cache') - mkdirp.sync(folder + '/tmp') - - t.pass('finished setup') - t.end() -}) - -test('install npm into first folder', function (t) { - t.plan(1) - var args = ['install', npm, '-g', - '--prefix=' + folder + '/first', - '--ignore-scripts', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp', - '--loglevel=warn', - '--progress'] - common.npm(args, {}, function (er, code) { - if (er) throw er - t.equal(code, 0) - t.end() - }) -}) - -test('write npmrc file', function (t) { - t.plan(1) - common.npm(['explore', 'npm', '-g', - '--prefix=' + folder + '/first', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp', - '--', node, __filename, 'write-builtin', process.pid - ], - {'stdio': 'inherit'}, - function (er, code) { - if (er) throw er - t.equal(code, 0) - t.end() - }) -}) - -test('use first npm to install second npm', function (t) { - t.plan(3) - // get the root location - common.npm( - [ - 'root', '-g', - '--prefix=' + folder + '/first', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], - {}, - function (er, code, so) { - if (er) throw er - t.equal(code, 0, 'got npm root') - var root = so.trim() - t.ok(fs.statSync(root).isDirectory(), 'npm root is dir') - - var bin = path.resolve(root, 'npm/bin/npm-cli.js') - spawn( - node, - [ - bin, - 'install', npm, - '-g', - '--ignore-scripts', - '--prefix=' + folder + '/second', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], - {} - ) - .on('error', function (er) { throw er }) - .on('close', function (code) { - t.equal(code, 0, 'second npm install') - t.end() - }) - } - ) -}) - -test('verify that the builtin config matches', function (t) { - t.plan(3) - common.npm([ 'root', '-g', - '--prefix=' + folder + '/first', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], {}, - function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var firstRoot = so.trim() - common.npm([ 'root', '-g', - '--prefix=' + folder + '/second', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], {}, - function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var secondRoot = so.trim() - var firstRc = path.resolve(firstRoot, 'npm', 'npmrc') - var secondRc = path.resolve(secondRoot, 'npm', 'npmrc') - var firstData = fs.readFileSync(firstRc, 'utf8').split(/\r?\n/) - var secondData = fs.readFileSync(secondRc, 'utf8').split(/\r?\n/) - t.isDeeply(firstData, secondData) - t.end() - }) - }) -}) - -test('clean', function (t) { - rimraf.sync(folder) - t.end() -}) diff --git a/test/tap/bundled-dependencies-nonarray.js b/test/tap/bundled-dependencies-nonarray.js deleted file mode 100644 index fdc32c2883af1..0000000000000 --- a/test/tap/bundled-dependencies-nonarray.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var dir = common.pkg -var pkg = path.resolve(dir, 'pkg-with-bundled') -var dep = path.resolve(dir, 'a-bundled-dep') - -var pj = JSON.stringify({ - name: 'pkg-with-bundled', - version: '1.0.0', - dependencies: { - 'a-bundled-dep': 'file:../a-bundled-dep-2.0.0.tgz' - }, - bundledDependencies: { - 'a-bundled-dep': 'file:../a-bundled-dep-2.0.0.tgz' - } -}, null, 2) + '\n' - -var pjDep = JSON.stringify({ - name: 'a-bundled-dep', - version: '2.0.0' -}, null, 2) + '\n' - -test('setup', function (t) { - bootstrap() - t.end() -}) - -test('handles non-array bundleddependencies', function (t) { - return Bluebird.try(() => { - return common.npm(['pack', 'a-bundled-dep/'], {cwd: dir, stdio: [0, 1, 2]}) - }).spread((code) => { - t.is(code, 0, 'built a-bundled-dep') - return common.npm(['install'], {cwd: pkg, stdio: [0, 1, 2]}) - }).spread((code) => { - t.is(code, 0, 'prepared pkg-with-bundled') - return common.npm(['pack', 'pkg-with-bundled/'], {cwd: dir, stdio: [0, 1, 'pipe']}) - }).spread((code, _, stderr) => { - t.equal(code, 0, 'exited with a error code') - t.equal(stderr, '') - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function bootstrap () { - cleanup() - mkdirp.sync(dir) - mkdirp.sync(path.join(dir, 'node_modules')) - - mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) - - mkdirp.sync(dep) - fs.writeFileSync(path.resolve(dep, 'package.json'), pjDep) -} - -function cleanup () { - rimraf.sync(dir) -} diff --git a/test/tap/bundled-dependencies.js b/test/tap/bundled-dependencies.js deleted file mode 100644 index 6dbfa8cb08d74..0000000000000 --- a/test/tap/bundled-dependencies.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') -var tar = require('tar') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-bundled-deps') -var targetpath = path.resolve(basepath, 'target') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -test('basic bundling', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - bundledDependencies: [ - 'addme' - ] - }), - node_modules: Dir({ - addme: Dir({ - 'index.js': File('') - }), - iggyme: Dir({ - 'index.js': File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('node_modules/addme'), 'bundled dep included') - t.notOk(fileExists('node_modules/iggyme'), 'unspecified dep not included') - done() - }) -}) - -test('scoped dep bundling', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - bundledDependencies: [ - '@foo/addme' - ] - }), - node_modules: Dir({ - '@foo': Dir({ - addme: Dir({ - 'index.js': File('') - }), - iggyme: Dir({ - 'index.js': File('') - }) - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('node_modules/@foo/addme'), 'bundled dep included') - t.notOk( - fileExists('node_modules/@foo/iggyme'), - 'unspecified dep not included') - done() - }) -}) - -function fileExists (file) { - try { - return !!fs.statSync(path.resolve(targetpath, 'package', file)) - } catch (_) { - return false - } -} - -function withFixture (t, fixture, tester) { - fixture.create(fixturepath) - mkdirp.sync(targetpath) - common.npm(['pack', fixturepath], {cwd: basepath}, extractAndCheck) - function extractAndCheck (err, code) { - if (err) throw err - t.is(code, 0, 'pack went ok') - extractTarball(checkTests) - } - function checkTests (err) { - if (err) throw err - tester(removeAndDone) - } - function removeAndDone (err) { - if (err) throw err - fixture.remove(fixturepath) - rimraf.sync(basepath) - t.done() - } -} - -function extractTarball (cb) { - // Unpack to disk so case-insensitive filesystems are consistent - tar.extract({ - file: path.join(basepath, 'npm-test-files-1.2.5.tgz'), - cwd: targetpath - }).then(cb, cb) -} diff --git a/test/tap/bundled-no-add-to-move.js b/test/tap/bundled-no-add-to-move.js deleted file mode 100644 index f9146c0e01201..0000000000000 --- a/test/tap/bundled-no-add-to-move.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var test = require('tap').test -var Node = require('../../lib/install/node.js').create -var npm = require('../../lib/npm.js') - -var oldTree = Node({ - path: '/', - location: '/', - children: [ - Node({ - package: {name: 'one', version: '1.0.0'}, - path: '/node_modules/one', - location: '/one' - }) - ] -}) -oldTree.children[0].requiredBy.push(oldTree) - -var newTree = Node({ - path: '/', - location: '/', - children: [ - Node({ - package: {name: 'abc', version: '1.0.0'}, - path: '/node_modules/abc', - location: '/abc', - children: [ - Node({ - package: {name: 'one', version: '1.0.0'}, - fromBundle: true, - path: '/node_modules/abc/node_modules/one', - location: '/abc/one' - }) - ] - }) - ] -}) -newTree.children[0].requiredBy.push(newTree) -newTree.children[0].children[0].requiredBy.push(newTree.children[0]) - -test('test', function (t) { - npm.load({}, (err) => { - if (err) throw err - var diffTrees = require('../../lib/install/diff-trees.js')._diffTrees - var sortActions = require('../../lib/install/diff-trees.js').sortActions - var differences = sortActions(diffTrees(oldTree, newTree)).map(function (diff) { return diff[0] + diff[1].location }) - t.isDeeply(differences, ['add/abc/one', 'remove/one', 'add/abc'], 'bundled add/remove stays add/remove') - t.end() - }) -}) diff --git a/test/tap/bundled-transitive-deps.js b/test/tap/bundled-transitive-deps.js deleted file mode 100644 index d3f296ab1612f..0000000000000 --- a/test/tap/bundled-transitive-deps.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var npm = require('../../lib/npm.js') -var tar = require('tar') -var mkdirp = require('mkdirp') -var testdir = common.pkg -var packed = path.join(testdir, 'packed') - -var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'bundled-transitive-deps', - version: '1.0.0', - dependencies: { - 'a': '1.0.0', - '@c/d': '1.0.0' - }, - bundleDependencies: [ - 'a', - '@c/d' - ] - }), - node_modules: Dir({ - 'a': Dir({ - 'package.json': File({ - name: 'a', - version: '1.0.0', - dependencies: { - 'b': '1.0.0' - } - }) - }), - 'b': Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }), - '@c/d': Dir({ - 'package.json': File({ - name: '@c/d', - version: '1.0.0' - }), - 'node_modules': Dir({ - 'e': Dir({ - 'package.json': File({ - name: 'e', - version: '1.0.0' - }) - }) - }) - }) - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - npm.load({}, t.end) -}) - -function exists (t, filename) { - t.doesNotThrow(filename + ' exists', function () { - fs.statSync(filename) - }) -} - -test('bundled-transitive-deps', function (t) { - common.npm(['pack'], {cwd: testdir}, thenCheckPack) - function thenCheckPack (err, code, stdout, stderr) { - if (err) throw err - var tarball = stdout.trim() - t.comment(stderr.trim()) - t.is(code, 0, 'pack successful') - mkdirp.sync(packed) - tar.extract({ - file: path.join(testdir, tarball), - cwd: packed, - strip: 1, - sync: true - }) - var transitivePackedDep = path.join(packed, 'node_modules', 'b') - exists(t, transitivePackedDep) - var nestedScopedDep = path.join(packed, 'node_modules', '@c', 'd', 'node_modules', 'e') - exists(t, nestedScopedDep) - t.end() - } -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/cache-add-unpublished.js b/test/tap/cache-add-unpublished.js deleted file mode 100644 index 08592a50deebb..0000000000000 --- a/test/tap/cache-add-unpublished.js +++ /dev/null @@ -1,37 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test - -test('cache add', function (t) { - setup(function (er, s) { - if (er) { - throw er - } - common.npm( - [ - 'cache', - 'add', - 'superfoo', - '--registry=http://localhost:' + common.port + '/' - ], - {}, - function (er, c, so, se) { - if (er) throw er - t.ok(c, 'got non-zero exit code') - t.equal(so, '', 'nothing printed to stdout') - t.similar(se, /404 Not Found.*superfoo/, 'got expected error') - s.close() - t.end() - } - ) - }) -}) - -function setup (cb) { - var s = require('http').createServer(function (req, res) { - res.statusCode = 404 - res.end('{"error":"not_found"}\n') - }) - s.listen(common.port, function () { - cb(null, s) - }) -} diff --git a/test/tap/cache-eacces-error-message.js b/test/tap/cache-eacces-error-message.js deleted file mode 100644 index fe76875c3e024..0000000000000 --- a/test/tap/cache-eacces-error-message.js +++ /dev/null @@ -1,35 +0,0 @@ -const npm = require('../../lib/npm.js') -const t = require('tap') - -const common = require('../common-tap.js') - -common.skipIfWindows('this is a unix-only thing') - -const errorMessage = require('../../lib/utils/error-message.js') - -t.plan(1) - -npm.load({ cache: common.cache }, () => { - npm.config.set('cache', common.cache) - const er = new Error('access is e, i am afraid') - er.code = 'EACCES' - er.errno = -13 - er.path = common.cache + '/src' - er.dest = common.cache + '/to' - - t.match(errorMessage(er), { - summary: [ - [ - '', - new RegExp('\n' + - 'Your cache folder contains root-owned files, due to a bug in\n' + - 'previous versions of npm which has since been addressed.\n' + - '\n' + - 'To permanently fix this problem, please run:\n' + - ' sudo chown -R [0-9]+:[0-9]+ ".*npm_cache_cache-eacces-error-message"' - ) - ] - ], - detail: [] - }, 'get the helpful error message') -}) diff --git a/test/tap/cache-shasum-fork.js b/test/tap/cache-shasum-fork.js deleted file mode 100644 index fade5ffb646c5..0000000000000 --- a/test/tap/cache-shasum-fork.js +++ /dev/null @@ -1,92 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -// Install from a tarball that thinks it is underscore@1.5.1 -// (but is actually a fork) -var forkPath = path.resolve( - __dirname, '..', 'fixtures', 'forked-underscore-1.5.1.tgz' -) -var pkg = common.pkg -var cache = common.cache -var server - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'node_modules')) - process.chdir(pkg) - t.comment('test for https://github.com/npm/npm/issues/3265') - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -test('npm cache - install from fork', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--json', - '--registry', common.registry, - 'install', forkPath - ], - { - cwd: pkg, - env: { npm_config_cache: cache } - }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished without error') - t.equal(stderr, '', 'Should not get data on stderr') - t.equal(code, 0, 'install finished successfully') - - var deps = {} - JSON.parse(stdout).added.forEach(function (dep) { deps[dep.name] = dep }) - t.equal(deps.underscore && deps.underscore.version, '1.5.1') - var index = fs.readFileSync( - path.join(pkg, 'node_modules', 'underscore', 'index.js'), - 'utf8' - ) - t.equal(index, 'console.log("This is the fork");\n\n') - t.end() - } - ) -}) - -// Now install the real 1.5.1. -test('npm cache - install from origin', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--json', - '--registry', common.registry, - 'install', 'underscore' - ], - { - cwd: pkg, - env: { npm_config_cache: cache } - }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished without error') - t.equal(code, 0, 'install finished successfully') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - var deps = {} - JSON.parse(stdout).updated.forEach(function (dep) { deps[dep.name] = dep }) - t.equal(deps.underscore && deps.underscore.version, '1.5.1') - var index = fs.readFileSync( - path.join(pkg, 'node_modules', 'underscore', 'index.js'), - 'utf8' - ) - t.equal(index, 'module.exports = require(\'./underscore\');\n') - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/test/tap/check-cpu-reqs.js b/test/tap/check-cpu-reqs.js deleted file mode 100644 index d70660b05887f..0000000000000 --- a/test/tap/check-cpu-reqs.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-cpu-reqs', - version: '0.0.1', - description: 'fixture', - cpu: ['fake-cpu'] -} - -test('setup', function (t) { - setup() - t.end() -}) - -var INSTALL_OPTS = ['--loglevel', 'silly'] -var EXEC_OPTS = {cwd: installIn} - -test('install bad cpu', function (t) { - common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install bad cpu', function (t) { - common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - process.chdir(base) -} diff --git a/test/tap/check-engine-reqs.js b/test/tap/check-engine-reqs.js deleted file mode 100644 index eec07562885c9..0000000000000 --- a/test/tap/check-engine-reqs.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-engine-reqs', - version: '0.0.1', - description: 'fixture', - engines: { - node: '1.0.0-not-a-real-version' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -var INSTALL_OPTS = ['--loglevel', 'silly'] -var EXEC_OPTS = {cwd: installIn} -test('install bad engine', function (t) { - common.npm(['install', '--engine-strict', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install bad engine', function (t) { - common.npm(['install', '--engine-strict', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -test('warns on bad engine not strict', function (t) { - common.npm(['install', '--json', installFrom], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'result code') - var result = JSON.parse(stdout) - t.match(result.warnings[0], /Unsupported engine/, 'reason for optional failure in JSON') - t.match(result.warnings[0], /1.0.0-not-a-real-version/, 'should print mismatch version info') - t.match(result.warnings[0], /Not compatible with your version of node/, 'incompatibility message') - t.done() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - process.chdir(base) -} diff --git a/test/tap/check-install-self.js b/test/tap/check-install-self.js deleted file mode 100644 index 63901a12df671..0000000000000 --- a/test/tap/check-install-self.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-install-self', - version: '0.0.1', - description: 'fixture' -} - -test('setup', function (t) { - setup() - t.end() -}) - -var EXEC_OPTS = {cwd: installIn} - -test('install self', function (t) { - common.npm(['install', installFrom], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install self', function (t) { - common.npm(['install', '--force', installFrom], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - fs.writeFileSync( - path.join(installIn, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(base) -} diff --git a/test/tap/check-os-reqs.js b/test/tap/check-os-reqs.js deleted file mode 100644 index 66dcbd5328e06..0000000000000 --- a/test/tap/check-os-reqs.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-os-reqs', - version: '0.0.1', - description: 'fixture', - os: ['fake-os'] -} - -test('setup', function (t) { - setup() - t.end() -}) - -var INSTALL_OPTS = ['--loglevel', 'silly'] -var EXEC_OPTS = {cwd: installIn} - -test('install bad os', function (t) { - common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install bad os', function (t) { - common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - process.chdir(base) -} diff --git a/test/tap/check-permissions.js b/test/tap/check-permissions.js deleted file mode 100644 index b8238891d9075..0000000000000 --- a/test/tap/check-permissions.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var writable = require('../../lib/install/writable.js').fsAccessImplementation -var writableFallback = require('../../lib/install/writable.js').fsOpenImplementation -var exists = require('../../lib/install/exists.js').fsAccessImplementation -var existsFallback = require('../../lib/install/exists.js').fsStatImplementation - -const common = require('../common-tap.js') -var testBase = common.pkg -var existingDir = path.resolve(testBase, 'exists') -var nonExistingDir = path.resolve(testBase, 'does-not-exist') -var writableDir = path.resolve(testBase, 'writable') -var nonWritableDir = path.resolve(testBase, 'non-writable') - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('exists', function (t) { - t.plan(2) - // fs.access first introduced in node 0.12 / io.js - if (fs.access) { - existsTests(t, exists) - } else { - t.pass('# skip fs.access not available in this version') - t.pass('# skip fs.access not available in this version') - } -}) - -test('exists-fallback', function (t) { - t.plan(2) - existsTests(t, existsFallback) -}) - -test('writable', function (t) { - t.plan(2) - // fs.access first introduced in node 0.12 / io.js - if (fs.access) { - writableTests(t, writable) - } else { - t.pass('# skip fs.access not available in this version') - t.pass('# skip fs.access not available in this version') - } -}) - -test('writable-fallback', function (t) { - t.plan(2) - writableTests(t, writableFallback) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - fs.mkdirSync(testBase) - fs.mkdirSync(existingDir) - fs.mkdirSync(writableDir) - fs.mkdirSync(nonWritableDir) - fs.chmodSync(nonWritableDir, '555') -} - -function existsTests (t, exists) { - exists(existingDir, function (er) { - t.error(er, 'exists dir is exists') - }) - exists(nonExistingDir, function (er) { - t.ok(er, 'non-existing dir resulted in an error') - }) -} - -function writableTests (t, writable) { - writable(writableDir, function (er) { - t.error(er, 'writable dir is writable') - }) - if (process.platform === 'win32') { - t.pass('windows folders cannot be read-only') - } else if (process.getuid && process.getuid() === 0) { - t.pass('root is not blocked by read-only dirs') - } else { - writable(nonWritableDir, function (er) { - t.ok(er, 'non-writable dir resulted in an error') - }) - } -} - -function cleanup () { - rimraf.sync(testBase) -} diff --git a/test/tap/ci-header.js b/test/tap/ci-header.js deleted file mode 100644 index fc791c6e6710d..0000000000000 --- a/test/tap/ci-header.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var chain = require('slide').chain -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var ciKeys = ['CI', 'TDDIUM', 'JENKINS_URL', 'bamboo.buildKey'] - -var filteredEnv = common.newEnv().delete(ciKeys) - -var conf = function (extraEnv) { - return { - cwd: testdir, - env: filteredEnv.clone().extend(extraEnv, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) - } -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'example', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -var ciHeaderTestCI = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'ci-header-test', - version: '1.0.0', - gotCI: true - } - } -} -var ciHeaderTestNotCI = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'ci-header-test', - version: '1.0.0', - gotCI: false - } - } -} - -var ciHeaderTestNoCI = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'ci-header-test', - version: '1.0.0', - gotCI: null - } - } -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.get('/ci-header-test', { - 'NPM-In-CI': 'true' - }).many().reply('200', ciHeaderTestCI) - server.get('/ci-header-test', { - 'NPM-In-CI': 'false' - }).many().reply('200', ciHeaderTestNotCI) - server.get('/ci-header-test', {}).many().reply('200', ciHeaderTestNoCI) - t.done() - }) -}) - -test('various-ci', function (t) { - var todo = ciKeys.map(function (key) { return [checkKey, key] }) - return chain(todo, t.done) - - function checkKey (key, next) { - var env = {} - env[key] = 'true' - - common.npm(['view', '--cache-min=0', 'ci-header-test', 'gotCI'], conf(env), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, key + ' command ran ok') - if (stderr.trim()) t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', key + ' set results in CI header') - next() - }) - } -}) - -test('no-ci', function (t) { - common.npm(['view', '--cache-min=0', 'ci-header-test', 'gotCI'], conf(), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'No CI env, command ran ok') - if (stderr.trim()) t.comment(stderr.trim()) - t.is(stdout.trim(), 'false', 'No CI env, not in CI') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/ci-permissions.js b/test/tap/ci-permissions.js deleted file mode 100644 index c73d464236540..0000000000000 --- a/test/tap/ci-permissions.js +++ /dev/null @@ -1,53 +0,0 @@ -const t = require('tap') -const tar = require('tar') -const common = require('../common-tap.js') -const pkg = common.pkg -const rimraf = require('rimraf') -const { writeFileSync, statSync, chmodSync } = require('fs') -const { resolve } = require('path') -const mkdirp = require('mkdirp') - -t.test('setup', t => { - mkdirp.sync(resolve(pkg, 'package')) - const pj = resolve(pkg, 'package', 'package.json') - writeFileSync(pj, JSON.stringify({ - name: 'foo', - version: '1.2.3' - })) - chmodSync(pj, 0o640) - tar.c({ - sync: true, - file: resolve(pkg, 'foo.tgz'), - gzip: true, - cwd: pkg - }, ['package']) - writeFileSync(resolve(pkg, 'package.json'), JSON.stringify({ - name: 'root', - version: '1.2.3', - dependencies: { - foo: 'file:foo.tgz' - } - })) - t.end() -}) - -t.test('run install to generate package-lock', t => - common.npm(['install'], { cwd: pkg }).then(([code]) => t.equal(code, 0))) - -t.test('remove node_modules', t => rimraf(resolve(pkg, 'node_modules'), t.end)) - -t.test('run ci and check modes', t => - common.npm(['ci'], { cwd: pkg, stdio: 'inherit' }).then(([code]) => { - t.equal(code, 0) - const file = resolve(pkg, 'node_modules', 'foo', 'package.json') - // bitwise AND against 0o705 so that we can detect whether - // the file is world-readable. - // Typical unix systems would leave the file 0o644 - // Travis-ci and some other Linux systems will be 0o664 - // Windows is 0o666 - // The regression this is detecting (ie, the default in the tarball) - // leaves the file as 0o640. - // Bitwise-AND 0o705 should always result in 0o604, and never 0o600 - const mode = statSync(file).mode & 0o705 - t.equal(mode, 0o604) - })) diff --git a/test/tap/circular-dep.js b/test/tap/circular-dep.js deleted file mode 100644 index f7e018d02346c..0000000000000 --- a/test/tap/circular-dep.js +++ /dev/null @@ -1,93 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = common.pkg -var minimist = path.join(pkg, 'minimist') - -var EXEC_OPTS = { - cwd: path.join(pkg, 'minimist/node_modules'), - npm_config_cache: common.cache -} - -var json = { - name: 'minimist', - version: '0.0.5', - dependencies: { - optimist: '0.6.0' - } -} - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/4312') - setup(function () { - t.end() - }) -}) - -test('installing a package that depends on the current package', function (t) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install', 'optimist' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'npm ran without raising an error code') - t.notOk(stderr, 'no error output') - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'dedupe' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'npm ran without raising an error code') - t.notOk(stderr, 'no error output') - - t.ok(existsSync(path.resolve( - minimist, - 'node_modules', 'optimist' - )), 'optimist in place') - t.ok(existsSync(path.resolve( - minimist, - 'node_modules', 'minimist' - )), 'circular dependency uncircled') - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) - -function setup (cb) { - mkdirp.sync(minimist) - fs.writeFileSync( - path.join(minimist, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(path.resolve(pkg, 'minimist')) - - fs.mkdirSync(path.resolve(pkg, 'minimist/node_modules')) - mr({ port: common.port }, function (er, s) { - server = s - cb() - }) -} diff --git a/test/tap/config-basic.js b/test/tap/config-basic.js deleted file mode 100644 index a95e94db29fd6..0000000000000 --- a/test/tap/config-basic.js +++ /dev/null @@ -1,79 +0,0 @@ -var test = require('tap').test -var common = require('../common-config.js') -var npmconf = require('../../lib/config/core.js') -var path = require('path') - -var projectData = { -} - -var ucData = common.ucData -var envData = common.envData - -var gcData = { 'package-config:foo': 'boo' } - -var biData = {} - -var cli = { foo: 'bar', umask: parseInt('022', 8) } - -var expectNames = [ - 'cli', - 'envData', - 'projectData', - 'ucData', - 'gcData', - 'biData' -] -var expectList = [ - cli, - envData, - projectData, - ucData, - gcData, - biData -] - -var expectSources = { - cli: { data: cli }, - env: { - data: envData, - source: envData, - prefix: '' - }, - project: { - path: path.resolve(__dirname, '..', '..', '.npmrc'), - type: 'ini', - data: projectData - }, - user: { - path: common.userconfig, - type: 'ini', - data: ucData - }, - global: { - path: common.globalconfig, - type: 'ini', - data: gcData - }, - builtin: { data: biData } -} - -function isDeeplyDetails (t, aa, bb, msg, seen) { - return t.same(aa, bb, msg) -} - -test('no builtin', function (t) { - t.comment(process.env) - npmconf.load(cli, function (er, conf) { - if (er) throw er - expectNames.forEach(function (name, ii) { - isDeeplyDetails(t, conf.list[ii], expectList[ii], 'config properties list: ' + name) - }) - isDeeplyDetails(t, conf.sources, expectSources, 'config by source') - t.same(npmconf.rootConf.list, [], 'root configuration is empty') - isDeeplyDetails(t, npmconf.rootConf.root, npmconf.defs.defaults, 'defaults') - isDeeplyDetails(t, conf.root, npmconf.defs.defaults, 'current root config is defaults') - t.is(conf.get('umask'), parseInt('022', 8), 'umask is as expected') - t.is(conf.get('heading'), 'npm', 'config name is as expected') - t.end() - }) -}) diff --git a/test/tap/config-builtin.js b/test/tap/config-builtin.js deleted file mode 100644 index 713522d6ccfa2..0000000000000 --- a/test/tap/config-builtin.js +++ /dev/null @@ -1,66 +0,0 @@ -var test = require('tap').test -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') -var path = require('path') - -var ucData = common.ucData - -var envData = common.envData -var envDataFix = common.envDataFix - -var gcData = { 'package-config:foo': 'boo' } - -var biData = { 'builtin-config': true } - -var cli = { foo: 'bar', heading: 'foo', 'git-tag-version': false } - -var projectData = { -} - -var expectList = [ - cli, - envDataFix, - projectData, - ucData, - gcData, - biData -] - -var expectSources = { - cli: { data: cli }, - env: { - data: envDataFix, - source: envData, - prefix: '' - }, - project: { - path: path.resolve(__dirname, '..', '..', '.npmrc'), - type: 'ini', - data: projectData - }, - user: { - path: common.userconfig, - type: 'ini', - data: ucData - }, - global: { - path: common.globalconfig, - type: 'ini', - data: gcData - }, - builtin: { data: biData } -} - -test('with builtin', function (t) { - npmconf.load(cli, common.builtin, function (er, conf) { - if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get('heading'), 'foo') - t.equal(conf.get('git-tag-version'), false) - t.end() - }) -}) diff --git a/test/tap/config-certfile.js b/test/tap/config-certfile.js deleted file mode 100644 index 904a8c0147718..0000000000000 --- a/test/tap/config-certfile.js +++ /dev/null @@ -1,19 +0,0 @@ -require('../common-config.js') - -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var npmconf = require('../../lib/config/core.js') - -test('cafile loads as ca', function (t) { - var cafile = path.join(__dirname, '..', 'fixtures', 'config', 'multi-ca') - - npmconf.load({cafile: cafile}, function (er, conf) { - if (er) throw er - - t.same(conf.get('cafile'), cafile) - var ca = fs.readFileSync(cafile, 'utf8').trim() - t.same(conf.get('ca').join(ca.match(/\r/g) ? '\r\n' : '\n'), ca) - t.end() - }) -}) diff --git a/test/tap/config-credentials.js b/test/tap/config-credentials.js deleted file mode 100644 index d8f6770666e2d..0000000000000 --- a/test/tap/config-credentials.js +++ /dev/null @@ -1,350 +0,0 @@ -var test = require('tap').test - -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') - -var URI = 'https://registry.lvh.me:8661/' - -test('getting scope with no credentials set', function (t) { - npmconf.load({}, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var basic = conf.getCredentialsByURI(URI) - t.equal(basic.scope, '//registry.lvh.me:8661/', 'nerfed URL extracted') - - t.end() - }) -}) - -test('trying to set credentials with no URI', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.setCredentialsByURI() - }, 'enforced missing URI') - - t.end() - }) -}) - -test('trying to clear credentials with no URI', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.clearCredentialsByURI() - }, 'enforced missing URI') - - t.end() - }) -}) - -test('set with missing credentials object', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.setCredentialsByURI(URI) - }, 'enforced missing credentials') - - t.end() - }) -}) - -test('set with empty credentials object', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.setCredentialsByURI(URI, {}) - }, 'enforced missing credentials') - - t.end() - }) -}) - -test('set with token', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, { token: 'simple-token' }) - }, 'needs only token') - - var expected = { - scope: '//registry.lvh.me:8661/', - token: 'simple-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got bearer token and scope') - - t.end() - }) -}) - -test('clear with token', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, { token: 'simple-token' }) - }, 'needs only token') - - t.doesNotThrow(function () { - conf.clearCredentialsByURI(URI) - }, 'needs only URI') - - t.notOk(conf.getCredentialsByURI(URI).token, 'token all gone') - - t.end() - }) -}) - -test('set with missing username', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - t.throws(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'enforced missing email') - - t.end() - }) -}) - -test('set with missing password', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - email: 'ogd@aoaioxxysz.net' - } - - t.throws(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'enforced missing email') - - t.end() - }) -}) - -test('set with missing email', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password' - } - - t.throws(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'enforced missing email') - - t.end() - }) -}) - -test('set with old-style credentials', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'requires all of username, password, and email') - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - t.end() - }) -}) - -test('clear with old-style credentials', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'requires all of username, password, and email') - - t.doesNotThrow(function () { - conf.clearCredentialsByURI(URI) - }, 'clearing only required URI') - - t.notOk(conf.getCredentialsByURI(URI).username, 'username cleared') - t.notOk(conf.getCredentialsByURI(URI).password, 'password cleared') - - t.end() - }) -}) - -test('get old-style credentials for default registry', function (t) { - npmconf.load(common.builtin, function (er, conf) { - var actual = conf.getCredentialsByURI(conf.get('registry')) - var expected = { - scope: '//registry.npmjs.org/', - token: undefined, - password: 'password', - username: 'username', - email: 'i@izs.me', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - t.same(actual, expected) - t.end() - }) -}) - -test('set with always-auth enabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - alwaysAuth: true - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: true - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - t.end() - }) -}) - -test('set with always-auth disabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - alwaysAuth: false - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - t.end() - }) -}) - -test('set with global always-auth enabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - var original = conf.get('always-auth') - conf.set('always-auth', true) - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: true - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - conf.set('always-auth', original) - t.end() - }) -}) - -test('set with global always-auth disabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - var original = conf.get('always-auth') - conf.set('always-auth', false) - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - conf.set('always-auth', original) - t.end() - }) -}) diff --git a/test/tap/config-edit.js b/test/tap/config-edit.js deleted file mode 100644 index a4f78a262c8b9..0000000000000 --- a/test/tap/config-edit.js +++ /dev/null @@ -1,74 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var pkg = common.pkg - -var editorSrc = function () { /* -#!/usr/bin/env node -var fs = require('fs') -if (fs.existsSync(process.argv[2])) { - console.log('success') -} else { - console.log('error') - process.exit(1) -} -*/ }.toString().split('\n').slice(1, -1).join('\n') -var editorPath = path.join(pkg, 'editor') - -test('setup', function (t) { - cleanup(function (er) { - t.ifError(er, 'old directory removed') - - mkdirp(pkg, '0777', function (er) { - fs.writeFileSync(editorPath, editorSrc) - fs.chmodSync(editorPath, '0777') - t.ifError(er, 'created package directory correctly') - t.end() - }) - }) -}) - -test('saving configs', function (t) { - var opts = { - cwd: pkg, - env: { - PATH: process.env.PATH, - // We rely on the cwd + relative path combo here because otherwise, - // this test will break if there's spaces in the editorPath - EDITOR: 'node editor' - } - } - common.npm( - [ - 'config', - '--prefix', pkg, - '--global', - 'edit' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'command ran without issue') - - t.equal(stderr, '', 'got nothing on stderr') - t.equal(code, 0, 'exit ok') - t.equal(stdout, 'success\n', 'got success message') - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup(function (er) { - t.ifError(er, 'test directory removed OK') - t.end() - }) -}) - -function cleanup (cb) { - rimraf(pkg, cb) -} diff --git a/test/tap/config-envReplace.js b/test/tap/config-envReplace.js deleted file mode 100644 index f65609f050f75..0000000000000 --- a/test/tap/config-envReplace.js +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable no-template-curly-in-string */ - -const fs = require('fs') -const mkdirp = require('mkdirp') -const rimraf = require('rimraf') -const path = require('path') -const ini = require('ini') -const test = require('tap').test -const npmconf = require('../../lib/config/core.js') - -const common = require('../common-tap.js') -const packagePath = common.pkg - -const packageJsonFile = JSON.stringify({ - name: 'config-envReplace' -}) - -const inputConfigFile = [ - 'registry=${NPM_REGISTRY_URL}', - '//${NPM_REGISTRY_HOST}/:_authToken=${NPM_AUTH_TOKEN}', - 'always-auth=true', - '' -].join('\n') - -const expectConfigFile = [ - 'registry=http://my.registry.com/', - '//my.registry.com/:_authToken=xxxxxxxxxxxxxxx', - 'always-auth=true', - '' -].join('\n') - -test('environment variables replacing in configs', function (t) { - process.env = Object.assign(process.env, { - NPM_REGISTRY_URL: 'http://my.registry.com/', - NPM_REGISTRY_HOST: 'my.registry.com', - NPM_AUTH_TOKEN: 'xxxxxxxxxxxxxxx' - }) - mkdirp.sync(packagePath) - const packageJsonPath = path.resolve(packagePath, 'package.json') - const configPath = path.resolve(packagePath, '.npmrc') - fs.writeFileSync(packageJsonPath, packageJsonFile) - fs.writeFileSync(configPath, inputConfigFile) - - const originalCwdPath = process.cwd() - process.chdir(packagePath) - npmconf.load(function (error, conf) { - if (error) throw error - - const foundConfigFile = ini.stringify(conf.sources.project.data) - t.same(ini.parse(foundConfigFile), ini.parse(expectConfigFile)) - - fs.unlinkSync(packageJsonPath) - fs.unlinkSync(configPath) - rimraf.sync(packagePath) - process.chdir(originalCwdPath) - t.end() - }) -}) diff --git a/test/tap/config-list.js b/test/tap/config-list.js deleted file mode 100644 index 7559214a727a5..0000000000000 --- a/test/tap/config-list.js +++ /dev/null @@ -1,69 +0,0 @@ -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg -var opts = { cwd: pkg, env: common.emptyEnv() } -var npmrc = path.resolve(pkg, '.npmrc') -var npmrcContents = ` -_private=private; -registry/:_pwd=pwd; -foo=1234 -` - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - - // Write per-project conf file - fs.writeFileSync(npmrc, npmrcContents, 'utf8') - - // Create empty package.json to indicate project root - fs.writeFileSync(path.resolve(pkg, 'package.json'), '{}', 'utf8') - t.end() -}) - -test('config list includes project config', function (t) { - common.npm( - ['config', 'list'], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - t.equal(stderr, '', 'stderr is empty') - - var expected = '; project config ' + npmrc + '\nfoo = "1234"' - t.match(stdout, expected, 'contains project config') - t.notMatch(stdout, '_private', 'excludes private config') - t.notMatch(stdout, '_pwd', 'excludes private segmented config') - t.end() - } - ) -}) - -test('config list --json outputs json', function (t) { - common.npm( - ['config', 'list', '--json'], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - t.equal(stderr, '', 'stderr is empty') - - var json = JSON.parse(stdout) - t.equal(json.foo, '1234', 'contains project config') - t.equal(json.argv, undefined, 'excludes argv') - t.equal(json._private, undefined, 'excludes private config') - t.equal(json['registry/:_pwd'], undefined, 'excludes private config') - t.end() - } - ) -}) - -// TODO: test cases for other configuration types (cli, env, user, global) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/config-malformed.js b/test/tap/config-malformed.js deleted file mode 100644 index 0d859e00340f3..0000000000000 --- a/test/tap/config-malformed.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tap').test - -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') - -test('with malformed', function (t) { - npmconf.load({}, common.malformed, function (er, conf) { - t.ok(er, 'Expected parse error') - if (!(er && /Failed parsing JSON config key email/.test(er.message))) { - throw er - } - t.end() - }) -}) diff --git a/test/tap/config-new-cafile.js b/test/tap/config-new-cafile.js deleted file mode 100644 index e4cc65ec747a6..0000000000000 --- a/test/tap/config-new-cafile.js +++ /dev/null @@ -1,37 +0,0 @@ -const common = require('../common-tap.js') - -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var rimraf = require('rimraf') -var npmconf = require('../../lib/config/core.js') - -var dir = common.pkg -var beep = path.resolve(dir, 'beep.pem') -var npmrc = path.resolve(dir, 'npmrc') - -test('can set new cafile when old is gone', function (t) { - t.plan(5) - fs.writeFileSync(npmrc, '') - fs.writeFileSync(beep, '') - npmconf.load({ userconfig: npmrc }, function (error, conf) { - npmconf.loaded = false - t.ifError(error) - conf.set('cafile', beep, 'user') - conf.save('user', function (error) { - t.ifError(error) - t.equal(conf.get('cafile'), beep) - rimraf.sync(beep) - npmconf.load({ userconfig: npmrc }, function (error, conf) { - if (error) { - throw error - } - t.equal(conf.get('cafile'), beep) - conf.del('cafile') - conf.save('user', function (error) { - t.ifError(error) - }) - }) - }) - }) -}) diff --git a/test/tap/config-private.js b/test/tap/config-private.js deleted file mode 100644 index e6bf9d2e83cee..0000000000000 --- a/test/tap/config-private.js +++ /dev/null @@ -1,83 +0,0 @@ -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg -var opts = { cwd: pkg } - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - t.end() -}) - -test('config get private var (old auth)', function (t) { - common.npm( - [ - 'config', - 'get', - '_auth' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.similar(stderr, /sekretz/, 'password blocked on stderr') - t.equal(stdout, '', 'no output') - t.end() - } - ) -}) - -test('config get private var (new auth)', function (t) { - common.npm( - [ - 'config', - 'get', - '//registry.npmjs.org/:_password' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.similar(stderr, /sekretz/, 'password blocked on stderr') - t.equal(stdout, '', 'no output') - t.end() - } - ) -}) - -test('config get public var (new username)', function (t) { - var FIXTURE_PATH = path.resolve(pkg, 'fixture_npmrc') - var s = '//registry.lvh.me/:username = wombat\n' + - '//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n' + - '//registry.lvh.me/:email = lindsay@wdu.org.au\n' - fs.writeFileSync(FIXTURE_PATH, s, 'ascii') - fs.chmodSync(FIXTURE_PATH, '0444') - - common.npm( - [ - 'config', - 'get', - '//registry.lvh.me/:username', - '--userconfig=' + FIXTURE_PATH, - '--registry=http://registry.lvh.me/' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.equal(stderr, '', 'stderr is empty') - t.equal(stdout, 'wombat\n', 'got usename is output') - t.end() - } - ) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/config-project.js b/test/tap/config-project.js deleted file mode 100644 index 0f7be913c097f..0000000000000 --- a/test/tap/config-project.js +++ /dev/null @@ -1,66 +0,0 @@ -var test = require('tap').test -var path = require('path') -var fix = path.resolve(__dirname, '..', 'fixtures', 'config') -var projectRc = path.resolve(fix, '.npmrc') -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') - -var projectData = { just: 'testing' } - -var ucData = common.ucData -var envData = common.envData -var envDataFix = common.envDataFix - -var gcData = { 'package-config:foo': 'boo' } - -var biData = {} - -var cli = { foo: 'bar', umask: parseInt('022', 8), prefix: fix } - -var expectList = [ - cli, - envDataFix, - projectData, - ucData, - gcData, - biData -] - -var expectSources = { - cli: { data: cli }, - env: { - data: envDataFix, - source: envData, - prefix: '' - }, - project: { - path: projectRc, - type: 'ini', - data: projectData - }, - user: { - path: common.userconfig, - type: 'ini', - data: ucData - }, - global: { - path: common.globalconfig, - type: 'ini', - data: gcData - }, - builtin: { data: biData } -} - -test('no builtin', function (t) { - npmconf.load(cli, function (er, conf) { - if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get('umask'), parseInt('022', 8)) - t.equal(conf.get('heading'), 'npm') - t.end() - }) -}) diff --git a/test/tap/config-save.js b/test/tap/config-save.js deleted file mode 100644 index 23dc7b5960785..0000000000000 --- a/test/tap/config-save.js +++ /dev/null @@ -1,91 +0,0 @@ -var fs = require('fs') -var ini = require('ini') -var t = require('tap') -const test = t.test -var common = require('../common-config.js') -var commonTap = require('../common-tap.js') -var npmconf = require('../../lib/config/core.js') - -var expectConf = [ - 'globalconfig = ' + common.globalconfig, - 'email = i@izs.me', - 'env-thing = foo', - 'init.author.name = Isaac Z. Schlueter', - 'init.author.email = i@izs.me', - 'init.author.url = http://blog.izs.me/', - 'init.version = 1.2.3', - 'npm:publishtest = true', - '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - 'npm-www:nocache = 1', - 'sign-git-tag = false', - 'message = v%s', - 'strict-ssl = false', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', - '', - '[_token]', - 'AuthSession = yabba-dabba-doodle', - 'version = 1', - 'expires = 1345001053415', - 'path = /', - 'httponly = true', - '' -].join('\n') - -var expectFile = [ - 'globalconfig = ' + common.globalconfig, - 'email = i@izs.me', - 'env-thing = foo', - 'init.author.name = Isaac Z. Schlueter', - 'init.author.email = i@izs.me', - 'init.author.url = http://blog.izs.me/', - 'init.version = 1.2.3', - 'npm:publishtest = true', - '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - 'npm-www:nocache = 1', - 'sign-git-tag = false', - 'message = v%s', - 'strict-ssl = false', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', - '', - '[_token]', - 'AuthSession = yabba-dabba-doodle', - 'version = 1', - 'expires = 1345001053415', - 'path = /', - 'httponly = true', - '' -].join('\n') - -const userconfig = commonTap.pkg + '/userconfig' -fs.writeFileSync(userconfig, fs.readFileSync(common.userconfig)) -process.env.npm_config_userconfig = userconfig - -test('saving configs', function (t) { - npmconf.load(function (er, conf) { - if (er) throw er - - conf.set('sign-git-tag', false, 'user') - conf.del('nodedir') - conf.del('tmp') - var foundConf = ini.stringify(conf.sources.user.data) - t.same(ini.parse(foundConf), ini.parse(expectConf)) - fs.unlinkSync(common.userconfig) - conf.save('user', function (er) { - if (er) throw er - - var uc = fs.readFileSync(conf.get('userconfig'), 'utf8') - t.same(ini.parse(uc), ini.parse(expectFile)) - t.end() - }) - }) -}) - -test('setting prefix', function (t) { - npmconf.load(function (er, conf) { - if (er) throw er - - conf.prefix = 'newvalue' - t.same(conf.prefix, 'newvalue') - t.end() - }) -}) diff --git a/test/tap/cruft-test.js b/test/tap/cruft-test.js deleted file mode 100644 index 4f2ed6c0d0a71..0000000000000 --- a/test/tap/cruft-test.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var mkdirpSync = require('mkdirp').sync -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg -var cruft = path.join(base, 'node_modules', 'cruuuft') -var pkg = { - name: 'example', - version: '1.0.0', - dependencies: {} -} - -function setup () { - mkdirpSync(path.dirname(cruft)) - fs.writeFileSync(cruft, 'this is some cruft for sure') - fs.writeFileSync(path.join(base, 'package.json'), JSON.stringify(pkg)) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - cleanup() - setup() - t.done() -}) - -test('cruft', function (t) { - common.npm(['ls'], {cwd: base}, function (er, code, stdout, stderr) { - t.is(stderr, '', 'no warnings or errors from ls') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/test/tap/debug-logs.js b/test/tap/debug-logs.js deleted file mode 100644 index 4da52bfcee8ae..0000000000000 --- a/test/tap/debug-logs.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var glob = require('glob') -var asyncMap = require('slide').asyncMap -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var fixture = new Tacks(Dir({ - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'debug-logs', - version: '1.0.0', - scripts: { - true: 'node -e "process.exit(0)"', - false: 'node -e "process.exit(1)"' - } - }) - }) -})) - -test('setup', function (t) { - fixture.create(basedir) - t.done() -}) - -test('example', function (t) { - common.npm(['run', 'false'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'command errored') - const re = /A complete log of this run can be found in:.*\nnpm ERR! {5,5}(.*)/ - const matches = stderr.match(re) - t.match(stderr, re, 'debug log mentioned in error message') - if (matches) { - var logfile = matches[1] - t.matches(path.relative(cachedir, logfile), /^_logs/, 'debug log is inside the cache in _logs') - } - - // we run a bunch concurrently, this will actually create > than our limit - // as the check is done when the command starts - // - // It has to be > the log count (10) but also significantly higher than - // the number of cores on the machine, or else some might be able to get - // to the log folder pruning logic in parallel, resulting in FEWER files - // than we expect being present at the end. - var procCount = Math.max(require('os').cpus().length * 2, 12) - var todo = new Array(procCount).join(',').split(',').map((v, k) => k) - asyncMap(todo, function (num, next) { - // another way would be to just simulate this? - // var f = path.join(cachedir, '_logs', num + '-debug.log') - // require('fs').writeFile(f, 'log ' + num, next) - common.npm(['run', '--logs-max=10', 'false'], conf, function (err, code) { - if (err) throw err - t.is(code, 1, 'run #' + num + ' errored as expected') - next() - }) - }, function () { - var files = glob.sync(path.join(cachedir, '_logs', '*')) - t.ok(files.length > 10, 'there should be more than 10 log files') - - // now we do one more and that should clean up the list - common.npm(['run', '--logs-max=10', 'false'], conf, function (err, code) { - if (err) throw err - t.is(code, 1, 'final run errored as expected') - var files = glob.sync(path.join(cachedir, '_logs', '*')) - t.is(files.length, 10, 'there should never be more than 10 log files') - common.npm(['run', '--logs-max=5', 'true'], conf, function (err, code) { - if (err) throw err - t.is(code, 0, 'success run is ok') - var files = glob.sync(path.join(cachedir, '_logs', '*')) - t.is(files.length, 4, 'after success there should be logs-max - 1 log files') - t.done() - }) - }) - }) - }) -}) diff --git a/test/tap/deprecate.js b/test/tap/deprecate.js deleted file mode 100644 index 987acb80afd40..0000000000000 --- a/test/tap/deprecate.js +++ /dev/null @@ -1,157 +0,0 @@ -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var server - -var cache = { - '_id': 'cond', - '_rev': '19-d458a706de1740662cd7728d7d7ddf07', - 'name': 'cond', - 'time': { - 'modified': '2015-02-13T07:33:58.120Z', - 'created': '2014-03-16T20:52:52.236Z', - '0.0.0': '2014-03-16T20:52:52.236Z', - '0.0.1': '2014-03-16T21:12:33.393Z', - '0.0.2': '2014-03-16T21:15:25.430Z' - }, - 'versions': { - '0.0.0': {}, - '0.0.1': {}, - '0.0.2': {} - }, - 'dist-tags': { - 'latest': '0.0.2' - }, - 'description': 'Restartable error handling system', - 'license': 'CC0' -} - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.ok(true) - t.end() - }) -}) - -test('npm deprecate an unscoped package', function (t) { - var deprecated = JSON.parse(JSON.stringify(cache)) - deprecated.versions = { - '0.0.0': {}, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': {} - } - server.get('/cond?write=true').reply(200, cache) - server.put('/cond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - 'cond@0.0.1', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('npm deprecate a scoped package', function (t) { - var cacheCopy = JSON.parse(JSON.stringify(cache)) - cacheCopy.name = '@scope/cond' - cacheCopy._id = '@scope/cond' - var deprecated = JSON.parse(JSON.stringify(cacheCopy)) - deprecated.versions = { - '0.0.0': {}, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': {} - } - server.get('/@scope%2fcond?write=true').reply(200, cacheCopy) - server.put('/@scope%2fcond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - '@scope/cond@0.0.1', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('npm deprecate semver range', function (t) { - var deprecated = JSON.parse(JSON.stringify(cache)) - deprecated.versions = { - '0.0.0': { deprecated: 'make it dead' }, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': {} - } - server.get('/cond?write=true').reply(200, cache) - server.put('/cond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - 'cond@<0.0.2', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('npm deprecate bad semver range', function (t) { - common.npm([ - 'deprecate', - 'cond@-9001', - 'make it dead', - '--registry', common.registry - ], {}, - function (er, code, stdout, stderr) { - t.equal(code, 1, 'errored') - t.match(stderr, /invalid version range/, 'bad semver') - t.end() - }) -}) - -test('npm deprecate a package with no semver range', function (t) { - var deprecated = JSON.parse(JSON.stringify(cache)) - deprecated.versions = { - '0.0.0': { deprecated: 'make it dead' }, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': { deprecated: 'make it dead' } - } - server.get('/cond?write=true').reply(200, cache) - server.put('/cond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - 'cond', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.ok(true) - t.end() -}) diff --git a/test/tap/dist-tag.js b/test/tap/dist-tag.js deleted file mode 100644 index a5cce5d2a0f93..0000000000000 --- a/test/tap/dist-tag.js +++ /dev/null @@ -1,271 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var pkg = common.pkg -var server - -var scoped = { - name: '@scoped/pkg', - version: '1.1.1' -} - -function mocks (server) { - // ls current package - server.get('/-/package/@scoped%2fpkg/dist-tags') - .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) - - server.get('/-/package/@scoped%2fpkg/dist-tags') - .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) - - // ls named package - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - - // add c - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - server.put('/-/package/@scoped%2fanother/dist-tags/c', '"7.7.7"') - .reply(200, { latest: '7.7.7', a: '0.0.2', b: '0.6.0', c: '7.7.7' }) - - // set same version - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', b: '0.6.0' }) - - // rm - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0', c: '7.7.7' }) - server.delete('/-/package/@scoped%2fanother/dist-tags/c') - .reply(200, { c: '7.7.7' }) - - // using a scoped registry - server.get('/-/package/@scoped%2ffoo/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - server.delete('/-/package/@scoped%2ffoo/dist-tags/b') - .reply(200, { b: '0.6.0' }) - - // rm - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '4.0.0' }) -} - -test('setup', function (t) { - mkdirp(pkg, function (er) { - t.ifError(er, pkg + ' made successfully') - - mr({ port: common.port, plugin: mocks }, function (er, s) { - server = s - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify(scoped), - function (er) { - t.ifError(er, 'wrote package.json') - t.end() - } - ) - }) - }) -}) - -test('npm dist-tags ls in current package', function (t) { - common.npm( - [ - 'dist-tags', 'ls', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags ls default in current package', function (t) { - common.npm( - [ - 'dist-tags', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags ls on named package', function (t) { - common.npm( - [ - 'dist-tags', - 'ls', '@scoped/another', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags ls default, named package', function (t) { - common.npm( - [ - 'dist-tags', - '@scoped/another', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags add @scoped/another@7.7.7 c', function (t) { - common.npm( - [ - 'dist-tags', - 'add', '@scoped/another@7.7.7', 'c', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, '+c: @scoped/another@7.7.7\n') - - t.end() - } - ) -}) - -test('npm dist-tags set same version', function (t) { - common.npm( - [ - 'dist-tag', - 'set', '@scoped/another@0.6.0', 'b', - '--registry', common.registry, - '--loglevel', 'warn' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.equal( - stderr, - 'npm WARN dist-tag add b is already set to version 0.6.0\n', - 'warned about setting same version' - ) - t.notOk(stdout, 'only expecting warning message') - - t.end() - } - ) -}) - -test('npm dist-tags rm @scoped/another c', function (t) { - common.npm( - [ - 'dist-tags', - 'rm', '@scoped/another', 'c', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, '-c: @scoped/another@7.7.7\n') - - t.end() - } - ) -}) - -test('npm dist-tags rm @scoped/another nonexistent', function (t) { - common.npm( - [ - 'dist-tags', - 'rm', '@scoped/another', 'nonexistent', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm dist-tag') - t.ok(code, 'expecting nonzero exit code') - t.notOk(stderr, 'no error output') - t.notOk(stdout, 'not expecting output') - - t.end() - } - ) -}) - -test('npm dist-tags rm with registry assigned to scope', function (t) { - fs.writeFileSync(path.resolve(pkg, '.npmrc'), ` -@scoped:registry=${common.registry} -${common.registry.replace(/^https?:/, '')}:_authToken=taken -`) - - common.npm( - [ - 'dist-tags', - 'rm', '@scoped/foo', 'b', - '--loglevel', 'silent', - '--userconfig', path.resolve(pkg, '.npmrc') - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, '-b: @scoped/foo@0.6.0\n') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - rimraf.sync(pkg) - server.close() - t.end() -}) diff --git a/test/tap/doctor.js b/test/tap/doctor.js deleted file mode 100644 index 9a1b42cdd5361..0000000000000 --- a/test/tap/doctor.js +++ /dev/null @@ -1,131 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ -const common = require('../common-tap.js') -const http = require('http') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm.js') -const path = require('path') -const Tacks = require('tacks') -const t = require('tap') -const which = require('which') - -const Dir = Tacks.Dir -const File = Tacks.File - -const ROOT = common.pkg -const CACHE = common.cache -const TMP = path.join(ROOT, 'tmp') -const PREFIX = path.join(ROOT, 'global-prefix') -const PKG = path.join(ROOT, 'pkg') - -let server -let node_url -const pingResponse = { - host: 'registry.npmjs.org', - ok: true, - username: null, - peer: 'example.com' -} -const npmResponse = { - name: 'npm', - 'dist-tags': {latest: '0.0.0'}, - 'versions': { - '0.0.0': { - name: 'npm', - version: '0.0.0', - _shrinkwrap: null, - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: 'https://reg.eh/npm-0.0.0.tgz' - } - } - } -} - -let nodeServer - -t.teardown(() => { - if (server) { - server.close() - } - if (nodeServer) { - nodeServer.close() - } -}) - -t.test('setup', (t) => { - const port = common.port + 1 - nodeServer = http.createServer(function (q, s) { - s.end(JSON.stringify([{lts: true, version: '0.0.0'}])) - }) - nodeServer.listen(port, () => { - node_url = 'http://localhost:' + port - mr({port: common.port}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - server.get('/-/ping?write=true').reply(200, JSON.stringify(pingResponse)) - server.get('/npm').reply(200, JSON.stringify(npmResponse)) - const fixture = new Tacks(Dir({ - [path.basename(PKG)]: Dir({ - 'package.json': File({name: 'foo', version: '1.0.0'}) - }), - [path.basename(PREFIX)]: Dir({}) - })) - fixture.create(ROOT) - npm.load({ - registry: common.registry, - loglevel: 'silent', - cache: CACHE, - tmp: TMP, - prefix: PREFIX - }, (err) => { - t.ifError(err, 'npm loaded successfully') - t.pass('all set up') - t.done() - }) - }) - }) -}) - -t.test('npm doctor', function (t) { - npm.commands.doctor({'node-url': node_url}, true, function (e, list) { - t.ifError(e, 'npm loaded successfully') - t.same(list.length, 9, 'list should have 9 prop') - t.same(list[0][1], 'ok', 'npm ping') - t.same(list[1][1], 'v' + npm.version, 'npm -v') - t.same(list[2][1], process.version, 'node -v') - t.same(list[3][1], common.registry + '/', 'npm config get registry') - t.same(list[5][1], 'ok', 'Perms check on cached files') - t.same(list[6][1], 'ok', 'Perms check on global node_modules') - t.same(list[7][1], 'ok', 'Perms check on local node_modules') - t.match(list[8][1], /^verified \d+ tarballs?$/, 'Cache verified') - which('git', function (e, resolvedPath) { - t.ifError(e, 'git command is installed') - t.same(list[4][1], resolvedPath, 'which git') - t.done() - }) - }) -}) - -t.test('npm doctor works without registry', function (t) { - npm.config.set('registry', false) - npm.commands.doctor({'node-url': node_url}, true, function (e, list) { - t.ifError(e, 'npm loaded successfully') - t.same(list.length, 9, 'list should have 9 prop') - t.same(list[0][1], 'ok', 'npm ping') - t.same(list[1][1], 'v' + npm.version, 'npm -v') - t.same(list[2][1], process.version, 'node -v') - t.same(list[3][1], '', 'no registry, but no crash') - t.same(list[5][1], 'ok', 'Perms check on cached files') - t.same(list[6][1], 'ok', 'Perms check on global node_modules') - t.same(list[7][1], 'ok', 'Perms check on local node_modules') - t.match(list[8][1], /^verified \d+ tarballs?$/, 'Cache verified') - which('git', function (e, resolvedPath) { - t.ifError(e, 'git command is installed') - t.same(list[4][1], resolvedPath, 'which git') - server.close() - t.done() - }) - }) -}) diff --git a/test/tap/extraneous-dep-cycle-ls-ok.js b/test/tap/extraneous-dep-cycle-ls-ok.js deleted file mode 100644 index 11f52209ed835..0000000000000 --- a/test/tap/extraneous-dep-cycle-ls-ok.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap') - -var pkg = common.pkg -var pathModA = path.join(pkg, 'node_modules', 'moduleA') -var pathModB = path.join(pkg, 'node_modules', 'moduleB') - -var modA = { - name: 'moduleA', - version: '1.0.0', - _requiredBy: [ '#USER', '/moduleB' ], - dependencies: { - moduleB: '1.0.0' - } -} -var modB = { - name: 'moduleB', - version: '1.0.0', - _requiredBy: [ '/moduleA' ], - dependencies: { - moduleA: '1.0.0' - } -} - -function setup () { - mkdirp.sync(pathModA) - fs.writeFileSync( - path.join(pathModA, 'package.json'), - JSON.stringify(modA, null, 2) - ) - mkdirp.sync(pathModB) - fs.writeFileSync( - path.join(pathModB, 'package.json'), - JSON.stringify(modB, null, 2) - ) -} - -function cleanup () { - rimraf.sync(pkg) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -var expected = pkg + '\n' + - '└─┬ moduleA@1.0.0\n' + - ' └─┬ moduleB@1.0.0\n' + - ' └── moduleA@1.0.0 deduped\n\n' - -test('extraneous-dep-cycle', function (t) { - common.npm(['ls', '--unicode=true'], {cwd: pkg}, function (er, code, stdout, stderr) { - t.ifErr(er, 'install finished successfully') - t.is(stdout, expected, 'ls output shows module') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/false-name.js b/test/tap/false-name.js deleted file mode 100644 index 57d2a2ad2f8dd..0000000000000 --- a/test/tap/false-name.js +++ /dev/null @@ -1,79 +0,0 @@ -// this is a test for fix #2538 - -// the false_name-test-package has the name property 'test-package' set -// in the package.json and a dependency named 'test-package' is also a -// defined dependency of 'test-package-with-one-dep'. -// -// this leads to a conflict during installation and the fix is covered -// by this test - -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var cache = common.cache -var server - -var EXEC_OPTS = { cwd: pkg } - -var indexContent = 'module.exports = true\n' -var json = { - name: 'test-package', - version: '0.0.0', - main: 'index.js', - dependencies: { - 'test-package-with-one-dep': '0.0.0' - } -} - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/2538') - setup() - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -test('not every pkg.name can be required', function (t) { - common.npm( - [ - 'install', '.', - '--cache', cache, - '--registry', common.registry - ], - EXEC_OPTS, - function (err, code) { - t.ifErr(err, 'install finished without error') - t.equal(code, 0, 'install exited ok') - t.ok( - existsSync(path.join(pkg, 'node_modules', 'test-package-with-one-dep')), - 'test-package-with-one-dep installed OK' - ) - t.ok( - existsSync(path.join(pkg, 'node_modules', 'test-package')), - 'test-package subdep installed OK' - ) - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'index.js'), indexContent) -} diff --git a/test/tap/format-package-lock.js b/test/tap/format-package-lock.js deleted file mode 100644 index ddf40915d9bd3..0000000000000 --- a/test/tap/format-package-lock.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict' -const fs = require('fs') -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const pkgPath = path.join(testdir, 'package.json') -const pkgLockPath = path.join(testdir, 'package-lock.json') -const shrinkwrapPath = path.join(testdir, 'npm-shrinkwrap.json') -const CRLFreg = /\r\n|\r|\n/ - -const env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn', - npm_config_format_package_lock: false -}) - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'install-package-lock-only', - version: '1.0.0', - dependencies: { - mkdirp: '^0.3.4' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('package-lock.json unformatted, package.json formatted when config has `format-package-lock: false`', function (t) { - setup() - common.npm(['install'], {cwd: testdir, env}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - const pkgLockUtf8 = fs.readFileSync(pkgLockPath, 'utf-8') - t.equal(pkgLockUtf8.split(CRLFreg).length, 2, 'package-lock.json is unformatted') - const pkgUtf8 = fs.readFileSync(pkgPath, 'utf-8') - t.notEqual(pkgUtf8.split(CRLFreg).length, 2, 'package.json is formatted') - t.done() - }) -}) - -test('npm-shrinkwrap.json unformatted when config has `format-package-lock: false`', function (t) { - setup() - common.npm(['shrinkwrap'], {cwd: testdir, env}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(shrinkwrapPath), 'ensure that npm-shrinkwrap.json was created') - const shrinkwrapUtf8 = fs.readFileSync(shrinkwrapPath, 'utf-8') - t.equal(shrinkwrapUtf8.split(CRLFreg).length, 2, 'npm-shrinkwrap.json is unformatted') - t.done() - }) -}) - -test('package-lock.json and package.json formatted when config has `format-package-lock: true`', function (t) { - setup() - common.npm(['install'], {cwd: testdir}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - const pkgLockUtf8 = fs.readFileSync(pkgLockPath, 'utf-8') - t.notEqual(pkgLockUtf8.split(CRLFreg).length, 2, 'package-lock.json is formatted') - const pkgUtf8 = fs.readFileSync(pkgPath, 'utf-8') - t.notEqual(pkgUtf8.split(CRLFreg).length, 2, 'package.json is formatted') - t.done() - }) -}) - -test('npm-shrinkwrap.json formatted when config has `format-package-lock: true`', function (t) { - setup() - common.npm(['shrinkwrap'], {cwd: testdir}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(shrinkwrapPath), 'ensure that npm-shrinkwrap.json was created') - const shrinkwrapUtf8 = fs.readFileSync(shrinkwrapPath, 'utf-8') - t.notEqual(shrinkwrapUtf8.split(CRLFreg).length, 2, 'npm-shrinkwrap.json is unformatted') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/full-warning-messages.js b/test/tap/full-warning-messages.js deleted file mode 100644 index 945cf66a629dd..0000000000000 --- a/test/tap/full-warning-messages.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict' -var test = require('tap').test -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var fs = require('graceful-fs') -var common = require('../common-tap') - -var base = common.pkg -var modA = path.resolve(base, 'modA') -var modB = path.resolve(base, 'modB') - -var json = { - 'name': 'test-full-warning-messages', - 'version': '1.0.0', - 'description': 'abc', - 'repository': 'git://abc/', - 'license': 'ISC', - 'dependencies': { - 'modA': modA - } -} - -var modAJson = { - 'name': 'modA', - 'version': '1.0.0', - 'optionalDependencies': { - 'modB': modB - } -} - -var modBJson = { - 'name': 'modB', - 'version': '1.0.0', - 'os': ['nope'], - 'cpu': 'invalid' -} - -function modJoin () { - var modules = Array.prototype.slice.call(arguments) - return modules.reduce(function (a, b) { - return path.resolve(a, 'node_modules', b) - }) -} - -function writeJson (mod, data) { - fs.writeFileSync(path.resolve(mod, 'package.json'), JSON.stringify(data)) -} - -function setup () { - cleanup() - ;[modA, modB].forEach(function (mod) { mkdirp.sync(mod) }) - writeJson(base, json) - writeJson(modA, modAJson) - writeJson(modB, modBJson) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - setup() - t.end() -}) - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -function notExists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.fail(msg, {found: 'exists', wanted: null, compare: 'fs.stat(' + filepath + ')'}) - return true - } catch (ex) { - t.pass(msg) - return false - } -} - -test('tree-style', function (t) { - common.npm(['install', '--json', '--loglevel=warn'], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'result code') - var result = JSON.parse(stdout) - t.is(result.added.length, 1, 'only added one module') - t.is(result.added[0].name, 'modA', 'modA got installed') - t.is(result.warnings.length, 1, 'one warning') - var stderrlines = stderr.trim().split(/\n/) - t.is(stderrlines.length, 2, 'two lines of warnings') - t.match(stderr, /SKIPPING OPTIONAL DEPENDENCY/, 'expected optional failure warning in stderr') - t.match(stderr, /Unsupported platform/, 'reason for optional failure in stderr') - t.match(result.warnings[0], /SKIPPING OPTIONAL DEPENDENCY/, 'expected optional failure warning in JSON') - t.match(result.warnings[0], /Unsupported platform/, 'reason for optional failure in JSON') - exists(t, modJoin(base, 'modA'), 'module A') - notExists(t, modJoin(base, 'modB'), 'module B') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/gently-rm-linked-module.js b/test/tap/gently-rm-linked-module.js deleted file mode 100644 index ab595e10c740f..0000000000000 --- a/test/tap/gently-rm-linked-module.js +++ /dev/null @@ -1,100 +0,0 @@ -var common = require('../common-tap.js') - -var resolve = require('path').resolve -var fs = require('graceful-fs') -var test = require('tap').test -var rimraf = require('rimraf') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var Symlink = Tacks.Symlink -var isWindows = require('../../lib/utils/is-windows.js') - -var base = common.pkg -var fixture = new Tacks(Dir({ - 'working-dir': Dir({ - 'node_modules': Dir({}) // so it doesn't try to install into npm's own node_modules - }), - 'test-module': Dir({ - 'package.json': File({ - name: '@test/linked', - version: '1.0.0', - bin: { - linked: './index.js' - } - }), - 'index.js': File("module.exports = function () { console.log('whoop whoop') }") - }), - 'global-dir': Dir({}), - 'linked-global-dir': Symlink('global-dir') -})) - -var workingDir = resolve(base, 'working-dir') -var toInstall = resolve(base, 'test-module') -var linkedGlobal = resolve(base, 'linked-global-dir') - -var env = Object.assign({}, process.env) - -// We set the global install location via env var here -// instead of passing it in via `--prefix` because -// `--prefix` ALSO changes the current package location. -// And we don't ue the PREFIX env var because -// npm_config_prefix takes precedence over it and is -// passed in when running from the npm test suite. -env.npm_config_prefix = linkedGlobal -var EXEC_OPTS = { - cwd: workingDir, - env: env, - stdio: [0, 'pipe', 2] -} - -test('setup', function (t) { - cleanup() - setup() - - t.end() -}) - -test('install and link', function (t) { - var globalBin = resolve(linkedGlobal, isWindows ? '.' : 'bin', 'linked') - var globalModule = resolve(linkedGlobal, isWindows ? '.' : 'lib', 'node_modules', '@test', 'linked') - // link our test module into the global folder - return common.npm(['--loglevel', 'error', 'link', toInstall], EXEC_OPTS).spread((code, out) => { - t.comment(out) - t.is(code, 0, 'link succeeded') - var localBin = resolve(workingDir, 'node_modules', '.bin', 'linked') - var localModule = resolve(workingDir, 'node_modules', '@test', 'linked') - try { - t.ok(fs.statSync(globalBin), 'global bin exists') - t.is(fs.lstatSync(globalModule).isSymbolicLink(), true, 'global module is link') - t.ok(fs.statSync(localBin), 'local bin exists') - t.is(fs.lstatSync(localModule).isSymbolicLink(), true, 'local module is link') - } catch (ex) { - t.ifError(ex, 'linking happened') - } - if (code !== 0) throw new Error('aborting') - - // and try removing it and make sure that succeeds - return common.npm(['--global', '--loglevel', 'error', 'rm', '@test/linked'], EXEC_OPTS) - }).spread((code, out) => { - t.comment(out) - t.is(code, 0, 'rm succeeded') - t.throws(function () { fs.statSync(globalBin) }, 'global bin removed') - t.throws(function () { fs.statSync(globalModule) }, 'global module removed') - }) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function cleanup () { - fixture.remove(base) - rimraf.sync(base) -} - -function setup () { - fixture.create(base) -} diff --git a/test/tap/gently-rm-overeager.js b/test/tap/gently-rm-overeager.js deleted file mode 100644 index 91a3768aff705..0000000000000 --- a/test/tap/gently-rm-overeager.js +++ /dev/null @@ -1,60 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap.js') - -var testdir = common.pkg -var pkg = path.join(testdir, 'gently-rm-overeager') -var dep = path.join(testdir, 'test-whoops') - -var EXEC_OPTS = { cwd: pkg } - -var fixture = { - name: '@test/whoops', - version: '1.0.0', - scripts: { - postinstall: 'echo \'nope\' && exit 1' - } -} - -test('setup', function (t) { - cleanup() - setup() - - return common.npm(['pack', 'file:test-whoops'], {cwd: testdir, stdio: 'inherit'}).spread((code) => { - t.is(code, 0, 'pack') - }) -}) - -test('cache add', function (t) { - common.npm(['install', '--no-save', '../test-whoops-1.0.0.tgz'], EXEC_OPTS, function (er, c) { - t.ifError(er, "test-whoops install didn't explode") - t.ok(c, 'test-whoops install also failed') - fs.readdir(pkg, function (er, files) { - t.ifError(er, 'package directory is still there') - t.deepEqual(files, [], 'no files remain') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function cleanup () { - rimraf.sync(testdir) -} - -function setup () { - mkdirp.sync(pkg) - // so it doesn't try to install into npm's own node_modules - mkdirp.sync(path.join(pkg, 'node_modules')) - mkdirp.sync(dep) - fs.writeFileSync(path.join(dep, 'package.json'), JSON.stringify(fixture)) -} diff --git a/test/tap/gently-rm-symlinked-global-dir.js b/test/tap/gently-rm-symlinked-global-dir.js deleted file mode 100644 index 0a27dae5c5e95..0000000000000 --- a/test/tap/gently-rm-symlinked-global-dir.js +++ /dev/null @@ -1,119 +0,0 @@ -var common = require('../common-tap.js') - -var resolve = require('path').resolve -var fs = require('graceful-fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var isWindows = require('../../lib/utils/is-windows.js') - -var pkg = resolve(common.pkg, 'package') -var dep = resolve(common.pkg, 'test-linked') -var glb = resolve(common.pkg, 'test-global') -var lnk = resolve(common.pkg, 'test-global-link') - -var EXEC_OPTS = { cwd: pkg } - -var index = "module.exports = function () { console.log('whoop whoop') }" - -var fixture = { - name: '@test/linked', - version: '1.0.0', - bin: { - linked: './index.js' - } -} - -test('setup', function (t) { - cleanup() - setup() - - t.end() -}) - -test('install and link', function (t) { - common.npm( - [ - '--global', - '--prefix', lnk, - '--loglevel', 'silent', - '--json', - 'install', '../test-linked' - ], - EXEC_OPTS, - function (er, code, stdout, stderr) { - t.ifError(er, "test-linked install didn't explode") - t.notOk(code, 'test-linked install also failed') - t.notOk(stderr, 'no log output') - - verify(t, stdout) - - // again, to make sure unlinking works properlyt - common.npm( - [ - '--global', - '--prefix', lnk, - '--loglevel', 'silent', - '--json', - 'install', '../test-linked' - ], - EXEC_OPTS, - function (er, code, stdout, stderr) { - t.ifError(er, "test-linked install didn't explode") - t.notOk(code, 'test-linked install also failed') - t.notOk(stderr, 'no log output') - - verify(t, stdout) - - fs.readdir(pkg, function (er, files) { - t.ifError(er, 'package directory is still there') - t.deepEqual(files, ['node_modules'], 'only stub modules dir remains') - - t.end() - }) - } - ) - } - ) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function resolvePath () { - return resolve.apply(null, Array.prototype.slice.call(arguments) - .filter(function (arg) { return arg })) -} - -function verify (t, stdout) { - var result = JSON.parse(stdout) - var pkgPath = resolvePath(lnk, !isWindows && 'lib', 'node_modules', '@test', 'linked') - if (result.added.length) { - t.is(result.added.length, 1, 'added the module') - t.is(result.added[0].path, pkgPath, 'in the right location') - } else { - t.is(result.updated.length, 1, 'updated the module') - t.is(result.updated[0].path, pkgPath, 'in the right location') - } -} - -function cleanup () { - rimraf.sync(pkg) - rimraf.sync(dep) - rimraf.sync(lnk) - rimraf.sync(glb) -} - -function setup () { - mkdirp.sync(pkg) - mkdirp.sync(glb) - fs.symlinkSync(glb, lnk, 'junction') - // so it doesn't try to install into npm's own node_modules - mkdirp.sync(resolve(pkg, 'node_modules')) - mkdirp.sync(dep) - fs.writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) - fs.writeFileSync(resolve(dep, 'index.js'), index) -} diff --git a/test/tap/gist-short-shortcut-package.js b/test/tap/gist-short-shortcut-package.js deleted file mode 100644 index 601d53a827666..0000000000000 --- a/test/tap/gist-short-shortcut-package.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-short-shortcut-package', - version: '0.0.0', - dependencies: { - 'private-gist': 'gist:deadbeef' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('gist-short-shortcut-package', function (t) { - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs third'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH second'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/gist-short-shortcut.js b/test/tap/gist-short-shortcut.js deleted file mode 100644 index 82c9ae17502dd..0000000000000 --- a/test/tap/gist-short-shortcut.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-short-shortcut', - version: '0.0.0' -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('gist-shortcut', function (t) { - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error('execFile mock fails on purpose')) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['gist:deadbeef'], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/gist-shortcut-package.js b/test/tap/gist-shortcut-package.js deleted file mode 100644 index 28e57357cc393..0000000000000 --- a/test/tap/gist-shortcut-package.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-shortcut-package', - version: '0.0.0', - dependencies: { - 'private-gist': 'gist:foo/deadbeef' - } -} - -test('gist-shortcut-package', function (t) { - setup() - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/test/tap/gist-shortcut.js b/test/tap/gist-shortcut.js deleted file mode 100644 index ca86d6bc55058..0000000000000 --- a/test/tap/gist-shortcut.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-shortcut', - version: '0.0.0' -} - -test('gist-shortcut', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['gist:foo/deadbeef'], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/test/tap/git-dependency-install-link.js b/test/tap/git-dependency-install-link.js deleted file mode 100644 index d80beab057f4d..0000000000000 --- a/test/tap/git-dependency-install-link.js +++ /dev/null @@ -1,172 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var readJson = require('read-package-json') -var mr = require('npm-registry-mock') - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(common.pkg, 'repo') -var prefix = resolve(common.pkg, 'prefix') -var cache = common.cache - -var daemon -var daemonPID -var git -var mockRegistry - -var EXEC_OPTS = { - registry: common.registry, - cwd: pkg, - cache: cache -} -process.env.npm_config_prefix = prefix - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - 'child': 'git://localhost:' + common.gitPort + '/child.git' - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - t.test('bootstrap', t => bootstrap(t.end)) - t.test('setup', t => setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - mr({ - port: common.port - }, function (er, server) { - t.ifError(er, 'started mock registry') - mockRegistry = server - - t.end() - }) - })) - t.end() -}) - -test('install from git repo [no --link]', function (t) { - process.chdir(pkg) - - common.npm(['install'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'npm install failed') - - t.dissimilar(stderr, /Command failed:/, 'expect git to succeed') - t.dissimilar(stderr, /version not found/, 'should not go to repository') - - readJson(resolve(pkg, 'node_modules', 'child', 'package.json'), function (err, data) { - t.ifError(err, 'error reading child package.json') - - t.equal(data && data.version, '1.0.3') - t.end() - }) - }) -}) - -test('install from git repo [with --link]', function (t) { - process.chdir(pkg) - rimraf.sync(resolve(pkg, 'node_modules')) - - common.npm(['install', '--link'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'npm install --link failed') - t.equal(code, 0, 'npm install --link returned non-0 code') - - t.dissimilar(stderr, /Command failed:/, 'expect git to succeed') - t.dissimilar(stderr, /version not found/, 'should not go to repository') - t.equal(stderr, '', 'no actual output on stderr') - - readJson(resolve(pkg, 'node_modules', 'child', 'package.json'), function (err, data) { - t.ifError(err, 'error reading child package.json') - - t.equal(data && data.version, '1.0.3') - t.end() - }) - }) -}) - -test('clean', function (t) { - mockRegistry.close() - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function bootstrap (cb) { - rimraf(repo, () => { - rimraf(pkg, () => { - mkdirp.sync(pkg) - mkdirp.sync(cache) - - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) - cb() - }) - }) -} - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ - link: true, - prefix: pkg, - loglevel: 'silent' - }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) -} diff --git a/test/tap/git-npmignore.js b/test/tap/git-npmignore.js deleted file mode 100644 index 2ab7db7304f0f..0000000000000 --- a/test/tap/git-npmignore.js +++ /dev/null @@ -1,200 +0,0 @@ -/* eslint-disable camelcase */ -var child_process = require('child_process') -var readdir = require('graceful-fs').readdirSync -var resolve = require('path').resolve - -var rimraf = require('rimraf') -var test = require('tap').test -var which = require('which') - -var common = require('../common-tap.js') -var escapeArg = require('../../lib/utils/escape-arg.js') -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -var fixture = new Tacks(Dir({ - deps: Dir({ - gitch: Dir({ - '.npmignore': File( - 't.js\n' - ), - '.gitignore': File( - 'node_modules/\n' - ), - 'a.js': File( - "console.log('hi');" - ), - 't.js': File( - "require('tap').test(function (t) { t.pass('I am a test!'); t.end(); });" - ), - 'package.json': File({ - name: 'gitch', - version: '1.0.0', - private: true, - main: 'a.js' - }) - }) - }), - 'node_modules': Dir({ - }) -})) - -var testdir = common.pkg -var cachedir = common.cache -var dep = resolve(testdir, 'deps', 'gitch') -var packname = 'gitch-1.0.0.tgz' -var packed = resolve(testdir, packname) -var modules = resolve(testdir, 'node_modules') -var installed = resolve(modules, 'gitch') -var expected = [ - 'a.js', - 'package.json' -].sort() - -var NPM_OPTS = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir - }) -} - -function exec (todo, opts, cb) { - console.log(' # EXEC:', todo) - child_process.exec(todo, opts, cb) -} - -test('setup', function (t) { - setup(function (er) { - t.ifError(er, 'setup ran OK') - - t.end() - }) -}) - -test('npm pack directly from directory', function (t) { - packInstallTest(dep, t) -}) - -test('npm pack via git', function (t) { - var urlPath = dep - .replace(/\\/g, '/') // fixup slashes for Windows - .replace(/^\/+/, '') // remove any leading slashes - packInstallTest('git+file:///' + urlPath, t) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function packInstallTest (spec, t) { - console.log(' # pack', spec) - common.npm( - [ - '--loglevel', 'error', - 'pack', spec - ], - NPM_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'npm pack exited cleanly') - t.is(stderr, '', 'npm pack ran silently') - t.is(stdout.trim(), packname, 'got expected package name') - - common.npm( - [ - '--loglevel', 'error', - 'install', packed - ], - NPM_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'npm install exited cleanly') - t.is(stderr, '', 'npm install ran silently') - - var actual = readdir(installed).sort() - t.isDeeply(actual, expected, 'no unexpected files in packed directory') - - rimraf(packed, function () { - t.end() - }) - } - ) - } - ) -} - -function cleanup () { - fixture.remove(testdir) - rimraf.sync(testdir) -} - -function setup (cb) { - cleanup() - - fixture.create(testdir) - - common.npm( - [ - '--loglevel', 'error', - 'cache', 'clean', '--force' - ], - NPM_OPTS, - function (er, code, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('npm cache clean error: ' + stderr)) - if (code) return cb(new Error('npm cache nonzero exit: ' + code)) - - which('git', function found (er, gitPath) { - if (er) return cb(er) - - var git = escapeArg(gitPath) - - exec(git + ' init', {cwd: dep}, init) - - function init (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git init error: ' + stderr)) - - exec(git + " config user.name 'Phantom Faker'", {cwd: dep}, user) - } - - function user (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git config error: ' + stderr)) - - exec(git + ' config user.email nope@not.real', {cwd: dep}, email) - } - - function email (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git config error: ' + stderr)) - - exec(git + ' config core.autocrlf input', {cwd: dep}, autocrlf) - } - - function autocrlf (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git config error: ' + stderr)) - - exec(git + ' add .', {cwd: dep}, addAll) - } - - function addAll (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git add . error: ' + stderr)) - - exec(git + ' commit -m boot', {cwd: dep}, commit) - } - - function commit (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git commit error: ' + stderr)) - cb() - } - }) - } - ) -} diff --git a/test/tap/git-prepare.js b/test/tap/git-prepare.js deleted file mode 100644 index 072f4dfc447fc..0000000000000 --- a/test/tap/git-prepare.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict' - -const fs = require('fs') -const path = require('path') - -const test = require('tap').test -const mr = require('npm-registry-mock') - -const npm = require('../../lib/npm.js') -const common = require('../common-tap.js') - -const testdir = common.pkg -const repo = path.join(testdir, 'repo') -const prefix = path.join(testdir, 'prefix') -const cache = common.cache - -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -let daemon -let daemonPID -let git -let mockRegistry - -process.env.npm_config_prefix = prefix - -const fixture = new Tacks(Dir({ - repo: Dir({}), - prefix: Dir({}), - deps: Dir({ - parent: Dir({ - 'package.json': File({ - name: 'parent', - version: '1.2.3', - dependencies: { - 'child': 'git://localhost:' + common.gitPort + '/child.git' - } - }) - }), - child: Dir({ - 'package.json': File({ - name: 'child', - version: '1.0.3', - main: 'dobuild.js', - scripts: { - 'prepublish': 'exit 123', - 'prepare': 'writer build-artifact' - }, - devDependencies: { - writer: 'file:' + path.join(testdir, 'deps', 'writer') - } - }) - }), - writer: Dir({ - 'package.json': File({ - name: 'writer', - version: '1.0.0', - bin: 'writer.js' - }), - 'writer.js': File(`#!/usr/bin/env node\n - require('fs').writeFileSync(process.argv[2], 'hello, world!') - `) - }) - }) -})) - -test('setup', function (t) { - fixture.create(testdir) - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - mr({ - port: common.port - }, function (er, server) { - t.ifError(er, 'started mock registry') - mockRegistry = server - - t.end() - }) - }) -}) - -test('install from git repo with prepare script', function (t) { - const parent = path.join(testdir, 'deps', 'parent') - - common.npm([ - 'install', - '--no-save', - '--registry', common.registry, - '--cache', cache, - '--loglevel', 'error' - ], { - cwd: parent - }, function (err, code, stdout, stderr) { - if (err) { throw err } - t.equal(code, 0, 'exited successfully') - t.equal(stderr, '', 'no actual output on stderr') - - const target = path.join(parent, 'node_modules', 'child', 'build-artifact') - fs.readFile(target, 'utf8', (err, data) => { - if (err) { throw err } - t.equal(data, 'hello, world!', 'build artifact written for git dep') - t.end() - }) - }) -}) - -test('clean', function (t) { - mockRegistry.close() - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function setup (cb) { - npm.load({ - prefix: testdir, - loglevel: 'silent' - }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - const d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: repo, - env: process.env - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - const cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - const childPath = path.join(testdir, 'deps', 'child') - common.makeGitRepo({ - path: childPath, - commands: [ - git.chainableExec([ - 'clone', '--bare', childPath, 'child.git' - ], { cwd: repo, env: process.env }), - startDaemon - ] - }, cb) - }) -} diff --git a/test/tap/github-shortcut-package.js b/test/tap/github-shortcut-package.js deleted file mode 100644 index 444520308a245..0000000000000 --- a/test/tap/github-shortcut-package.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'github-shortcut-package', - version: '0.0.0', - dependencies: { - 'private': 'foo/private' - } -} - -test('github-shortcut-package', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], - ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'], - ['ssh://git@github.com/foo/private.git', 'GitHub shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/test/tap/github-shortcut.js b/test/tap/github-shortcut.js deleted file mode 100644 index 59c7e39ea948f..0000000000000 --- a/test/tap/github-shortcut.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fs = require('graceful-fs') -const path = require('path') - -const requireInject = require('require-inject') -const test = require('tap').test - -const common = require('../common-tap.js') - -const pkg = common.pkg - -const json = { - name: 'github-shortcut', - version: '0.0.0' -} - -test('github-shortcut', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - const cloneUrls = [ - ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], - ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'], - ['ssh://git@github.com/foo/private.git', 'GitHub shortcuts try SSH third'] - ] - const npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - const cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - const opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - t.plan(2 + cloneUrls.length) - npm.load(opts, function (err) { - t.ifError(err, 'npm loaded without error') - npm.commands.install(['foo/private'], function (err, result) { - t.match(err.message, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/test/tap/gitlab-shortcut-package.js b/test/tap/gitlab-shortcut-package.js deleted file mode 100644 index 9b431ff7b66f0..0000000000000 --- a/test/tap/gitlab-shortcut-package.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gitlab-shortcut-package', - version: '0.0.0', - dependencies: { - 'private': 'gitlab:foo/private' - } -} - -test('gitlab-shortcut-package', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'], - ['ssh://git@gitlab.com/foo/private.git', 'GitLab shortcuts try SSH first'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/test/tap/gitlab-shortcut.js b/test/tap/gitlab-shortcut.js deleted file mode 100644 index 344311b45f26c..0000000000000 --- a/test/tap/gitlab-shortcut.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gitlab-shortcut', - version: '0.0.0' -} - -test('gitlab-shortcut', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'], - ['ssh://git@gitlab.com/foo/private.git', 'GitLab shortcuts try SSH first'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error('execFile mock fails on purpose')) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['gitlab:foo/private'], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/test/tap/global-prefix-set-in-userconfig.js b/test/tap/global-prefix-set-in-userconfig.js deleted file mode 100644 index 422bcb2477ec6..0000000000000 --- a/test/tap/global-prefix-set-in-userconfig.js +++ /dev/null @@ -1,36 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var rimraf = require('rimraf') -var prefix = __filename.replace(/\.js$/, '') -var rcfile = __filename.replace(/\.js$/, '.npmrc') -var fs = require('fs') -var conf = 'prefix = ' + prefix + '\n' - -test('setup', function (t) { - rimraf.sync(prefix) - fs.writeFileSync(rcfile, conf) - t.pass('ready') - t.end() -}) - -test('run command', function (t) { - var args = ['prefix', '-g', '--userconfig=' + rcfile] - common.npm(args, {env: {}}, function (er, code, so) { - if (er) throw er - t.notOk(code, 'npm prefix exited with code 0') - t.equal(so.trim(), prefix) - t.end() - }) -}) - -test('made dir', function (t) { - t.ok(fs.statSync(prefix).isDirectory()) - t.end() -}) - -test('cleanup', function (t) { - rimraf.sync(prefix) - rimraf.sync(rcfile) - t.pass('clean') - t.end() -}) diff --git a/test/tap/graceful-restart.js b/test/tap/graceful-restart.js deleted file mode 100644 index 787aa988949b6..0000000000000 --- a/test/tap/graceful-restart.js +++ /dev/null @@ -1,94 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -var outGraceless = [ - 'prerestart', - 'prestop', - 'stop', - 'poststop', - 'prestart', - 'start', - 'poststart', - 'postrestart', - '' -].join('\n') - -var outGraceful = [ - 'prerestart', - 'restart', - 'postrestart', - '' -].join('\n') - -var pjGraceless = JSON.stringify({ - name: 'graceless', - version: '1.2.3', - scripts: { - 'prestop': 'echo prestop', - 'stop': 'echo stop', - 'poststop': 'echo poststop', - 'prerestart': 'echo prerestart', - 'postrestart': 'echo postrestart', - 'prestart': 'echo prestart', - 'start': 'echo start', - 'poststart': 'echo poststart' - } -}, null, 2) + '\n' - -var pjGraceful = JSON.stringify({ - name: 'graceful', - version: '1.2.3', - scripts: { - 'prestop': 'echo prestop', - 'stop': 'echo stop', - 'poststop': 'echo poststop', - 'prerestart': 'echo prerestart', - 'restart': 'echo restart', - 'postrestart': 'echo postrestart', - 'prestart': 'echo prestart', - 'start': 'echo start', - 'poststart': 'echo poststart' - } -}, null, 2) + '\n' - -test('graceless restart', function (t) { - fs.writeFileSync(resolve(pkg, 'package.json'), pjGraceless) - createChild(['run-script', 'restart'], function (err, code, out) { - t.ifError(err, 'restart finished successfully') - t.equal(code, 0, 'npm run-script exited with code') - t.equal(out.replace(/\r/g, ''), outGraceless, 'expected all scripts to run') - t.end() - }) -}) - -test('graceful restart', function (t) { - fs.writeFileSync(resolve(pkg, 'package.json'), pjGraceful) - createChild(['run-script', 'restart'], function (err, code, out) { - t.ifError(err, 'restart finished successfully') - t.equal(code, 0, 'npm run-script exited with code') - t.equal(out.replace(/\r/g, ''), outGraceful, 'expected only *restart scripts to run') - t.end() - }) -}) - -function createChild (args, cb) { - var env = { - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH, - 'npm_config_loglevel': 'silent' - } - - if (process.platform === 'win32') { - env.npm_config_cache = '%APPDATA%\\npm-cache' - } - - return common.npm(args, { - cwd: pkg, - stdio: ['ignore', 'pipe', 'ignore'], - env: env - }, cb) -} diff --git a/test/tap/help.js b/test/tap/help.js deleted file mode 100644 index bc66a92298e00..0000000000000 --- a/test/tap/help.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap') - -test('npm food', function (t) { - common.npm('docz', {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'command ran with error') - - t.has(stdout, 'Did you mean this?') - - t.notOk(stderr, 'stderr should be empty') - t.end() - }) -}) - -test('npm jet', function (t) { - common.npm('jet', {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'command ran with error') - - t.has(stdout, 'Did you mean one of these?') - - t.notOk(stderr, 'stderr should be empty') - t.end() - }) -}) diff --git a/test/tap/hook.js b/test/tap/hook.js deleted file mode 100644 index d50b7b122174a..0000000000000 --- a/test/tap/hook.js +++ /dev/null @@ -1,243 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const test = require('tap').test - -test('hook add', (t) => { - let body - return common.withServer(server => { - server.filteringRequestBody(bod => { - body = JSON.parse(bod) - t.deepEqual(body, { - type: 'owner', - name: 'zkat', - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'request sent correct body') - return true - }) - .post('/-/npm/v1/hooks/hook', true) - .reply(201, { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com' - }) - return common.npm([ - 'hook', 'add', '~zkat', 'https://example.com', 'sekrit', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout.trim(), - /^\+ ~zkat.*https:\/\/example\.com$/, - 'output info about new hook' - ) - }) - }) -}) - -test('hook add --json', (t) => { - return common.withServer(server => { - server - .filteringRequestBody(() => true) - .post('/-/npm/v1/hooks/hook', true) - .reply(201, { - name: 'npm', - type: 'scope', - endpoint: 'https://example.com' - }) - return common.npm([ - 'hook', 'add', '~zkat', 'https://example.com', 'sekrit', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.deepEqual(JSON.parse(stdout), { - name: 'npm', - type: 'scope', - endpoint: 'https://example.com' - }, 'json response data returned') - }) - }) -}) - -test('hook rm', t => { - return common.withServer(server => { - server - .delete('/-/npm/v1/hooks/hook/dead%40beef') - .reply(200, { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'rm', 'dead@beef', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout.trim(), - /^- ~zkat.*https:\/\/example\.com$/, - 'output info about new hook' - ) - }) - }) -}) - -test('hook rm --json', t => { - return common.withServer(server => { - server - .delete('/-/npm/v1/hooks/hook/dead%40beef') - .reply(200, { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'rm', 'dead@beef', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.deepEqual(JSON.parse(stdout), { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'json response data returned') - }) - }) -}) - -test('hook ls', t => { - const objects = [ - {id: 'foo', type: 'package', name: '@foo/pkg', endpoint: 'foo.com'}, - {id: 'bar', type: 'owner', name: 'bar', endpoint: 'bar.com'}, - {id: 'baz', type: 'scope', name: 'baz', endpoint: 'baz.com'} - ] - return common.withServer(server => { - server - .get('/-/npm/v1/hooks?package=%40npm%2Fhooks') - .reply(200, {objects}) - return common.npm([ - 'hook', 'ls', '@npm/hooks', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout, - /You have 3 hooks configured/, - 'message about hook count' - ) - t.match( - stdout, - /foo\s+.*\s+@foo\/pkg\s+.*\s+foo\.com/, - 'package displayed as expected' - ) - t.match( - stdout, - /bar\s+.*\s+~bar\s+.*\s+bar\.com/, - 'owner displayed as expected' - ) - t.match( - stdout, - /baz\s+.*\s+@baz\s+.*\s+baz\.com/, - 'scope displayed as expected' - ) - }) - }) -}) - -test('hook ls --json', t => { - const objects = [ - {id: 'foo'}, - {id: 'bar'}, - {id: 'baz'} - ] - return common.withServer(server => { - server - .get('/-/npm/v1/hooks?package=%40npm%2Fhooks') - .reply(200, {objects}) - return common.npm([ - 'hook', 'ls', '@npm/hooks', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.deepEqual(JSON.parse(stdout), objects, 'objects output as json') - }) - }) -}) - -test('hook update', t => { - return common.withServer(server => { - server.filteringRequestBody(() => true) - .put('/-/npm/v1/hooks/hook/dead%40beef', true) - .reply(200, { - type: 'scope', - name: 'npm', - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'update', 'dead@beef', 'https://example.com', 'sekrit', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout.trim(), - /^\+ @npm\s+.*\s+https:\/\/example\.com$/, - 'output info about updated hook' - ) - }) - }) -}) - -test('hook update --json', t => { - let body - return common.withServer(server => { - server.filteringRequestBody(bod => { - body = JSON.parse(bod) - t.deepEqual(body, { - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'request sent correct body') - return true - }) - .put('/-/npm/v1/hooks/hook/dead%40beef', true) - .reply(200, { - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'update', 'dead@beef', 'https://example.com', 'sekrit', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - const json = JSON.parse(stdout) - t.deepEqual(json, { - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'json response data returned') - }) - }) -}) diff --git a/test/tap/ignore-install-link.js b/test/tap/ignore-install-link.js deleted file mode 100644 index 038b9448d7817..0000000000000 --- a/test/tap/ignore-install-link.js +++ /dev/null @@ -1,71 +0,0 @@ -var common = require('../common-tap.js') -common.skipIfWindows('symlinks are weird on windows') -var test = require('tap').test -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') - -var root = common.pkg -var pkg = path.resolve(root, 'pkg') -var dep = path.resolve(root, 'dep') -var target = path.resolve(pkg, 'node_modules', 'dep') -var cache = common.cache -var globalPath = path.resolve(root, 'global') - -var pkgj = { - 'name': 'pkg', - 'version': '1.2.3', - 'dependencies': { - 'dep': '1.2.3' - } -} -var depj = { 'name': 'dep', 'version': '1.2.3' } - -var myreg = require('http').createServer(function (q, s) { - s.statusCode = 403 - s.end(JSON.stringify({'error': 'forbidden'}) + '\n') -}).listen(common.port) - -test('setup', function (t) { - rimraf.sync(root) - mkdirp.sync(root) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - mkdirp.sync(dep) - mkdirp.sync(cache) - mkdirp.sync(globalPath) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pkgj)) - fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(depj)) - fs.symlinkSync(dep, target, 'dir') - t.end() -}) - -test('ignore install if package is linked', function (t) { - common.npm(['install'], { - cwd: pkg, - env: { - PATH: process.env.PATH || process.env.Path, - HOME: process.env.HOME, - 'npm_config_prefix': globalPath, - 'npm_config_cache': cache, - 'npm_config_registry': common.registry, - 'npm_config_loglevel': 'silent' - }, - stdio: 'inherit' - }, function (er, code) { - if (er) throw er - t.equal(code, 0, 'npm install exited with code') - t.end() - }) -}) - -test('still a symlink', function (t) { - t.equal(true, fs.lstatSync(target).isSymbolicLink()) - t.end() -}) - -test('cleanup', function (t) { - rimraf.sync(root) - myreg.close() - t.end() -}) diff --git a/test/tap/ignore-scripts.js b/test/tap/ignore-scripts.js deleted file mode 100644 index f5af4553c26c0..0000000000000 --- a/test/tap/ignore-scripts.js +++ /dev/null @@ -1,128 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap') - -// ignore-scripts/package.json has scripts that always exit with non-zero error -// codes. -var pkg = common.pkg - -var gypfile = 'bad_binding_file\n' -var json = { - author: 'Milton the Aussie', - name: 'ignore-scripts', - version: '0.0.0', - scripts: { - prepublish: 'exit 123', - publish: 'exit 123', - postpublish: 'exit 123', - preinstall: 'exit 123', - install: 'exit 123', - postinstall: 'exit 123', - preuninstall: 'exit 123', - uninstall: 'exit 123', - postuninstall: 'exit 123', - pretest: 'exit 123', - test: 'exit 123', - posttest: 'exit 123', - prestop: 'exit 123', - stop: 'exit 123', - poststop: 'exit 123', - prestart: 'exit 123', - start: 'exit 123', - poststart: 'exit 123', - prerestart: 'exit 123', - restart: 'exit 123', - postrestart: 'exit 123', - preversion: 'exit 123', - version: 'exit 123', - postversion: 'exit 123', - preshrinkwrap: 'exit 123', - shrinkwrap: 'exit 123', - postshrinkwrap: 'exit 123' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('ignore-scripts: install using the option', function (t) { - createChild(['install', '--ignore-scripts'], function (err, code) { - t.ifError(err, 'install with scripts ignored finished successfully') - t.equal(code, 0, 'npm install exited with code') - t.end() - }) -}) - -test('ignore-scripts: install NOT using the option', function (t) { - createChild(['install'], function (err, code) { - t.ifError(err, 'install with scripts successful') - t.notEqual(code, 0, 'npm install exited with code') - t.end() - }) -}) - -var scripts = [ - 'prepublish', 'publish', 'postpublish', - 'preinstall', 'install', 'postinstall', - 'preuninstall', 'uninstall', 'postuninstall', - 'pretest', 'test', 'posttest', - 'prestop', 'stop', 'poststop', - 'prestart', 'start', 'poststart', - 'prerestart', 'restart', 'postrestart', - 'preversion', 'version', 'postversion', - 'preshrinkwrap', 'shrinkwrap', 'postshrinkwrap' -] - -scripts.forEach(function (script) { - test('ignore-scripts: run-script ' + script + ' using the option', function (t) { - createChild(['--ignore-scripts', 'run-script', script], function (err, code, stdout, stderr) { - t.ifError(err, 'run-script ' + script + ' with ignore-scripts successful') - t.equal(code, 0, 'npm run-script exited with code') - t.end() - }) - }) -}) - -scripts.forEach(function (script) { - test('ignore-scripts: run-script ' + script + ' NOT using the option', function (t) { - createChild(['run-script', script], function (err, code) { - t.ifError(err, 'run-script ' + script + ' finished successfully') - t.notEqual(code, 0, 'npm run-script exited with code') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync(path.join(pkg, 'binding.gyp'), gypfile) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) -} - -function createChild (args, cb) { - return common.npm( - args.concat(['--loglevel', 'silent']), - { cwd: pkg }, - cb - ) -} diff --git a/test/tap/init-create.js b/test/tap/init-create.js deleted file mode 100644 index 22d9090a97ef2..0000000000000 --- a/test/tap/init-create.js +++ /dev/null @@ -1,171 +0,0 @@ -/* eslint-disable standard/no-callback-literal */ -var test = require('tap').test -var requireInject = require('require-inject') - -var npm = require('../../lib/npm.js') - -test('npm init ', function (t) { - var initJsonMock = function () { - t.ok(false, 'should not run initJson()') - } - initJsonMock.yes = function () { - t.ok(false, 'should not run initJson.yes()') - return false - } - var libnpxMock = function () { - return Promise.resolve() - } - libnpxMock.parseArgs = function (argv, defaultNpm) { - t.ok(argv[0].includes('node'), 'node is the first arg') - t.equals(argv[2], '--always-spawn', 'set npx opts.alwaysSpawn') - t.equals(argv[3], 'create-name', 'expands name') - t.ok(defaultNpm.endsWith('npm-cli.js'), 'passes npm bin path') - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'init-package-json': initJsonMock, - 'libnpx': libnpxMock - }) - - init(['name'], function () {}) - - t.end() - }) -}) - -test('npm init expands scopes', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], '@scope/create', 'expands @scope') - } - - init(['@scope'], function () {}) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], '@scope/create-name', 'expands @scope/name') - } - - init(['@scope/name'], function () {}) - - t.end() - }) -}) - -test('npm init expands version names', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'create-name@1.2.3', 'expands name@1.2.3') - } - - init(['name@1.2.3'], function () {}) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'create-name@^1.2.3', 'expands name@^1.2.3') - } - - init(['name@^1.2.3'], function () {}) - - t.end() - }) -}) - -test('npm init expands git names', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'user/create-foo', 'expands git repo') - } - - init(['user/foo'], function () {}) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'git+https://github.com/user/create-foo', 'expands git url') - } - - init(['git+https://github.com/user/foo'], function () {}) - - t.end() - }) -}) - -test('npm init errors on folder and tarballs', function (t) { - npm.load({ loglevel: 'silent' }, function () { - var init = require('../../lib/init') - - try { - init(['../foo/bar/'], function () {}) - } catch (e) { - t.equals(e.code, 'EUNSUPPORTED') - } - - t.throws( - () => init(['../foo/bar/'], function () {}), - /Unrecognized initializer: \.\.\/foo\/bar\// - ) - - t.throws( - () => init(['file:foo.tar.gz'], function () {}), - /Unrecognized initializer: file:foo\.tar\.gz/ - ) - - t.throws( - () => init(['http://x.com/foo.tgz'], function () {}), - /Unrecognized initializer: http:\/\/x\.com\/foo\.tgz/ - ) - - t.end() - }) -}) - -test('npm init forwards arguments', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var origArgv = process.argv - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - process.argv = origArgv - t.same(argv.slice(4), ['a', 'b', 'c']) - } - process.argv = [ - process.argv0, - 'NPM_CLI_PATH', - 'init', - 'name', - 'a', 'b', 'c' - ] - - init(['name'], function () {}) - - t.end() - }) -}) diff --git a/test/tap/init-interrupt.js b/test/tap/init-interrupt.js deleted file mode 100644 index 38c38053e590d..0000000000000 --- a/test/tap/init-interrupt.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable standard/no-callback-literal */ -// if 'npm init' is interrupted with ^C, don't report -// 'init written successfully' -var test = require('tap').test -var npmlog = require('npmlog') -var requireInject = require('require-inject') - -var npm = require('../../lib/npm.js') - -require('../common-tap.js') - -test('issue #6684 remove confusing message', function (t) { - var initJsonMock = function (dir, input, config, cb) { - process.nextTick(function () { - cb({ message: 'canceled' }) - }) - } - initJsonMock.yes = function () { return true } - - npm.load({ loglevel: 'silent' }, function () { - var log = '' - var init = requireInject('../../lib/init', { - 'init-package-json': initJsonMock - }) - - // capture log messages - npmlog.on('log', function (chunk) { log += chunk.message + '\n' }) - - init([], function (err, code) { - t.ifError(err, 'init ran successfully') - t.notOk(code, 'exited without issue') - t.notSimilar(log, /written successfully/, 'no success message written') - t.similar(log, /canceled/, 'alerted that init was canceled') - - t.end() - }) - }) -}) diff --git a/test/tap/install-actions.js b/test/tap/install-actions.js deleted file mode 100644 index 071dc2cc371ed..0000000000000 --- a/test/tap/install-actions.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict' -var npm = require('../../lib/npm.js') -var log = require('npmlog') -var test = require('tap').test - -var mockLog = { - finish: function () {}, - silly: function () {} -} - -var actions -test('setup', function (t) { - npm.load({ 'unsafe-perm': true }, function () { - log.disableProgress() - actions = require('../../lib/install/actions.js').actions - t.end() - }) -}) - -test('->optdep:a->dep:b', function (t) { - var moduleA = { - name: 'a', - path: '/a', - package: { - scripts: { - postinstall: 'false' - }, - dependencies: { - b: '*' - } - }, - isTop: true - } - var moduleB = { - name: 'b', - path: '/b', - package: {}, - requires: [], - requiredBy: [moduleA] - } - moduleA.requires = [moduleB] - - var tree = { - path: '/', - package: { - optionalDependencies: { - a: '*' - } - }, - children: [moduleA, moduleB], - requires: [moduleA], - isTop: true - } - moduleA.requiredBy = [tree] - moduleA.parent = tree - moduleB.parent = tree - - t.plan(3) - return actions.postinstall('/', moduleA, mockLog).then(() => { - throw new Error('was not supposed to succeed') - }, (err) => { - t.is(err && err.code, 'ELIFECYCLE', 'Lifecycle failed') - t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') - t.ok(moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') - t.end() - }) -}) - -test('->dep:b,->optdep:a->dep:b', function (t) { - var moduleA = { - name: 'a', - path: '/', - package: { - scripts: { - postinstall: 'false' - }, - dependencies: { - b: '*' - } - }, - isTop: false - } - var moduleB = { - name: 'b', - path: '/', - package: {}, - requires: [], - requiredBy: [moduleA], - isTop: false - } - moduleA.requires = [moduleB] - - var tree = { - name: 'tree', - path: '/', - package: { - dependencies: { - b: '*' - }, - optionalDependencies: { - a: '*' - } - }, - children: [moduleA, moduleB], - requires: [moduleA, moduleB], - isTop: true - } - moduleA.requiredBy = [tree] - moduleB.requiredBy.push(tree) - moduleA.parent = tree - moduleB.parent = tree - - return actions.postinstall('/', moduleA, mockLog).then(() => { - t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') - t.ok(!moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') - }) -}) diff --git a/test/tap/install-at-locally.js b/test/tap/install-at-locally.js deleted file mode 100644 index e4920d22d14aa..0000000000000 --- a/test/tap/install-at-locally.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } - -var json = { - name: 'install-at-locally-mock', - version: '0.0.0' -} - -test('\'npm install ./package@1.2.3\' should install local pkg', function (t) { - var target = './package@1.2.3' - setup(target) - common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) - -test('\'npm install install/at/locally@./package@1.2.3\' should install local pkg', function (t) { - var target = 'install/at/locally@./package@1.2.3' - setup(target) - common.npm(['install', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) - -function setup (target) { - rimraf.sync(pkg) - var root = path.resolve(pkg, target) - mkdirp.sync(root) - fs.writeFileSync( - path.join(root, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(pkg, 'node_modules')) -} diff --git a/test/tap/install-at-sub-path-locally.js b/test/tap/install-at-sub-path-locally.js deleted file mode 100644 index 931d29bbd2642..0000000000000 --- a/test/tap/install-at-sub-path-locally.js +++ /dev/null @@ -1,49 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = path.resolve(common.pkg, 'package') - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } - -var json = { - name: 'install-at-sub-path-locally-mock', - version: '0.0.0' -} - -var target = '../package@1.2.3' - -test('setup', function (t) { - var root = path.resolve(pkg, target) - mkdirp.sync(root) - fs.writeFileSync( - path.join(root, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - t.end() -}) - -test('\'npm install ../package@1.2.3\' should install local pkg from sub path', function (t) { - common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-sub-path-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) - -test('\'running npm install ../package@1.2.3\' should not break on sub path re-install', function (t) { - common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-sub-path-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) diff --git a/test/tap/install-bad-dep-format.js b/test/tap/install-bad-dep-format.js deleted file mode 100644 index 9d9a41383598d..0000000000000 --- a/test/tap/install-bad-dep-format.js +++ /dev/null @@ -1,33 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var json = { - author: 'John Foo', - name: 'bad-dep-format', - version: '0.0.0', - dependencies: { - 'not-legit': 'bad:not-legit@1.0' - } -} - -test('invalid url format returns appropriate error', function (t) { - var pkgPath = path.resolve(common.pkg, json.name) - mkdirp.sync(pkgPath) - fs.writeFileSync( - path.join(pkgPath, 'package.json'), - JSON.stringify(json, null, 2) - ) - common.npm(['install'], {cwd: pkgPath}, function (err, code, stdout, stderr) { - t.ifError(err, 'install ran without error') - t.equals(code, 1, 'install exited with code 1') - t.match(stderr, - /ERR.*Unsupported URL Type/, - 'Error should report that invalid url-style formats are used') - t.end() - }) -}) diff --git a/test/tap/install-bad-man.js b/test/tap/install-bad-man.js deleted file mode 100644 index 0aa83a21c541a..0000000000000 --- a/test/tap/install-bad-man.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var target = resolve(common.pkg, 'target') - -var EXEC_OPTS = { - cwd: target -} - -var json = { - name: 'install-bad-man', - version: '1.2.3', - man: [ './install-bad-man.1.lol' ] -} - -common.skipIfWindows('man pages do not get installed on Windows') - -test('setup', function (t) { - mkdirp.sync(pkg) - // make sure it installs locally - mkdirp.sync(resolve(target, 'node_modules')) - fs.writeFileSync( - resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - fs.writeFileSync(resolve(pkg, 'install-bad-man.1.lol'), 'lol\n') - t.end() -}) - -test("install from repo on 'OS X'", function (t) { - common.npm( - [ - 'install', - '--prefix', target, - '--global', - pkg - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm command ran from test') - t.equals(code, 1, 'install exited with failure (1)') - t.notOk(stdout, 'no output indicating success') - t.notOk( - stderr.match(/Cannot read property '1' of null/), - 'no longer has cryptic error output' - ) - t.ok( - stderr.match(/install-bad-man\.1\.lol is not a valid name/), - 'got expected error output' - ) - - t.end() - } - ) -}) diff --git a/test/tap/install-before.js b/test/tap/install-before.js deleted file mode 100644 index 715e22c2fb187..0000000000000 --- a/test/tap/install-before.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap.js') -const pacote = require('pacote') -const mr = common.fakeRegistry.compat -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const { test } = require('tap') - -const { Dir, File } = Tacks - -const testDir = common.pkg - -let server -test('setup', t => { - mr({}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('installs an npm package before a certain date', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}) - })) - - const testDir = t.testdir({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }, null, 2), - }) - - fixture.create(testDir) - const packument = { - name: 'foo', - 'dist-tags': { latest: '1.2.4' }, - versions: { - '1.2.3': { - name: 'foo', - version: '1.2.3', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.3.tgz` - } - }, - '1.2.4': { - name: 'foo', - version: '1.2.4', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.4.tgz` - } - } - }, - time: { - created: '2017-01-01T00:00:01.000Z', - modified: '2018-01-01T00:00:01.000Z', - '1.2.3': '2017-01-01T00:00:01.000Z', - '1.2.4': '2018-01-01T00:00:01.000Z' - } - } - server.get('/foo').reply(200, packument) - - return pacote.tarball(`file:${testDir}`) - .then(tarball => { - server.get('/foo/-/foo-1.2.3.tgz').reply(200, tarball) - server.get('/foo/-/foo-1.2.4.tgz').reply(500) - return common.npm([ - 'install', 'foo', - '--before', '2018', - '--json', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.like(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'foo', - version: '1.2.3' - }] - }, 'installed the 2017 version of the package') - }) -}) - -test('cleanup', t => { - server.close() - return rimraf(testDir) -}) diff --git a/test/tap/install-bin-null.js b/test/tap/install-bin-null.js deleted file mode 100644 index 2ad75eb59940a..0000000000000 --- a/test/tap/install-bin-null.js +++ /dev/null @@ -1,73 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var parentPkg = { - name: 'parent-package', - version: '0.0.0', - dependencies: { - 'child-package-a': 'file:./child-package-a', - 'child-package-b': 'file:./child-package-b' - } -} - -var childPkgA = { - name: 'child-package-a', - version: '0.0.0', - bin: 'index.js' -} - -var childPkgB = { - name: 'child-package-b', - version: '0.0.0', - dependencies: { - 'grandchild-package': 'file:../grandchild-package' - } -} - -var grandchildPkg = { - name: 'grandchild-package', - version: '0.0.0', - bin: null -} - -var pkgs = [childPkgA, childPkgB, grandchildPkg] - -test('setup', t => { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(parentPkg, null, 2) - ) - pkgs.forEach(function (json) { - var pkgPath = path.resolve(pkg, json.name) - mkdirp.sync(pkgPath) - fs.writeFileSync( - path.join(pkgPath, 'package.json'), - JSON.stringify(json, null, 2) - ) - }) - fs.writeFileSync( - path.join(pkg, childPkgA.name, 'index.js'), - '' - ) - t.end() -}) - -test('the grandchild has bin:null', function (t) { - common.npm(['install'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm link finished without error') - t.equal(code, 0, 'exited ok') - t.ok(stdout, 'output indicating success') - t.notOk(stderr, 'no output stderr') - t.end() - }) -}) diff --git a/test/tap/install-cli-only-development.js b/test/tap/install-cli-only-development.js deleted file mode 100644 index 6f03931d80e9c..0000000000000 --- a/test/tap/install-cli-only-development.js +++ /dev/null @@ -1,95 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -const t = require('tap') - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-development', - description: 'fixture', - version: '0.0.0', - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -t.test('setup', t => { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - t.end() -}) - -t.test('\'npm install --only=development\' should only install devDependencies', function (t) { - common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code) { - t.ifError(err, 'install development successful') - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dev-dependency/package.json'), 'utf8') - ), - 'devDependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), - 'dependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) - -t.test('\'npm install --only=development\' should only install devDependencies regardless of npm.config.get(\'production\')', function (t) { - common.npm(['install', '--only=development', '--production'], EXEC_OPTS, function (err, code) { - t.ifError(err, 'install development successful') - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dev-dependency/package.json'), 'utf8') - ), - 'devDependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), - 'dependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) diff --git a/test/tap/install-cli-only-production.js b/test/tap/install-cli-only-production.js deleted file mode 100644 index 63863ff934d93..0000000000000 --- a/test/tap/install-cli-only-production.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-only-production', - description: 'fixture', - version: '0.0.0', - scripts: { - prepublish: 'exit 123' - }, - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - t.end() -}) - -test('\'npm install --only=production\' should only install dependencies', function (t) { - common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment('1> ' + stdout) - t.comment('2> ' + stderr) - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8') - ), - 'dependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), - 'devDependency was NOT installed' - ) - t.end() - }) -}) diff --git a/test/tap/install-cli-only-shrinkwrap.js b/test/tap/install-cli-only-shrinkwrap.js deleted file mode 100644 index 004593d782c22..0000000000000 --- a/test/tap/install-cli-only-shrinkwrap.js +++ /dev/null @@ -1,119 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-only-shrinkwrap', - description: 'fixture', - version: '0.0.0', - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var shrinkwrap = { - name: 'install-cli-only-shrinkwrap', - description: 'fixture', - version: '0.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - dependency: { - version: 'file:./dependency' - }, - 'dev-dependency': { - version: 'file:./dev-dependency', - dev: true - } - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) - ) - t.end() -}) - -test('\'npm install --only=development\' should only install devDependencies', function (t) { - common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code, stderr, stdout) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - t.ok( - existsSync( - path.resolve(pkg, 'node_modules/dev-dependency/package.json') - ), - 'devDependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), - 'dependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) - -test('\'npm install --only=production\' should only install dependencies', function (t) { - common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - t.ok( - existsSync( - path.resolve(pkg, 'node_modules/dependency/package.json') - ), - 'dependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), - 'devDependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) diff --git a/test/tap/install-cli-production-nosave.js b/test/tap/install-cli-production-nosave.js deleted file mode 100644 index 23f5494996473..0000000000000 --- a/test/tap/install-cli-production-nosave.js +++ /dev/null @@ -1,48 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var t = require('tap') - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var PACKAGE_JSON1 = { - name: 'install-cli-production-nosave', - version: '0.0.1', - dependencies: { - } -} - -t.test('setup', function (t) { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(PACKAGE_JSON1, null, 2) - ) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -t.test('install --production without --save exits successfully', function (t) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install', '--production', 'underscore' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install exited with code 0') - t.end() - } - ) -}) diff --git a/test/tap/install-cli-production.js b/test/tap/install-cli-production.js deleted file mode 100644 index d083b4295738b..0000000000000 --- a/test/tap/install-cli-production.js +++ /dev/null @@ -1,79 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-production', - description: 'fixture', - version: '0.0.0', - scripts: { - prepublish: 'exit 123' - }, - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - t.end() -}) - -test('\'npm install --production\' should only install dependencies', function (t) { - common.npm(['install', '--production'], EXEC_OPTS, function (err, code) { - t.ifError(err, 'install production successful') - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8') - ), - 'dependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), - 'devDependency was NOT installed' - ) - t.end() - }) -}) diff --git a/test/tap/install-cli-unicode.js b/test/tap/install-cli-unicode.js deleted file mode 100644 index 930066db5fe54..0000000000000 --- a/test/tap/install-cli-unicode.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -function hasOnlyAscii (s) { - return /^[\000-\177]*$/.test(s) -} - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli', - description: 'fixture', - version: '0.0.1', - dependencies: { - read: '1.0.5' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mr({ port: common.port }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('does not use unicode with --unicode false', function (t) { - common.npm( - [ - '--unicode', 'false', - '--registry', common.registry, - '--loglevel', 'silent', - 'install', 'optimist' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err, 'install package read without unicode success') - t.notOk(code, 'npm install exited with code 0') - t.ifError(err, 'npm install ran without issue') - t.ok(stdout, 'got some output') - t.ok(hasOnlyAscii(stdout), 'only ASCII in install output') - - t.end() - } - ) -}) diff --git a/test/tap/install-contributors-count.js b/test/tap/install-contributors-count.js deleted file mode 100644 index ead925081330b..0000000000000 --- a/test/tap/install-contributors-count.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File -var common = require('../common-tap.js') - -var testdir = common.pkg -var fixture = new Tacks(Dir({ - node_modules: Dir({ - a: Dir({ - 'package.json': File({ - name: 'a', - version: '1.0.0', - dependencies: { - b: '1.0.0' - } - }), - node_modules: Dir({ - b: Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }) - }) - }) - }), - 'b-src': Dir({ - 'package.json': File({ - name: 'b', - author: 'Author Contributor', - contributors: [ - {name: 'Author Contributor'}, - 'Another Contributor' - ], - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('install', function (t) { - common.npm(['install', '--no-save', './b-src'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.includes(stdout, 'added 1 package from 2 contributors', 'lists number of unique contributors') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/install-dep-classification.js b/test/tap/install-dep-classification.js deleted file mode 100644 index 1c9995cedc8a0..0000000000000 --- a/test/tap/install-dep-classification.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') -const fs = require('fs') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') -const optionaldir = path.join(testdir, 'optional') -const devdir = path.join(testdir, 'dev') - -const env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' -}) - -/** - * NOTE: Tarball Fixtures - * They contain package.json files with dependencies like the following: - * a-1.0.0.tgz: package/package.json - * { - * "name":"a", - * "version":"1.0.0", - * "dependencies":{ - * "b":"./b-1.0.0.tgz" - * } - * } - * example-1.0.0.tgz: package/package.json - * { - * "name":"example", - * "version":"1.0.0", - * "dependencies":{ - * "a":"./a-1.0.0.tgz", - * "b":"./b-1.0.0.tgz" - * } - * } - */ -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'a-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003edcfc10a83300c06e09df71492f35653567bf06d' + - 'a2067163b558b7c3c4775f54f0e4654c18837e973f4da0249eca1bd59cfa' + - '25d535b4eeb03344b4c6245bfd8946995d328b5a5b3bd55264464beebdc8' + - '9647e8a99355befd67b92559f34f0ce0e8ce9003c1099edc85a675f2d20a' + - '154aa762cfae6257361c201fa090994a8bf33c577dfd82713cfefa86288a' + - 'a2e8736f68a0ff4400080000', - 'hex' - )), - 'b-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260ad8c4c1c0d85c81c1d8d4ccc0d0d0cccc00a80ec830353103' + - 'd2d4760836505a5c925804740aa5e640bca200a78708a856ca4bcc4d55b2' + - '524a52d2512a4b2d2acecccf03f20cf50cf40c946ab906da79a360148c82' + - '51300a680400106986b400080000', - 'hex' - )), - dev: Dir({ - 'package.json': File({ - name: 'dev', - version: '1.0.0', - devDependencies: { - example: '../example-1.0.0.tgz' - } - }) - }), - 'example-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed8fc10a83300c863def2924e7ada6587bf06daa' + - '06719bb55837c6c4775fa6307670a70963d0ef92f02584fcce94275353e2' + - '962a8ebeb3d1c620a2562a5ef34f64aae328cd344aa935f21e379962875b' + - '3fb2c6c50fa6e757bebdb364895ff54f18c19a962007ba99d69d09f670a5' + - 'de379d6527050a645391235b912d1bf2908f607826127398e762a8efbc53' + - 'ccae7873d3b4fb75ba402010087ce2014747c9d500080000', - 'hex' - )), - optional: Dir({ - 'package.json': File({ - name: 'optional', - version: '1.0.0', - optionalDependencies: { - example: '../example-1.0.0.tgz' - } - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - return common.fakeRegistry.listen() -}) - -test('optional dependency identification', function (t) { - return common.npm(['install', '--no-optional'], {cwd: optionaldir, env}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.notOk(fs.existsSync(path.join(optionaldir, 'node_modules')), 'did not install anything') - t.similar(JSON.parse(fs.readFileSync(path.join(optionaldir, 'package-lock.json'), 'utf8')), { - dependencies: { - a: { - version: 'file:../a-1.0.0.tgz', - optional: true - }, - b: { - version: 'file:../b-1.0.0.tgz', - optional: true - }, - example: { - version: 'file:../example-1.0.0.tgz', - optional: true - } - } - }, 'locks dependencies as optional') - }) -}) - -test('development dependency identification', function (t) { - return common.npm(['install', '--only=prod'], {cwd: devdir, env}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.notOk(fs.existsSync(path.join(devdir, 'node_modules')), 'did not install anything') - t.similar(JSON.parse(fs.readFileSync(path.join(devdir, 'package-lock.json'), 'utf8')), { - dependencies: { - a: { - version: 'file:../a-1.0.0.tgz', - dev: true - }, - b: { - version: 'file:../b-1.0.0.tgz', - dev: true - }, - example: { - version: 'file:../example-1.0.0.tgz', - dev: true - } - } - }, 'locks dependencies as dev') - }) -}) - -test('default dependency identification', function (t) { - return common.npm(['install'], {cwd: optionaldir, env}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.similar(JSON.parse(fs.readFileSync(path.join(optionaldir, 'package-lock.json'), 'utf8')), { - dependencies: { - a: { - version: 'file:../a-1.0.0.tgz', - optional: true - }, - b: { - version: 'file:../b-1.0.0.tgz', - optional: true - }, - example: { - version: 'file:../example-1.0.0.tgz', - optional: true - } - } - }, 'locks dependencies as optional') - }) -}) - -test('cleanup', function (t) { - common.fakeRegistry.close() - cleanup() - t.done() -}) diff --git a/test/tap/install-duplicate-deps-warning.js b/test/tap/install-duplicate-deps-warning.js deleted file mode 100644 index 869476ccd17ef..0000000000000 --- a/test/tap/install-duplicate-deps-warning.js +++ /dev/null @@ -1,51 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -var json = { - dependencies: { - underscore: '1.5.1' - }, - devDependencies: { - underscore: '1.3.1' - } -} - -test('npm install with duplicate dependencies, different versions', function (t) { - t.plan(1) - t.comment('test for https://github.com/npm/npm/issues/6725') - - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - mr({ port: common.port }, function (er, s) { - var opts = { - cache: common.cache, - registry: common.registry - } - - npm.load(opts, function (err) { - if (err) return t.fail(err) - - npm.install('.', function (err, additions, result) { - if (err) return t.fail(err) - - var invalid = result.warnings.filter(function (warning) { return warning.code === 'EDUPLICATEDEP' }) - t.is(invalid.length, 1, 'got a warning (EDUPLICATEDEP) for duplicate dev/production dependencies') - - s.close() - t.end() - }) - }) - }) -}) diff --git a/test/tap/install-from-local-multipath.js b/test/tap/install-from-local-multipath.js deleted file mode 100644 index e35794dca986c..0000000000000 --- a/test/tap/install-from-local-multipath.js +++ /dev/null @@ -1,173 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var root = common.pkg -// Allow running this test on older commits (useful for bisecting) -if (!root) { - var main = require.main.filename - root = path.resolve(path.dirname(main), path.basename(main, '.js')) -} -var pkg = path.join(root, 'parent') - -var EXEC_OPTS = { cwd: pkg } - -var parent = { - name: 'parent', - version: '0.0.0', - dependencies: { - 'child-1-1': 'file:../children/child-1-1', - 'child-1-2': 'file:../children/child-1-2', - 'child-2': 'file:../children/child-2' - } -} - -var parentLock = { - 'name': 'parent', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': { - 'child-1-1': { - 'version': 'file:../children/child-1-1', - 'requires': { - 'child-2': 'file:../children/child-2' - } - }, - 'child-1-2': { - 'version': 'file:../children/child-1-2', - 'requires': { - 'child-1-1': 'file:../children/child-1-1', - 'child-2': 'file:../children/child-2' - } - }, - 'child-2': { - 'version': 'file:../children/child-2' - } - } -} - -var child11 = { - name: 'parent', - version: '0.0.0', - 'dependencies': { - 'child-2': 'file:../child-2' - } -} - -var child11Lock = { - 'name': 'child-1-1', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': { - 'child-2': { - 'version': 'file:../child-2' - } - } -} - -var child12 = { - 'name': 'child-1-2', - 'version': '1.0.0', - 'dependencies': { - 'child-1-1': 'file:../child-1-1', - 'child-2': 'file:../child-2' - } -} - -var child12Lock = { - 'name': 'child-1-2', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': { - 'child-1-1': { - 'version': 'file:../child-1-1', - 'requires': { - 'child-2': 'file:../child-2' - } - }, - 'child-2': { - 'version': 'file:../child-2' - } - } -} - -var child2 = { - 'name': 'child-2', - 'version': '1.0.0', - 'dependencies': {} -} - -var child2Lock = { - 'name': 'child-2', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': {} -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(parent, null, 2) - ) - - fs.writeFileSync( - path.join(pkg, 'package-lock.json'), - JSON.stringify(parentLock, null, 2) - ) - - mkdirp.sync(path.join(root, 'children', 'child-1-1')) - fs.writeFileSync( - path.join(root, 'children', 'child-1-1', 'package.json'), - JSON.stringify(child11, null, 2) - ) - fs.writeFileSync( - path.join(root, 'children', 'child-1-1', 'package-lock.json'), - JSON.stringify(child11Lock, null, 2) - ) - - mkdirp.sync(path.join(root, 'children', 'child-1-2')) - fs.writeFileSync( - path.join(root, 'children', 'child-1-2', 'package.json'), - JSON.stringify(child12, null, 2) - ) - fs.writeFileSync( - path.join(root, 'children', 'child-1-2', 'package-lock.json'), - JSON.stringify(child12Lock, null, 2) - ) - - mkdirp.sync(path.join(root, 'children', 'child-2')) - fs.writeFileSync( - path.join(root, 'children', 'child-2', 'package.json'), - JSON.stringify(child2, null, 2) - ) - fs.writeFileSync( - path.join(root, 'children', 'child-2', 'package-lock.json'), - JSON.stringify(child2Lock, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('\'npm install\' should install local packages', function (t) { - common.npm( - [ - 'install', '.' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'error should not exist') - t.notOk(code, 'npm install exited with code 0') - t.end() - } - ) -}) diff --git a/test/tap/install-from-local.js b/test/tap/install-from-local.js deleted file mode 100644 index 1ab94243ff3ca..0000000000000 --- a/test/tap/install-from-local.js +++ /dev/null @@ -1,89 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var root = common.pkg -var pkg = path.join(root, 'package-with-local-paths') - -var EXEC_OPTS = { cwd: pkg } - -var localPaths = { - name: 'package-with-local-paths', - version: '0.0.0', - dependencies: { - 'package-local-dependency': 'file:../package-local-dependency' - }, - devDependencies: { - 'package-local-dev-dependency': 'file:../package-local-dev-dependency' - } -} - -var localDependency = { - name: 'package-local-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -var localDevDependency = { - name: 'package-local-dev-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(localPaths, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dev-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dev-dependency', 'package.json'), - JSON.stringify(localDevDependency, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('\'npm install\' should install local packages', function (t) { - common.npm( - [ - 'install', '.' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'error should not exist') - t.notOk(code, 'npm install exited with code 0') - var dependencyPackageJson = path.resolve( - pkg, - 'node_modules/package-local-dependency/package.json' - ) - t.ok( - JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')), - 'package with local dependency installed' - ) - - var devDependencyPackageJson = path.resolve( - pkg, 'node_modules/package-local-dev-dependency/package.json' - ) - t.ok( - JSON.parse(fs.readFileSync(devDependencyPackageJson, 'utf8')), - 'package with local dev dependency installed' - ) - - t.end() - } - ) -}) diff --git a/test/tap/install-into-likenamed-folder.js b/test/tap/install-into-likenamed-folder.js deleted file mode 100644 index c7bc86f3baaf4..0000000000000 --- a/test/tap/install-into-likenamed-folder.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg -var moduleDir = path.join(base, 'example-src') -var destDir = path.join(base, 'example') -var moduleJson = { - name: 'example', - version: '1.0.0' -} - -function setup () { - cleanup() - mkdirp.sync(moduleDir) - mkdirp.sync(path.join(destDir, 'node_modules')) - fs.writeFileSync(path.join(moduleDir, 'package.json'), JSON.stringify(moduleJson)) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('like-named', function (t) { - common.npm(['install', '../example-src'], {cwd: destDir}, function (er, code, stdout, stderr) { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/install-link-metadeps-locally.js b/test/tap/install-link-metadeps-locally.js deleted file mode 100644 index 136fd46d10bbf..0000000000000 --- a/test/tap/install-link-metadeps-locally.js +++ /dev/null @@ -1,52 +0,0 @@ -// XXX Remove in npm v7, when this is no longer how we do things -const t = require('tap') -const common = require('../common-tap.js') -const pkg = common.pkg -const mkdirp = require('mkdirp') -const { writeFileSync, statSync } = require('fs') -const { resolve } = require('path') -const mr = require('npm-registry-mock') -const rimraf = require('rimraf') - -t.test('setup', t => { - mkdirp.sync(resolve(pkg, 'node_modules')) - mkdirp.sync(resolve(pkg, 'foo')) - writeFileSync(resolve(pkg, 'foo', 'package.json'), JSON.stringify({ - name: 'foo', - version: '1.2.3', - dependencies: { - underscore: '*' - } - })) - - writeFileSync(resolve(pkg, 'package.json'), JSON.stringify({ - name: 'root', - version: '1.2.3', - dependencies: { - foo: 'file:foo' - } - })) - - mr({ port: common.port }, (er, s) => { - if (er) { - throw er - } - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -t.test('initial install to create package-lock', - t => common.npm(['install', '--registry', common.registry], { cwd: pkg }) - .then(([code]) => t.equal(code, 0, 'command worked'))) - -t.test('remove node_modules', t => - rimraf(resolve(pkg, 'node_modules'), t.end)) - -t.test('install again from package-lock', t => - common.npm(['install', '--registry', common.registry], { cwd: pkg }) - .then(([code]) => { - t.equal(code, 0, 'command worked') - const underscore = resolve(pkg, 'node_modules', 'underscore') - t.equal(statSync(underscore).isDirectory(), true, 'underscore installed') - })) diff --git a/test/tap/install-link-metadeps-subfolders.js b/test/tap/install-link-metadeps-subfolders.js deleted file mode 100644 index 7544c8a4ebe84..0000000000000 --- a/test/tap/install-link-metadeps-subfolders.js +++ /dev/null @@ -1,68 +0,0 @@ -const t = require('tap') -const common = require('../common-tap.js') -const mkdirp = require('mkdirp') -const { writeFileSync, readFileSync } = require('fs') -const { resolve } = require('path') -const pkg = common.pkg -const app = resolve(pkg, 'app') -const lib = resolve(pkg, 'lib') -const moda = resolve(lib, 'module-a') -const modb = resolve(lib, 'module-b') - -const rimraf = require('rimraf') - -t.test('setup', t => { - mkdirp.sync(app) - mkdirp.sync(moda) - mkdirp.sync(modb) - - writeFileSync(resolve(app, 'package.json'), JSON.stringify({ - name: 'app', - version: '1.2.3', - dependencies: { - moda: 'file:../lib/module-a' - } - })) - - writeFileSync(resolve(moda, 'package.json'), JSON.stringify({ - name: 'moda', - version: '1.2.3', - dependencies: { - modb: 'file:../module-b' - } - })) - - writeFileSync(resolve(modb, 'package.json'), JSON.stringify({ - name: 'modb', - version: '1.2.3' - })) - - t.end() -}) - -t.test('initial install to create package-lock', - t => common.npm(['install'], { cwd: app }) - .then(([code]) => t.equal(code, 0, 'command worked'))) - -t.test('remove node_modules', t => - rimraf(resolve(pkg, 'node_modules'), t.end)) - -t.test('install again from package-lock', t => - common.npm(['install'], { cwd: app }) - .then(([code]) => { - t.equal(code, 0, 'command worked') - // verify that module-b is linked under module-a - const depPkg = resolve( - app, - 'node_modules', - 'moda', - 'node_modules', - 'modb', - 'package.json' - ) - const data = JSON.parse(readFileSync(depPkg, 'utf8')) - t.strictSame(data, { - name: 'modb', - version: '1.2.3' - }) - })) diff --git a/test/tap/install-link-scripts.js b/test/tap/install-link-scripts.js deleted file mode 100644 index 52e50c6e9fb0a..0000000000000 --- a/test/tap/install-link-scripts.js +++ /dev/null @@ -1,121 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -const t = require('tap') - -var common = require('../common-tap.js') -common.skipIfWindows('links are weird on windows') - -var pkg = common.pkg -var tmp = path.join(pkg, 'tmp') -var dep = path.join(pkg, 'dep') - -var json = { - name: 'install-link-scripts', - version: '1.0.0', - description: 'a test', - repository: 'git://github.com/npm/npm.git', - license: 'ISC' -} - -var dependency = { - name: 'dep', - version: '1.0.0', - scripts: { - install: 'node ./bin/foo' - } -} - -var foo = function () { /* -#!/usr/bin/env node - -console.log('hey sup') -*/ }.toString().split('\n').slice(1, -1).join('\n') - -process.env.npm_config_prefix = tmp - -t.beforeEach(cb => { - rimraf(pkg, er => { - if (er) { - return cb(er) - } - mkdirp.sync(tmp) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mkdirp.sync(path.join(dep, 'bin')) - fs.writeFileSync( - path.join(dep, 'package.json'), - JSON.stringify(dependency, null, 2) - ) - fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) - fs.chmod(path.join(dep, 'bin', 'foo'), '0755') - cb() - }) -}) - -t.test('plain install', function (t) { - common.npm( - [ - 'install', dep, - '--tmp', tmp - ], - { cwd: pkg }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm install ' + dep + ' finished without error') - t.equal(code, 0, 'exited ok') - t.notOk(stderr, 'no output stderr') - t.match(stdout, /hey sup/, 'postinstall script for dep ran') - t.end() - } - ) -}) - -t.test('link', function (t) { - common.npm( - [ - 'link', - '--tmp', tmp - ], - { cwd: dep }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm link finished without error') - t.equal(code, 0, 'exited ok') - t.notOk(stderr, 'no output stderr') - t.match(stdout, /hey sup/, 'script ran') - t.end() - } - ) -}) - -t.test('install --link', function (t) { - common.npm( - [ - 'link', - '--tmp', tmp - ], - { cwd: dep }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm link finished without error') - - common.npm( - [ - 'install', '--link', dependency.name, - '--tmp', tmp - ], - { cwd: pkg }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm install --link finished without error') - t.equal(code, 0, 'exited ok') - t.notOk(stderr, 'no output stderr') - t.notMatch(stdout, /hey sup/, "script didn't run") - t.end() - } - ) - } - ) -}) diff --git a/test/tap/install-local-dep-cycle.js b/test/tap/install-local-dep-cycle.js deleted file mode 100644 index a66f04bce4715..0000000000000 --- a/test/tap/install-local-dep-cycle.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg - -var baseJSON = { - name: 'base', - version: '1.0.0', - dependencies: { - a: 'file:a/', - b: 'file:b/' - } -} - -var aPath = path.join(base, 'a') -var aJSON = { - name: 'a', - version: '1.0.0', - dependencies: { - b: 'file:../b', - c: 'file:../c' - } -} - -var bPath = path.join(base, 'b') -var bJSON = { - name: 'b', - version: '1.0.0' -} - -var cPath = path.join(base, 'c') -var cJSON = { - name: 'c', - version: '1.0.0', - dependencies: { - b: 'file:../b' - } -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('install', function (t) { - common.npm(['install'], {cwd: base}, function (er, code, stdout, stderr) { - t.ifError(er, 'npm config ran without issue') - t.is(code, 0, 'exited with a non-error code') - t.is(stderr, '', 'Ran without errors') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function saveJson (pkgPath, json) { - mkdirp.sync(pkgPath) - fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup () { - saveJson(base, baseJSON) - saveJson(aPath, aJSON) - saveJson(bPath, bJSON) - saveJson(cPath, cJSON) -} - -function cleanup () { - rimraf.sync(base) -} diff --git a/test/tap/install-local-from-local.js b/test/tap/install-local-from-local.js deleted file mode 100644 index ec53c74a39206..0000000000000 --- a/test/tap/install-local-from-local.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var common = require('../common-tap.js') -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -var testdir = path.join(__dirname, path.basename(__filename, '.js')) -var cwd = path.join(testdir, '3') - -/** - * NOTE: Tarball Fixtures - * They contain package.json files with dependencies like the following: - * 1-1.0.0.tgz: package/package.json - * { - * "name":"1", - * "version":"1.0.0" - * } - * 2-1.0.0.tgz: package/package.json - * { - * "name":"2", - * "version":"1.0.0", - * "dependencies":{ - * "1":"file:../1/1-1.0.0.tgz" - * } - * } - */ -var fixture = new Tacks(Dir({ - '1': Dir({ - '1-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260ad8c4c1c0d85c81c1d8d4ccc0d0d0cccc00a80ec830353103' + - 'd2d4760836505a5c925804740aa5e640bca200a78708a856ca4bcc4d55b2' + - '523254d2512a4b2d2acecccf03f1f40cf40c946ab906da79a360148c8251' + - '300a6804007849dfdf00080000', - 'hex' - )) - }), - '2': Dir({ - '2-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed8f3d0e83300c8599394594b90d36840cdc2602' + - '17d19f80087468c5ddeb14a9135b91aa4af996e73c3f47f660eb8b6d291b' + - '565567dfbb646700c0682db6fc00ea5c24456900d118e01c17a52e58f75e' + - '648bd94f76e455befd67bd457cf44f78a64248676f242b21737908cf3b8d' + - 'beeb5d70508182d56d6820d790ab3bf2dc0a83ec62489dba2b554a6598e1' + - 'f13da1a6f62139b0a44bfaeb0b23914824b2c50b8b5b623100080000', - 'hex' - )) - }), - '3': Dir({ - 'package.json': File({ - name: '3', - version: '1.0.0', - dependencies: { - '2': '../2/2-1.0.0.tgz' - } - }) - }) -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('installing local package with local dependency', function (t) { - common.npm( - ['install'], - {cwd: cwd}, - function (er, code, stdout, stderr) { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.ok(fs.existsSync(path.join(cwd, 'node_modules', '2')), 'installed direct dep') - t.ok(fs.existsSync(path.join(cwd, 'node_modules', '1')), 'installed indirect dep') - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/install-man.js b/test/tap/install-man.js deleted file mode 100644 index 8c4b89015151f..0000000000000 --- a/test/tap/install-man.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var target = resolve(common.pkg, 'target') - -common.pendIfWindows('man pages do not get installed on Windows') - -var EXEC_OPTS = { - cwd: target -} - -var json = { - name: 'install-man', - version: '1.2.3', - man: [ './install-man.1' ] -} - -test('setup', function (t) { - mkdirp.sync(pkg) - // make sure it installs locally - mkdirp.sync(resolve(target, 'node_modules')) - fs.writeFileSync( - resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - fs.writeFileSync(resolve(pkg, 'install-man.1'), 'THIS IS A MANPAGE\n') - t.end() -}) - -test('install man page', function (t) { - common.npm( - [ - 'install', - '--prefix', target, - '--global', - pkg - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm command ran from test') - t.equals(code, 0, 'install exited with success (0)') - t.ok(stdout, 'output indicating success') - t.ok( - fs.existsSync(resolve(target, 'share', 'man', 'man1', 'install-man.1')), - 'man page link was created' - ) - - t.end() - } - ) -}) diff --git a/test/tap/install-mention-funding.js b/test/tap/install-mention-funding.js deleted file mode 100644 index 7fdbdf46668e2..0000000000000 --- a/test/tap/install-mention-funding.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict' -const path = require('path') -// TODO: needs to poke into arborist to figure out if the old test cases are -// not working anymore due to `file:../` usage, if that's not the case just -// update the current failing test cases here with something more accurate -const { test } = require('tap') -const Tacks = require('tacks') -const Dir = Tacks.Dir -const File = Tacks.File -const common = require('../common-tap.js') - -const base = common.pkg -const singlePackage = path.join(base, 'single-funding-package') -const multiplePackages = path.join(base, 'top-level-funding') - -function getFixturePackage ({ name, version, dependencies, funding }) { - return Dir({ - 'package.json': File({ - name, - version: version || '1.0.0', - funding: funding || { - type: 'individual', - url: 'http://example.com/donate' - }, - dependencies: dependencies || {} - }) - }) -} - -const fixture = new Tacks(Dir({ - 'package.json': File({}), - 'single-funding-package': getFixturePackage({ - name: 'single-funding-package' - }), - 'top-level-funding': getFixturePackage({ - name: 'top-level-funding', - dependencies: { - 'dep-foo': 'file:../dep-foo', - 'dep-bar': 'file:../dep-bar' - } - }), - 'dep-foo': getFixturePackage({ - name: 'dep-foo', - funding: { - type: 'corporate', - url: 'https://corp.example.com/sponsor' - }, - dependencies: { - 'sub-dep-bar': 'file:../sub-dep-bar' - } - }), - 'dep-bar': getFixturePackage({ - name: 'dep-bar', - version: '2.1.0', - dependencies: { - 'sub-dep-bar': 'file:../sub-dep-bar' - } - }), - 'sub-dep-bar': getFixturePackage({ - name: 'sub-dep-bar', - funding: { - type: 'foo', - url: 'http://example.com/foo' - } - }) -})) - -test('mention npm fund upon installing single dependency', function (t) { - setup(t) - common.npm(['install', '--no-save', singlePackage], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.includes(stdout, '1 package is looking for funding', 'should print amount of packages needing funding') - t.includes(stdout, ' run `npm fund` for details', 'should print npm fund mention') - t.end() - }) -}) - -test('mention npm fund upon installing multiple dependencies', function (t) { - setup(t) - common.npm(['install', '--no-save', multiplePackages], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.includes(stdout, '4 packages are looking for funding', 'should print amount of packages needing funding') - t.includes(stdout, ' run `npm fund` for details', 'should print npm fund mention') - t.end() - }) -}) - -test('skips mention npm fund using --no-fund option', function (t) { - setup(t) - common.npm(['install', '--no-save', '--no-fund', multiplePackages], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.doesNotHave(stdout, '4 packages are looking for funding', 'should print amount of packages needing funding') - t.doesNotHave(stdout, ' run `npm fund` for details', 'should print npm fund mention') - t.end() - }) -}) - -test('mention packages looking for funding using --json', function (t) { - setup(t) - common.npm(['install', '--no-save', '--json', multiplePackages], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - const res = JSON.parse(stdout) - t.match(res.funding, 4, 'should print amount of packages needing funding') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup (t) { - fixture.create(base) - t.teardown(() => { - cleanup() - }) -} - -function cleanup () { - fixture.remove(base) -} diff --git a/test/tap/install-noargs-dev.js b/test/tap/install-noargs-dev.js deleted file mode 100644 index 53422b9b5bc23..0000000000000 --- a/test/tap/install-noargs-dev.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var PACKAGE_JSON1 = { - name: 'install-noargs-dev', - version: '0.0.1', - devDependencies: { - 'underscore': '1.3.1' - } -} - -var PACKAGE_JSON2 = { - name: 'install-noargs-dev', - version: '0.0.2', - devDependencies: { - 'underscore': '1.5.1' - } -} - -test('setup', function (t) { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(PACKAGE_JSON1, null, 2) - ) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('install noargs installs devDependencies', function (t) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--no-save', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - var pkgJson = JSON.parse(fs.readFileSync(p)) - - t.equal(pkgJson.version, '1.3.1') - t.end() - } - ) -}) - -test('install noargs installs updated devDependencies', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(PACKAGE_JSON2, null, 2) - ) - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--no-save', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - var pkgJson = JSON.parse(fs.readFileSync(p)) - - t.equal(pkgJson.version, '1.5.1') - t.end() - } - ) -}) diff --git a/test/tap/install-order.js b/test/tap/install-order.js deleted file mode 100644 index c4a2b1c383eec..0000000000000 --- a/test/tap/install-order.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -/* eslint-disable no-use-before-define */ -var test = require('tap').test -var sortActions = require('../../lib/install/diff-trees.js').sortActions -var top = { - location: '/', - package: {}, - requiredBy: [], - requires: [a, b], - isTop: true -} -var a = { - location: '/a', - package: {}, - requiredBy: [], - requires: [c], - isTop: false, - userRequired: false, - existing: false, - parent: top -} -var b = { - location: '/b', - package: {}, - requiredBy: [], - requires: [c], - isTop: false, - userRequired: false, - existing: false, - parent: top -} -var c = { - location: '/c', - package: {}, - requiredBy: [a, b], - requires: [], - isTop: false, - userRequired: false, - existing: false, - parent: top -} - -test('install-order when installing deps', function (t) { - var plain = [ - ['add', a], - ['add', b], - ['add', c]] - var sorted = [ - ['add', c], - ['add', a], - ['add', b]] - t.isDeeply(sortActions(plain), sorted) - t.end() -}) - -test('install-order when not installing deps', function (t) { - var plain = [ - ['add', a], - ['add', b]] - var sorted = [ - ['add', a], - ['add', b]] - t.isDeeply(sortActions(plain), sorted) - t.end() -}) diff --git a/test/tap/install-package-json-order.js b/test/tap/install-package-json-order.js deleted file mode 100644 index 45ce882620c7b..0000000000000 --- a/test/tap/install-package-json-order.js +++ /dev/null @@ -1,42 +0,0 @@ -var test = require('tap').test -var path = require('path') -var mkdirp = require('mkdirp') -var spawn = require('child_process').spawn -var npm = require.resolve('../../bin/npm-cli.js') -var node = process.execPath -const common = require('../common-tap.js') -var pkg = common.pkg -var workdir = path.join(pkg, 'workdir') -var tmp = path.join(pkg, 'tmp') -var fs = require('fs') - -test('package.json sorting after install', function (t) { - var packageJson = path.resolve(pkg, 'package.json') - var installedPackage = path.resolve(workdir, - 'node_modules/install-package-json-order/package.json') - - mkdirp.sync(tmp) - mkdirp.sync(workdir) - - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - 'name': 'install-package-json-order', - 'version': '0.0.0', - 'array': [ 'one', 'two', 'three' ] - }, null, 2), 'utf8') - - fs.writeFileSync(path.resolve(workdir, 'package.json'), JSON.stringify({ - 'name': 'install-package-json-order-work', - 'version': '0.0.0' - }, null, 2), 'utf8') - - var before = JSON.parse(fs.readFileSync(packageJson).toString()) - var child = spawn(node, [npm, 'install', pkg], { cwd: workdir }) - - child.on('close', function (code) { - t.equal(code, 0, 'npm install exited with code') - var result = fs.readFileSync(installedPackage, 'utf8') - var resultAsJson = JSON.parse(result) - t.same(resultAsJson.array, before.array) - t.end() - }) -}) diff --git a/test/tap/install-package-lock-only.js b/test/tap/install-package-lock-only.js deleted file mode 100644 index 2c5191a02e7d7..0000000000000 --- a/test/tap/install-package-lock-only.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var pkgLockPath = path.join(testdir, 'package-lock.json') -var nodeModulesPath = path.join(testdir, 'node_modules') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const confPkgLockFalse = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn', - npm_config_package_lock: false - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'install-package-lock-only', - version: '1.0.0', - dependencies: { - mkdirp: '^0.3.4' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('package-lock-only', function (t) { - setup() - return common.npm(['install', '--package-lock-only'], conf).spread((code, stdout, stderr) => { - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - // Verify that node_modules does not exist - t.notOk(fs.existsSync(nodeModulesPath), 'ensure that node_modules does not exist') - - // Verify that package-lock.json exists and has `mkdirp@0.3.5` in it. - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - var pkgLock = JSON.parse(fs.readFileSync(pkgLockPath, 'utf-8')) - t.equal(pkgLock.dependencies.mkdirp.version, '0.3.5') - t.done() - }) -}) - -test('--package-lock-only with --package-lock negates `package_lock: false`', function (t) { - setup() - return common.npm(['install', '--package-lock', '--package-lock-only'], confPkgLockFalse).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - - // Verify that package-lock.json exists. - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - t.end() - }) -}) - -test('package-lock-only creates package_lock.json when config has `package_lock: false`', function (t) { - setup() - return common.npm(['install', '--package-lock-only'], confPkgLockFalse).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - - // Verify that package-lock.json exists. - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/install-parse-error.js b/test/tap/install-parse-error.js deleted file mode 100644 index 1a72c336de071..0000000000000 --- a/test/tap/install-parse-error.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var testdir = common.pkg - -var fixture = new Tacks(Dir({ - 'package.json': File( - '{\n' + - "'name': 'some-name',\n" + - "'dependencies': {}\n" + - '}' - ), - 'node_modules': Dir() -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('failing to parse package.json should be error', function (t) { - common.npm( - ['install'], - {cwd: testdir}, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'exit not ok') - t.similar(stderr, /npm ERR! JSON.parse Failed to parse json/) - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/install-property-conflicts.js b/test/tap/install-property-conflicts.js deleted file mode 100644 index a98f8570c62bd..0000000000000 --- a/test/tap/install-property-conflicts.js +++ /dev/null @@ -1,53 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var target = resolve(pkg, '_target') - -var EXEC_OPTS = { - cwd: target -} - -var json = { - name: 'install-property-conflicts', - version: '1.2.3', - type: 'nose-boop!' -} - -test('setup', function (t) { - // make sure it installs locally - mkdirp.sync(resolve(target, 'node_modules')) - fs.writeFileSync( - resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - t.end() -}) - -test('install package with a `type` property', function (t) { - t.comment('issue: https://github.com/npm/npm/issues/11398') - common.npm( - [ - 'install', - '--prefix', target, - pkg - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm command ran from test') - t.equals(code, 0, 'install exited with success (0)') - var installedPkg = resolve( - target, - 'node_modules', - 'install-property-conflicts', - 'package.json') - t.ok(fs.statSync(installedPkg), 'package installed successfully') - t.end() - } - ) -}) diff --git a/test/tap/install-report-just-installed.js b/test/tap/install-report-just-installed.js deleted file mode 100644 index 23b373b269405..0000000000000 --- a/test/tap/install-report-just-installed.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File -var common = require('../common-tap.js') - -var testdir = common.pkg -var fixture = new Tacks(Dir({ - node_modules: Dir({ - a: Dir({ - 'package.json': File({ - name: 'a', - version: '1.0.0', - dependencies: { - b: '1.0.0' - } - }), - node_modules: Dir({ - b: Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }) - }) - }) - }), - 'b-src': Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('install-report', function (t) { - common.npm(['install', '--no-save', '--json', './b-src'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - try { - var report = JSON.parse(stdout) - t.pass('stdout was json') - } catch (ex) { - t.fail('stdout was json') - console.error(ex) - t.skip(2) - return t.end() - } - t.is(report.added.length, 1, 'one dependency reported as installed') - t.match(report.added, [{name: 'b'}], 'that dependency was `b`') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/install-save-consistent-newlines.js b/test/tap/install-save-consistent-newlines.js deleted file mode 100644 index dfe41c649d2af..0000000000000 --- a/test/tap/install-save-consistent-newlines.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') - -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const rimraf = require('rimraf') -const test = require('tap').test - -const common = require('../common-tap.js') - -const pkg = common.pkg - -const EXEC_OPTS = { cwd: pkg } - -const json = { - name: 'install-save-consistent-newlines', - version: '0.0.1', - description: 'fixture' -} - -test('mock registry', function (t) { - mr({ port: common.port }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -const runTest = (t, opts) => { - t.test('setup', setup(opts.ending)) - t.test('check', check(opts)) - t.end() -} - -const setup = lineEnding => t => { - rimraf(pkg, er => { - if (er) { - throw er - } - mkdirp.sync(path.resolve(pkg, 'node_modules')) - - var jsonStr = JSON.stringify(json, null, 2) - - if (lineEnding === '\r\n') { - jsonStr = jsonStr.replace(/\n/g, '\r\n') - } - - fs.writeFileSync( - path.join(pkg, 'package.json'), - jsonStr - ) - - t.end() - }) -} - -const check = opts => t => common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - '--save', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS -).then(([code, err, out]) => { - t.notOk(code, 'npm install exited without raising an error code') - - const pkgPath = path.resolve(pkg, 'package.json') - const pkgStr = fs.readFileSync(pkgPath, 'utf8') - - t.match(pkgStr, opts.match) - t.notMatch(pkgStr, opts.notMatch) - - const pkgLockPath = path.resolve(pkg, 'package-lock.json') - const pkgLockStr = fs.readFileSync(pkgLockPath, 'utf8') - - t.match(pkgLockStr, opts.match) - t.notMatch(pkgLockStr, opts.notMatch) - - t.end() -}) - -test('keep LF line endings', t => { - runTest(t, { - ending: '\n', - match: '\n', - notMatch: '\r' - }) -}) - -test('keep CRLF line endings', t => { - runTest(t, { - ending: '\r\n', - match: '\r\n', - notMatch: /[^\r]\n/ - }) -}) diff --git a/test/tap/install-save-exact.js b/test/tap/install-save-exact.js deleted file mode 100644 index efa1e636138a1..0000000000000 --- a/test/tap/install-save-exact.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-save-exact', - version: '0.0.1', - description: 'fixture' -} - -test('mock registry', function (t) { - mr({ port: common.port }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -const setup = t => { - t.test('destroy', t => rimraf(pkg, t.end)) - t.test('create', t => { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() - }) - t.end() -} - -const check = (savearg, deptype) => t => { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - savearg, - '--save-exact', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'npm install exited without raising an error code') - - var p = path.resolve(pkg, 'node_modules/underscore/package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - p = path.resolve(pkg, 'package.json') - var pkgJson = JSON.parse(fs.readFileSync(p, 'utf8')) - - t.same( - pkgJson[deptype], - { 'underscore': '1.3.1' }, - 'underscore dependency should specify exactly 1.3.1' - ) - - t.end() - } - ) -} - -test('\'npm install --save --save-exact\' should install local pkg', function (t) { - t.test('setup', setup) - t.test('check', check('--save', 'dependencies')) - t.end() -}) - -test('\'npm install --save-dev --save-exact\' should install local pkg', function (t) { - t.test('setup', setup) - t.test('check', check('--save-dev', 'devDependencies')) - t.end() -}) diff --git a/test/tap/install-save-local.js b/test/tap/install-save-local.js deleted file mode 100644 index 8b6597952813d..0000000000000 --- a/test/tap/install-save-local.js +++ /dev/null @@ -1,181 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var root = common.pkg -var pkg = path.join(root, 'package') - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-save-local', - version: '0.0.0' -} - -var localDependency = { - name: 'package-local-dependency', - version: '0.0.0' -} - -var localDevDependency = { - name: 'package-local-dev-dependency', - version: '0.0.0' -} - -test('setup deps in root', t => { - mkdirp.sync(path.join(root, 'package-local-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dev-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dev-dependency', 'package.json'), - JSON.stringify(localDevDependency, null, 2) - ) - - t.end() -}) - -test('\'npm install --save ../local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save', - 'install', '../package-local-dependency' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.join( - pkg, 'node_modules', 'package-local-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.dependencies).length, 1, 'only one dep') - t.ok( - /file:.*?[/]package-local-dependency$/.test(pkgJson.dependencies['package-local-dependency']), - 'local package saved correctly' - ) - })) -}) - -test('\'npm install --save local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save', - 'install', 'package-local-dependency/' - ], - EXEC_OPTS - ).then(([code, out, err]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.join( - pkg, 'node_modules', 'package-local-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.dependencies).length, 1, 'only one dep') - t.ok( - /file:package-local-dependency$/.test(pkgJson.dependencies['package-local-dependency']), - 'local package saved correctly' - ) - })) -}) - -test('\'npm install --save-dev ../local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save-dev', - 'install', '../package-local-dev-dependency' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.resolve( - pkg, 'node_modules', 'package-local-dev-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.devDependencies).length, 1, 'only one dep') - t.ok( - /file:.*?[/\\]package-local-dev-dependency$/.test(pkgJson.devDependencies['package-local-dev-dependency']), - 'local package saved correctly' - ) - - t.end() - })) -}) - -test('\'npm install --save-dev local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save-dev', - 'install', 'package-local-dev-dependency/' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.resolve( - pkg, 'node_modules', 'package-local-dev-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.devDependencies).length, 1, 'only one dep') - t.ok( - /file:package-local-dev-dependency$/.test(pkgJson.devDependencies['package-local-dev-dependency']), - 'local package saved correctly' - ) - - t.end() - })) -}) - -function setup (t) { - t.test('destroy', t => rimraf(pkg, t.end)) - t.test('create', t => { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'package-local-dependency')) - fs.writeFileSync( - path.join(pkg, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'package-local-dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'package-local-dev-dependency', 'package.json'), - JSON.stringify(localDevDependency, null, 2) - ) - t.end() - }) - t.end() -} diff --git a/test/tap/install-save-prefix.js b/test/tap/install-save-prefix.js deleted file mode 100644 index d61608e1cfd21..0000000000000 --- a/test/tap/install-save-prefix.js +++ /dev/null @@ -1,164 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-save-prefix', - version: '0.0.1' -} - -test('start mock reg', function (t) { - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('install --save with \'^\' save prefix should accept minor updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '^', - '--save', - 'install', 'underscore@latest' - ], - EXEC_OPTS - ).then(([code]) => { - console.error('back from install!', code) - t.equal(code, 0, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.dependencies, - { 'underscore': '^1.5.1' }, - 'got expected save prefix and version of 1.5.1' - ) - })) -}) - -test('install --save-dev with \'^\' save prefix should accept minor dev updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '^', - '--save-dev', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.devDependencies, - { 'underscore': '^1.3.1' }, - 'got expected save prefix and version of 1.3.1' - ) - t.end() - })) -}) - -test('install --save with \'~\' save prefix should accept patch updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '~', - '--save', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.dependencies, - { 'underscore': '~1.3.1' }, - 'got expected save prefix and version of 1.3.1' - ) - })) -}) - -test('install --save-dev with \'~\' save prefix should accept patch updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '~', - '--save-dev', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS - ).then(([code]) => { - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.devDependencies, - { 'underscore': '~1.3.1' }, - 'got expected save prefix and version of 1.3.1' - ) - })) -}) - -function setup (t) { - t.test('destroy', t => { - t.plan(2) - rimraf(path.resolve(pkg, 'node_modules'), () => t.pass('node_modules')) - rimraf(path.resolve(pkg, 'pacakage-lock.json'), () => t.pass('lock file')) - }) - t.test('create', t => { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() - }) - - t.end() -} diff --git a/test/tap/install-scoped-already-installed.js b/test/tap/install-scoped-already-installed.js deleted file mode 100644 index d4655f4a9a748..0000000000000 --- a/test/tap/install-scoped-already-installed.js +++ /dev/null @@ -1,129 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var root = common.pkg -var pkg = path.join(root, 'package-with-scoped-paths') -var modules = path.join(pkg, 'node_modules') - -var EXEC_OPTS = { cwd: pkg } - -var scopedPaths = { - name: 'package-with-scoped-paths', - version: '0.0.0', - dependencies: { - 'package-local-dependency': 'file:../package-local-dependency', - '@scoped/package-scoped-dependency': 'file:../package-scoped-dependency' - } -} - -var localDependency = { - name: 'package-local-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -var scopedDependency = { - name: '@scoped/package-scoped-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(scopedPaths, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-scoped-dependency')) - fs.writeFileSync( - path.join(root, 'package-scoped-dependency', 'package.json'), - JSON.stringify(scopedDependency, null, 2) - ) - - t.end() -}) - -test('installing already installed local scoped package', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--parseable', - 'install' - ], - EXEC_OPTS, - function (err, code, stdout) { - var installed = parseNpmInstallOutput(stdout) - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') - t.ok( - existsSync(path.join(modules, '@scoped', 'package-scoped-dependency', 'package.json')), - 'package installed' - ) - t.ok( - contains(installed, 'node_modules/@scoped/package-scoped-dependency'), - 'installed @scoped/package-scoped-dependency' - ) - t.ok( - contains(installed, 'node_modules/package-local-dependency'), - 'installed package-local-dependency' - ) - - common.npm( - [ - '--loglevel', 'silent', - '--parseable', - 'install' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install raised no error code') - - installed = parseNpmInstallOutput(stdout) - - t.ok( - existsSync(path.join(modules, '@scoped', 'package-scoped-dependency', 'package.json')), - 'package installed' - ) - - t.notOk( - contains(installed, 'node_modules/@scoped/package-scoped-dependency'), - 'did not reinstall @scoped/package-scoped-dependency' - ) - t.notOk( - contains(installed, 'node_modules/package-local-dependency'), - 'did not reinstall package-local-dependency' - ) - t.end() - } - ) - } - ) -}) - -function contains (list, element) { - var matcher = new RegExp(element.replace(/\//g, '[\\\\/]') + '$') - for (var i = 0; i < list.length; ++i) { - if (matcher.test(list[i])) { - return true - } - } - return false -} - -function parseNpmInstallOutput (stdout) { - return stdout.trim().split(/\n\n|\s+/) -} diff --git a/test/tap/install-scoped-link.js b/test/tap/install-scoped-link.js deleted file mode 100644 index a0c9c61a9843c..0000000000000 --- a/test/tap/install-scoped-link.js +++ /dev/null @@ -1,73 +0,0 @@ -var exec = require('child_process').exec -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var escapeExecPath = require('../../lib/utils/escape-exec-path') - -var common = require('../common-tap.js') - -var resolve = require('path').resolve -var pkg = resolve(common.pkg, 'package') -var work = resolve(common.pkg, 'TEST') -var modules = path.join(work, 'node_modules') - -var EXEC_OPTS = { cwd: work } - -var world = '#!/usr/bin/env node\nconsole.log("hello blrbld")\n' - -var json = { - name: '@scoped/package', - version: '0.0.0', - bin: { - hello: './world.js' - } -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'world.js'), world) - - mkdirp.sync(modules) - process.chdir(work) - - t.end() -}) - -test('installing package with links', function (t) { - common.npm( - [ - '--loglevel', 'silent', - 'install', pkg - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') - - t.ok( - existsSync(path.join(modules, '@scoped', 'package', 'package.json')), - 'package installed' - ) - t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists') - - var hello = path.join(modules, '.bin', 'hello') - t.ok(existsSync(hello), 'binary link exists') - - exec(escapeExecPath(hello), function (err, stdout, stderr) { - t.ifError(err, 'command ran fine') - t.notOk(stderr, 'got no error output back') - t.equal(stdout, 'hello blrbld\n', 'output was as expected') - - t.end() - }) - } - ) -}) diff --git a/test/tap/install-scoped-with-bundled-dependency.js b/test/tap/install-scoped-with-bundled-dependency.js deleted file mode 100644 index db126eb6426c4..0000000000000 --- a/test/tap/install-scoped-with-bundled-dependency.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - }), - package: Dir({ - node_modules: Dir({ - 'bundled-dep': Dir({ - 'package.json': File({ - name: 'bundled-dep', - version: '0.0.0' - }) - }) - }), - 'package.json': File({ - name: '@scope/package', - version: '0.0.0', - dependencies: { - 'bundled-dep': '*' - }, - bundledDependencies: [ - 'bundled-dep' - ] - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('install dependencies of bundled dependencies', function (t) { - common.npm(['install', './package'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/test/tap/install-scoped-with-peer-dependency.js b/test/tap/install-scoped-with-peer-dependency.js deleted file mode 100644 index 016f5f0453b31..0000000000000 --- a/test/tap/install-scoped-with-peer-dependency.js +++ /dev/null @@ -1,40 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var local = path.join(pkg, 'package') - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: '@scope/package', - version: '0.0.0', - peerDependencies: { - underscore: '*' - } -} - -test('setup', function (t) { - mkdirp.sync(local) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(local, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('it should install peerDependencies in same tree level as the parent package', function (t) { - common.npm(['install', '--loglevel=warn', './package'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'install local package successful') - t.equal(code, 0, 'npm install exited with code') - t.match(stderr, /npm WARN @scope[/]package@0[.]0[.]0 requires a peer of underscore@[*] but none is installed[.] You must install peer dependencies yourself[.]\n/, - 'npm install warned about unresolved peer dep') - - t.end() - }) -}) diff --git a/test/tap/install-shrinkwrapped-git.js b/test/tap/install-shrinkwrapped-git.js deleted file mode 100644 index 3cdc2b91291d4..0000000000000 --- a/test/tap/install-shrinkwrapped-git.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var resolve = path.resolve -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var npm = require('../../lib/npm') -var common = require('../common-tap') -var chain = require('slide').chain - -var mockPath = common.pkg -var parentPath = resolve(mockPath, 'parent') -var parentNodeModulesPath = path.join(parentPath, 'node_modules') -var outdatedNodeModulesPath = resolve(mockPath, 'node-modules-backup') -var childPath = resolve(mockPath, 'child.git') - -var gitDaemon -var gitDaemonPID -var git - -var parentPackageJSON = JSON.stringify({ - name: 'parent', - version: '0.1.0' -}) - -var childPackageJSON = JSON.stringify({ - name: 'child', - version: '0.1.0' -}) - -test('setup', function (t) { - mkdirp.sync(parentPath) - fs.writeFileSync(resolve(parentPath, 'package.json'), parentPackageJSON) - process.chdir(parentPath) - - // Setup child - mkdirp.sync(childPath) - fs.writeFileSync(resolve(childPath, 'package.json'), childPackageJSON) - - // Setup npm and then git - npm.load({ - registry: common.registry, - loglevel: 'silent', - save: true // Always install packages with --save - }, function () { - // It's important to initialize git after npm because it uses config - initializeGit(function (err, result) { - t.ifError(err, 'git started up successfully') - - if (!err) { - gitDaemon = result[result.length - 2] - gitDaemonPID = result[result.length - 1] - } - - t.end() - }) - }) -}) - -test('shrinkwrapped git dependency got updated', function (t) { - t.comment('test for https://github.com/npm/npm/issues/12718') - - // Prepare the child package git repo with two commits - prepareChildAndGetRefs(function (err, refs) { - if (err) { throw err } - chain([ - // Install & shrinkwrap child package's first commit - [npm.commands.install, ['git://localhost:' + common.gitPort + '/child.git#' + refs[0]]], - // Backup node_modules with the first commit - [fs.rename, parentNodeModulesPath, outdatedNodeModulesPath], - // Install & shrinkwrap child package's latest commit - [npm.commands.install, ['git://localhost:' + common.gitPort + '/child.git#' + refs[1].substr(0, 8)]], - // Restore node_modules with the first commit - [rimraf, parentNodeModulesPath], - [fs.rename, outdatedNodeModulesPath, parentNodeModulesPath], - // Update node_modules - [npm.commands.install, []] - ], function () { - const pkglock = require(path.join(parentPath, 'package-lock.json')) - t.similar(pkglock, { - dependencies: { - child: { - version: `git://localhost:${common.gitPort}/child.git#${refs[1]}`, - from: `git://localhost:${common.gitPort}/child.git#${refs[1].substr(0, 8)}` - } - } - }, 'version and from fields are correct in git-based pkglock dep') - var childPackageJSON = require(path.join(parentNodeModulesPath, 'child', 'package.json')) - t.equal( - childPackageJSON._resolved, - 'git://localhost:' + common.gitPort + '/child.git#' + refs[1], - "Child package wasn't updated" - ) - t.end() - }) - }) -}) - -test('clean', function (t) { - gitDaemon.on('close', t.end) - process.kill(gitDaemonPID) -}) - -function prepareChildAndGetRefs (cb) { - var opts = { cwd: childPath, env: { PATH: process.env.PATH } } - chain([ - [fs.writeFile, path.join(childPath, 'README.md'), ''], - git.chainableExec(['add', 'README.md'], opts), - git.chainableExec(['commit', '-m', 'Add README'], opts), - git.chainableExec(['log', '--pretty=format:"%H"', '-2'], opts) - ], function (err) { - if (err) { return cb(err) } - var gitLogStdout = arguments[arguments.length - 1] - var refs = gitLogStdout[gitLogStdout.length - 1].split('\n').map(function (ref) { - return ref.match(/^"(.+)"$/)[1] - }).reverse() // Reverse refs order: last, first -> first, last - cb(null, refs) - }) -} - -function initializeGit (cb) { - git = require('../../lib/utils/git') - common.makeGitRepo({ - path: childPath, - commands: [startGitDaemon] - }, cb) -} - -function startGitDaemon (cb) { - var daemon = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=' + mockPath, // Path to the dir that contains child.git - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: parentPath, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - daemon.stderr.on('data', function findChild (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', findChild) - cb(null, [daemon, cpid[1]]) - } - }) -} diff --git a/test/tap/install-test-cli-with-broken-package-lock.js b/test/tap/install-test-cli-with-broken-package-lock.js deleted file mode 100644 index 3c1a56131bad4..0000000000000 --- a/test/tap/install-test-cli-with-broken-package-lock.js +++ /dev/null @@ -1,118 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-test-cli-with-broken-package-lock', - description: 'fixture', - version: '0.0.0', - dependencies: { - optimist: '0.6.0' - } -} - -var brokenLockfile = { - name: 'install-test-cli-with-broken-package-lock', - version: '0.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - optimist: { - version: '0.6.0', - resolved: 'https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz', - integrity: 'sha1-aUJIJvNAX3nxQub8PZrljU27kgA=', - requires: { - minimist: '~0.0.1', - wordwrap: '~0.0.2' - } - }, - wordwrap: { - version: '0.0.3', - resolved: 'https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz', - integrity: 'sha1-o9XabNXAvAAI03I0u68b7WMFkQc=' - } - } -} - -var expected = { - name: 'install-test-cli-with-broken-package-lock', - version: '0.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: { - version: '0.0.10', - resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz', - integrity: 'sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=' - }, - optimist: { - version: '0.6.0', - resolved: 'https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz', - integrity: 'sha1-aUJIJvNAX3nxQub8PZrljU27kgA=', - requires: { - minimist: '~0.0.1', - wordwrap: '~0.0.2' - } - }, - wordwrap: { - version: '0.0.3', - resolved: 'https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz', - integrity: 'sha1-o9XabNXAvAAI03I0u68b7WMFkQc=' - } - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('\'npm install-test\' should repair package-lock.json', function (t) { - common.npm(['install-test'], EXEC_OPTS, function (err, code, stderr, stdout) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - var lockfile = JSON.parse(fs.readFileSync(path.join(pkg, 'package-lock.json'))) - t.same( - lockfile, - expected, - 'package-lock.json should be repaired' - ) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'package-lock.json'), - JSON.stringify(brokenLockfile, null, 2) - ) - process.chdir(pkg) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/test/tap/install-test-cli-without-package-lock.js b/test/tap/install-test-cli-without-package-lock.js deleted file mode 100644 index 5cfc86f94c6e8..0000000000000 --- a/test/tap/install-test-cli-without-package-lock.js +++ /dev/null @@ -1,64 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-test-cli-without-package-lock', - description: 'fixture', - version: '0.0.0', - dependencies: { - dependency: 'file:./dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - // Disable package-lock - fs.writeFileSync( - path.join(pkg, '.npmrc'), - 'package-lock=false\n' - ) - t.end() -}) - -test('\'npm install-test\' should not generate package-lock.json.*', function (t) { - common.npm(['install-test'], EXEC_OPTS, function (err, code, stderr, stdout) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 1, 'npm install-test w/o test defined should return error') - var files = fs.readdirSync(pkg).filter(function (f) { - return f.indexOf('package-lock.json.') === 0 - }) - t.notOk( - files.length > 0, - 'package-lock.json.* should not be generated: ' + files - ) - t.end() - }) -}) diff --git a/test/tap/install-windows-newlines.js b/test/tap/install-windows-newlines.js deleted file mode 100644 index b56c7645ebf42..0000000000000 --- a/test/tap/install-windows-newlines.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } - -var json = { - name: 'install-windows-newlines', - description: 'fixture', - version: '0.0.0', - dependencies: { - 'cli-dependency': 'file:cli-dependency' - } -} - -var dependency = { - name: 'cli-dependency', - description: 'fixture', - version: '0.0.0', - bin: { - hashbang: './hashbang.js', - nohashbang: './nohashbang.js' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(path.join(pkg, 'cli-dependency')) - fs.writeFileSync( - path.join(pkg, 'cli-dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'cli-dependency', 'hashbang.js'), - '#!/usr/bin/env node\r\nconsole.log(\'Hello, world!\')\r\n' - ) - fs.writeFileSync( - path.join(pkg, 'cli-dependency', 'nohashbang.js'), - '\'use strict\'\r\nconsole.log(\'Goodbye, world!\')\r\n' - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - return common.npm(['install'], EXEC_OPTS).spread((code) => { - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - existsSync(path.resolve(pkg, 'node_modules/.bin/hashbang')), - 'hashbang installed' - ) - t.ok( - existsSync(path.resolve(pkg, 'node_modules/.bin/nohashbang')), - 'nohashbang installed' - ) - t.notOk( - fs.readFileSync( - path.resolve(pkg, 'node_modules/cli-dependency/hashbang.js'), - 'utf8' - ).includes('node\r\n'), - 'hashbang dependency cli newlines converted' - ) - t.ok( - fs.readFileSync( - path.resolve(pkg, 'node_modules/cli-dependency/nohashbang.js'), - 'utf8' - ).includes('\r\n'), - 'nohashbang dependency cli newlines retained' - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/install-with-dev-dep-duplicate.js b/test/tap/install-with-dev-dep-duplicate.js deleted file mode 100644 index 7d8586f47d4ad..0000000000000 --- a/test/tap/install-with-dev-dep-duplicate.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -var json = { - author: 'Anders Janmyr', - name: 'dev-dep-duplicate', - version: '0.0.0', - dependencies: { - underscore: '1.5.1' - }, - devDependencies: { - underscore: '1.3.1' - } -} - -var expected = { - name: 'dev-dep-duplicate', - version: '0.0.0', - dependencies: { - underscore: { - version: '1.5.1', - from: 'underscore@1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', - invalid: true - } - } -} - -test('prefers version from dependencies over devDependencies', function (t) { - t.plan(1) - - mr({ port: common.port }, function (er, s) { - setup(function (err) { - if (err) { - throw err - } - - npm.install('.', function (err) { - if (err) { - throw err - } - - npm.commands.ls([], true, function (err, _, results) { - if (err) { - throw err - } - - // these contain full paths so we can't do an exact match - // with them - delete results.problems - delete results.dependencies.underscore.problems - t.deepEqual(results, expected) - s.close() - t.end() - }) - }) - }) - }) -}) - -function setup (cb) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry - } - npm.load(opts, cb) -} diff --git a/test/tap/install-without-registry-config.js b/test/tap/install-without-registry-config.js deleted file mode 100644 index 852bd777ced5a..0000000000000 --- a/test/tap/install-without-registry-config.js +++ /dev/null @@ -1,35 +0,0 @@ -const t = require('tap') -const { pkg, npm } = require('../common-tap.js') -const { writeFileSync, statSync, readFileSync } = require('fs') -const mkdirp = require('mkdirp') -const proj = pkg + '/project' -const dep = pkg + '/dep' -mkdirp.sync(proj) -mkdirp.sync(dep) -writeFileSync(dep + '/package.json', JSON.stringify({ - name: 'dependency', - version: '1.2.3' -})) -writeFileSync(proj + '/package.json', JSON.stringify({ - name: 'project', - version: '4.2.0' -})) - -const runTest = t => npm([ - 'install', - '../dep', - '--no-registry' -], { cwd: proj }).then(([code, out, err]) => { - t.equal(code, 0) - t.match(out, /^\+ dependency@1\.2\.3\n.* 1 package in [0-9.]+m?s\n$/) - t.equal(err, '') - const data = readFileSync(proj + '/node_modules/dependency/package.json', 'utf8') - t.same(JSON.parse(data), { - name: 'dependency', - version: '1.2.3' - }, 'dep got installed') - t.ok(statSync(proj + '/package-lock.json').isFile(), 'package-lock exists') -}) - -t.test('install without a registry, no package lock', t => runTest(t)) -t.test('install without a registry, with package lock', t => runTest(t)) diff --git a/test/tap/invalid-cmd-exit-code.js b/test/tap/invalid-cmd-exit-code.js deleted file mode 100644 index b9a42f1be427b..0000000000000 --- a/test/tap/invalid-cmd-exit-code.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: process.cwd() } - -test('npm asdf should return exit code 1', function (t) { - common.npm(['asdf'], opts, function (err, code, stdout, stderr) { - if (err) throw err - t.ok(code, 'exit code should not be zero') - if (stdout.trim()) t.comment(stdout.trim()) - if (stderr.trim()) t.comment(stderr.trim()) - t.end() - }) -}) - -test('npm help should return exit code 0', function (t) { - common.npm(['help'], opts, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'exit code should be 0') - if (stdout.trim()) t.comment(stdout.trim()) - if (stderr.trim()) t.comment(stderr.trim()) - t.end() - }) -}) - -test('npm help fadf should return exit code 0', function (t) { - common.npm(['help', 'fadf'], opts, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'exit code should be 0') - if (stdout.trim()) t.comment(stdout.trim()) - if (stderr.trim()) t.comment(stderr.trim()) - t.end() - }) -}) diff --git a/test/tap/invalid-dep-version-filtering.js b/test/tap/invalid-dep-version-filtering.js deleted file mode 100644 index f2f175b24ef5e..0000000000000 --- a/test/tap/invalid-dep-version-filtering.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var common = require('../common-tap') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var testdir = common.pkg -var cachedir = common.cache - -var fixture = new Tacks(Dir({ - cache: Dir(), - node_modules: Dir(), - tarballs: Dir({ - 'pkgA.tgz': File(Buffer.from( - '1f8b0800000000000003edcfcf0a0221100670cf3ec5e0396cfcb703bd8d' + - '842cb5e4ca5a5da2776f5da153b78408fc5d3e6684e133f9e3e4c7b04f35' + - 'e539cf9135868883b5509206b725ea3a6f9c01a634598d8e48134365d0e0' + - 'fadebac827b77cf5cb5ae5db3bf52bf0ce3ff1e00022fa4b100710691abd' + - 'd895cd3d2cf934c7b25412250afee4bfaeda755dd735f40211b5bced0008' + - '0000', - 'hex' - )), - 'pkgB1.tgz': File(Buffer.from( - '1f8b0800000000000003edcfc10a0221140550d77ec5c375d8d3d111fa1b' + - '0b196ac891b16913fd7be308adda2544f0cee6e25d3caec99f463f847daa' + - '292f798aac3144ec8d8192aeb75ba2aeef8ded8029ed8c46eb1c1a86aa43' + - 'bd76d87ac8274bbef9799df2ed9dfa1578e79f78700011fd35880388340e' + - '47b12bcd3dccf93cc5522a8912057ff25f4f258410d2d00b247d22080008' + - '0000', - 'hex' - )) - }) -})) - -var pkgAtgz = path.join(testdir, 'tarballs', 'pkgA.tgz') -var pkgB1tgz = path.join(testdir, 'tarballs', 'pkgB1.tgz') - -var server - -var pkgA = { - name: 'pkg-a', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'pkg-a', - version: '1.0.0', - dependencies: { - 'pkg-b': '1.0.0' - }, - dist: { - shasum: 'dc5471ce0439f0f47749bb01473cad4570cc7dc5', - tarball: common.registry + '/pkg-a/-/pkg-a-1.0.0.tgz' - } - } - } -} - -var pkgB = { - name: 'pkg-b', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'pkg-b', - version: '1.0.0', - dist: { - shasum: '53031aa2cf774c0e841c6fdbbe54c13825cd5640', - tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0.tgz' - } - }, - '1.0.0rc1': { - name: 'pkg-b', - version: '1.0.0rc1', - dist: { - shasum: '7f4b1bf680e3a31113d77619b4dc7c3b4c7dc15c', - tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0-rc1.tgz' - } - } - } -} - -function setup () { - cleanup() - fixture.create(testdir) -} -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - mr({ port: common.port, throwOnUnmatched: true }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('invalid versions should be ignored', function (t) { - server.get('/pkg-a').reply(200, pkgA) - server.get('/pkg-b').reply(200, pkgB) - server.get('/pkg-a/-/pkg-a-1.0.0.tgz').replyWithFile(200, pkgAtgz) - server.get('/pkg-b/-/pkg-b-1.0.0.tgz').replyWithFile(200, pkgB1tgz) - - common.npm( - [ - 'install', - '--cache', cachedir, - '--registry', common.registry, - '--fetch-retries=0', - 'pkg-a@1.0.0' - ], - {cwd: testdir}, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'install succeded') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - server.done() - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) diff --git a/test/tap/is-fs-access-available.js b/test/tap/is-fs-access-available.js deleted file mode 100644 index 2e5c7edc9810a..0000000000000 --- a/test/tap/is-fs-access-available.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict' -var fs = require('fs') -var test = require('tap').test -var requireInject = require('require-inject') -var semver = require('semver') - -var globalProcess = global.process - -function loadIsFsAccessAvailable (newProcess, newFs) { - global.process = Object.assign({}, global.process, newProcess) - var mocks = {fs: Object.assign({}, fs, newFs)} - var isFsAccessAvailable = requireInject('../../lib/install/is-fs-access-available.js', mocks) - global.process = globalProcess - return isFsAccessAvailable -} - -var fsWithAccess = {access: function () {}} -var fsWithoutAccess = {access: undefined} - -if (semver.lt(process.version, '0.12.0')) { - test('skipping', function (t) { - t.pass('skipping all tests on < 0.12.0 due to process not being injectable') - t.end() - }) -} else { - test('mac + !fs.access', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'darwin'}, fsWithoutAccess) - t.is(isFsAccessAvailable, false, 'not available') - t.end() - }) - - test('mac + fs.access', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'darwin'}, fsWithAccess) - t.is(isFsAccessAvailable, true, 'available') - t.end() - }) - - test('windows + !fs.access', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32'}, fsWithoutAccess) - t.is(isFsAccessAvailable, false, 'not available') - t.end() - }) - - test('windows + fs.access + node 0.12.7', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32', version: '0.12.7'}, fsWithAccess) - t.is(isFsAccessAvailable, false, 'not available') - t.end() - }) - - test('windows + fs.access + node 2.4.0', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32', version: '2.4.0'}, fsWithAccess) - t.is(isFsAccessAvailable, true, 'available') - t.end() - }) -} diff --git a/test/tap/is-registry.js b/test/tap/is-registry.js deleted file mode 100644 index 832eb537d3f9c..0000000000000 --- a/test/tap/is-registry.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' -const test = require('tap').test -const npa = require('npm-package-arg') -const isRegistry = require('../../lib/utils/is-registry.js') - -test('current npa', (t) => { - t.is(Boolean(isRegistry(npa('foo@1.0.0'))), true, 'version') - t.is(Boolean(isRegistry(npa('foo@^1.0.0'))), true, 'range') - t.is(Boolean(isRegistry(npa('foo@test'))), true, 'tag') - t.is(Boolean(isRegistry(npa('foo@git://foo.bar/test.git'))), false, 'git') - t.is(Boolean(isRegistry(npa('foo@foo/bar'))), false, 'github') - t.is(Boolean(isRegistry(npa('foo@http://example.com/example.tgz'))), false, 'remote') - t.is(Boolean(isRegistry(npa('foo@file:example.tgz'))), false, 'file') - t.is(Boolean(isRegistry(npa('foo@file:example/'))), false, 'dir') - t.done() -}) - -test('legacy spec data', (t) => { - t.is(Boolean(isRegistry({type: 'version'})), true, 'version') - t.is(Boolean(isRegistry({type: 'range'})), true, 'range') - t.is(Boolean(isRegistry({type: 'tag'})), true, 'tag') - t.is(Boolean(isRegistry({type: 'git'})), false, 'git') - t.is(Boolean(isRegistry({type: 'file'})), false, 'file') - t.is(Boolean(isRegistry({type: 'directory'})), false, 'directory') - t.is(Boolean(isRegistry({type: 'remote'})), false, 'remote') - t.done() -}) diff --git a/test/tap/it.js b/test/tap/it.js deleted file mode 100644 index bb59bc6f5e904..0000000000000 --- a/test/tap/it.js +++ /dev/null @@ -1,65 +0,0 @@ -var join = require('path').join -var statSync = require('graceful-fs').statSync -var writeFileSync = require('graceful-fs').writeFileSync - -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg -var installed = join(pkg, 'node_modules', 'underscore', 'package.json') - -var json = { - name: 'npm-it-test', - dependencies: { - underscore: '1.5.1' - }, - scripts: { - test: 'echo hax' - } -} - -test('run up the mock registry', function (t) { - mr({ port: common.port }, function (err, s) { - if (err) throw err - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -const check = args => t => - common.npm(args.concat('--registry=' + common.registry), { cwd: pkg }) - .then(([code, stdout, stderr]) => { - t.equal(code, 0, 'command ran without error') - t.ok(statSync(installed), 'package was installed') - t.equal(require(installed).version, '1.5.1', 'underscore got installed as expected') - t.match(stdout, /hax/, 'found expected test output') - t.notOk(stderr, 'stderr should be empty') - }) - -test('npm install-test', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('check', check(['install-test', '--no-shrinkwrap'])) -}) - -test('npm it (the form most people will use)', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('check', check(['it'])) -}) - -function setup (t) { - t.test('destroy', t => { - t.plan(2) - rimraf(join(pkg, 'node_modules'), () => t.pass('node_modules')) - rimraf(join(pkg, 'package-lock.json'), () => t.pass('lock file')) - }) - t.test('create', t => { - writeFileSync(join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - t.end() - }) - t.end() -} diff --git a/test/tap/legacy-ignore-nested-nm.js b/test/tap/legacy-ignore-nested-nm.js deleted file mode 100644 index 6a57b72b60488..0000000000000 --- a/test/tap/legacy-ignore-nested-nm.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-ignore-nested-nm') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-ignore-nested-nm') -var fs = require('graceful-fs') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fileData = 'I WILL NOT BE IGNORED!\n' -var fixture = new Tacks( - Dir({ - lib: Dir({ - node_modules: Dir({ - foo: File(fileData) - }) - }), - 'package.json': File({ - name: 'npm-test-ignore-nested-nm', - version: '1.2.5' - }) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('ignore-nested-nm', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - var foopath = path.resolve(installedpath, 'lib/node_modules/foo') - fs.readFile(foopath, function (err, data) { - t.ifError(err, 'file read successfully') - t.equal(data.toString(), fileData) - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - }) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/tap/legacy-missing-bindir.js b/test/tap/legacy-missing-bindir.js deleted file mode 100644 index 398ef0e7acc51..0000000000000 --- a/test/tap/legacy-missing-bindir.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var common = require('../common-tap.js') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-missing-bindir') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-missing-bindir') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-missing-bindir', - version: '0.0.0', - directories: { - bin: './not-found' - } - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -function installedExists (filename) { - try { - fs.statSync(path.resolve(installedpath, filename)) - return true - } catch (ex) { - console.log(ex) - return false - } -} - -test('missing-bindir', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.is(installedExists('README'), true, 'README') - t.is(installedExists('package.json'), true, 'package.json') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/tap/legacy-no-auth-leak.js b/test/tap/legacy-no-auth-leak.js deleted file mode 100644 index ce1adaeca756a..0000000000000 --- a/test/tap/legacy-no-auth-leak.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var basepath = common.pkg -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-no-auth-leak', - version: '0.0.0', - scripts: { - test: 'node test.js' - } - }), - '.npmrc': File( - 'auth=abc', - 'authCrypt=def', - 'password=xyz', - '//registry.npmjs.org/:_authToken=nopenope' - ), - 'test.js': File( - 'var authTokenKeys = Object.keys(process.env)\n' + - ' .filter(function (key) { return /authToken/.test(key) })\n' + - 'console.log(JSON.stringify({\n' + - ' password: process.env.npm_config__password || null,\n' + - ' auth: process.env.npm_config__auth || null,\n' + - ' authCrypt: process.env.npm_config__authCrypt || null ,\n' + - ' authToken: authTokenKeys && process.env[authTokenKeys[0]] || null\n' + - '}))' - ) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('no-auth-leak', function (t) { - common.npm(['test'], {cwd: basepath}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'test ran ok') - if (stderr) console.log(stderr) - var matchResult = /^[^{]*(\{(?:.|\n)*\})[^}]*$/ - t.like(stdout, matchResult, 'got results with a JSON chunk in them') - var stripped = stdout.replace(matchResult, '$1') - var result = JSON.parse(stripped) - t.is(result.password, null, 'password') - t.is(result.auth, null, 'auth') - t.is(result.authCrypt, null, 'authCrypt') - t.is(result.authToken, null, 'authToken') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(basepath) -} - -function cleanup () { - fixture.remove(basepath) -} diff --git a/test/tap/legacy-platform-all.js b/test/tap/legacy-platform-all.js deleted file mode 100644 index 01c7be7ec1c86..0000000000000 --- a/test/tap/legacy-platform-all.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-platform-all') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-platform-all', - version: '9.9.9-9', - homepage: 'http://www.zombo.com/', - os: [ - 'darwin', - 'linux', - 'win32', - 'solaris', - 'haiku', - 'sunos', - 'freebsd', - 'openbsd', - 'netbsd' - ], - cpu: [ - 'arm', - 'arm64', - 'mips', - 'ia32', - 'x64', - 'sparc' - ] - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('platform-all', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(stderr, '', 'no error messages') - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/tap/legacy-platform.js b/test/tap/legacy-platform.js deleted file mode 100644 index 619d2e4330c59..0000000000000 --- a/test/tap/legacy-platform.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-platform') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-platform', - version: '9.9.9-9', - homepage: 'http://www.youtube.com/watch?v=dQw4w9WgXcQ', - os: [ - '!this_is_not_a_real_os', - '!neither_is_this' - ], - cpu: [ - '!this_is_not_a_real_cpu', - '!this_isnt_either' - ] - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('platform', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/tap/legacy-private.js b/test/tap/legacy-private.js deleted file mode 100644 index 44a1094cd0cc6..0000000000000 --- a/test/tap/legacy-private.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-private') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-private', - version: '9.9.9-9', - homepage: 'http://www.youtube.com/watch?v=1MLry6Cn_D4', - private: 'true' - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('private', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - console.log(stdout) - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/tap/legacy-test-package.js b/test/tap/legacy-test-package.js deleted file mode 100644 index 5fd591b098728..0000000000000 --- a/test/tap/legacy-test-package.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-test-package') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-test-package') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-test-package', - author: 'Testy McMock', - version: '1.2.3-99-b', - description: "This is a test package used for debugging. It has some random data and that's all." - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('test-package', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) - } - - function testCheckAndRemove (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'npm test w/o test should return error') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/test/tap/lifecycle-INIT_CWD.js b/test/tap/lifecycle-INIT_CWD.js deleted file mode 100644 index fbedd3849c708..0000000000000 --- a/test/tap/lifecycle-INIT_CWD.js +++ /dev/null @@ -1,36 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var subdir = path.resolve(pkg, 'subdir') - -var json = { - name: 'init-cwd', - version: '1.0.0', - scripts: { - initcwd: process.platform === 'win32' ? 'echo %INIT_CWD%' : 'echo "$INIT_CWD"' - } -} - -test('setup', function (t) { - mkdirp.sync(subdir) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('make sure the env.INIT_CWD is correct', t => - common.npm(['run-script', 'initcwd'], { cwd: subdir }) - .then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exit code') - stdout = stdout.trim().split(/\r|\n/).pop() - var actual = stdout - t.equal(actual, subdir) - })) diff --git a/test/tap/lifecycle-order.js b/test/tap/lifecycle-order.js deleted file mode 100644 index ac6c07925c52b..0000000000000 --- a/test/tap/lifecycle-order.js +++ /dev/null @@ -1,33 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -var json = { - name: 'lifecycle-order', - version: '1.0.0', - scripts: { - preinstall: 'node -e "var fs = require(\'fs\'); fs.openSync(\'preinstall-step\', \'w+\'); if (fs.existsSync(\'node_modules\')) { throw \'node_modules exists on preinstall\' }"', - install: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'preinstall-step\')) { fs.openSync(\'install-step\', \'w+\') } else { throw \'Out of order\' }"', - postinstall: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'install-step\')) { fs.openSync(\'postinstall-step\', \'w+\') } else { throw \'Out of order\' }"' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('lifecycle scripts execute in the proper order', t => - common.npm('install', {cwd: pkg}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error') - - // All three files should exist - t.ok(fs.existsSync(path.join(pkg, 'preinstall-step')), 'preinstall ok') - t.ok(fs.existsSync(path.join(pkg, 'install-step')), 'install ok') - t.ok(fs.existsSync(path.join(pkg, 'postinstall-step')), 'postinstall ok') - })) diff --git a/test/tap/lifecycle-path.js b/test/tap/lifecycle-path.js deleted file mode 100644 index 70fb839197191..0000000000000 --- a/test/tap/lifecycle-path.js +++ /dev/null @@ -1,210 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var which = require('which') -var test = require('tap').test - -var common = require('../common-tap.js') -var isWindows = require('../../lib/utils/is-windows.js') - -var pkg = common.pkg - -var PATH -if (isWindows) { - // On Windows the 'comspec' environment variable is used, - // so cmd.exe does not need to be on the path. - PATH = path.dirname(process.env.ComSpec) -} else { - // On non-Windows, without the path to the shell, nothing usually works. - PATH = '/bin:/usr/bin' -} - -var systemNode = which.sync('node', { nothrow: true, path: PATH }) -// the path to the system wide node (null if none) - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify({}, null, 2) - ) - t.end() -}) - -test('make sure the path is correct, without directory of current node', function (t) { - checkPath({ - withDirOfCurrentNode: false, - prependNodePathSetting: false - }, t) -}) - -test('make sure the path is correct, with directory of current node', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: false - }, t) -}) - -test('make sure the path is correct, with directory of current node but ignored node path', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: true - }, t) -}) - -test('make sure the path is correct, without directory of current node and automatic detection', function (t) { - checkPath({ - withDirOfCurrentNode: false, - prependNodePathSetting: 'auto' - }, t) -}) - -test('make sure the path is correct, with directory of current node and automatic detection', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: 'auto' - }, t) -}) - -test('make sure the path is correct, without directory of current node and warn-only detection', function (t) { - checkPath({ - withDirOfCurrentNode: false, - prependNodePathSetting: 'warn-only' - }, t) -}) - -test('make sure the path is correct, with directory of current node and warn-only detection', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: 'warn-only' - }, t) -}) - -test('make sure there is no warning with a symlinked node and warn-only detection', { - skip: isWindows && 'symlinks are weird on windows' -}, function (t) { - checkPath({ - withDirOfCurrentNode: false, - extraNode: true, - prependNodePathSetting: 'warn-only', - symlinkNodeInsteadOfCopying: true - }, t) -}) - -test('make sure the path is correct, with directory of current node and warn-only detection and an extra node in path', function (t) { - checkPath({ - withDirOfCurrentNode: false, - extraNode: true, - prependNodePathSetting: 'warn-only' - }, t) -}) - -function checkPath (testconfig, t) { - var withDirOfCurrentNode = testconfig.withDirOfCurrentNode - var prependNodePathSetting = testconfig.prependNodePathSetting - var symlinkedNode = testconfig.symlinkNodeInsteadOfCopying - var extraNode = testconfig.extraNode - - var newPATH = PATH - var currentNodeExecPath = process.execPath - if (withDirOfCurrentNode) { - var newNodeExeDir = path.join(pkg, 'node-bin', 'my_bundled_node') - mkdirp.sync(newNodeExeDir) - currentNodeExecPath = path.join(newNodeExeDir, path.basename(process.execPath)) - rimraf.sync(currentNodeExecPath) - - if (!symlinkedNode) { - fs.writeFileSync(currentNodeExecPath, fs.readFileSync(process.execPath)) - fs.chmodSync(currentNodeExecPath, '755') - } else { - fs.symlinkSync(process.execPath, currentNodeExecPath) - } - } - - if (!withDirOfCurrentNode) { - // Ensure that current node interpreter will be found in the PATH, - // so the PATH won't be prepended with its parent directory - newPATH = [path.dirname(process.execPath), PATH].join(process.platform === 'win32' ? ';' : ':') - } - - common.npm(['run-script', 'env'], { - cwd: pkg, - nodeExecPath: currentNodeExecPath, - env: { - PATH: newPATH, - npm_config_scripts_prepend_node_path: prependNodePathSetting - }, - stdio: [ 0, 'pipe', 'pipe' ] - }, function (er, code, stdout, stderr) { - if (er) throw er - if (!stderr.match(/^(npm WARN.*)?\n*$/)) console.error(stderr) - t.equal(code, 0, 'exit code') - var lineMatch = function (line) { - return /^PATH=/i.test(line) - } - // extract just the path value - stdout = stdout.split(/\r?\n/) - var observedPath = stdout.filter(lineMatch).pop().replace(/^PATH=/, '') - var pathSplit = process.platform === 'win32' ? ';' : ':' - var root = path.resolve(__dirname, '../..') - var actual = observedPath.split(pathSplit).map(function (p) { - if (p.indexOf(pkg) === 0) { - p = '{{PKG}}' + p.substr(pkg.length) - } - if (p.indexOf(root) === 0) { - p = '{{ROOT}}' + p.substr(root.length) - } - return p.replace(/\\/g, '/') - }) - // spawn-wrap adds itself to the path when coverage is enabled - actual = actual.filter(function (p) { - return !p.match(/\.node-spawn-wrap/) - }) - - // get the ones we tacked on, then the system-specific requirements - var expectedPaths = ['{{ROOT}}/node_modules/npm-lifecycle/node-gyp-bin', - '{{PKG}}/node_modules/.bin'] - - // Check that the behaviour matches the configuration that was actually - // used by the child process, as the coverage tooling may set the - // --scripts-prepend-node-path option on its own. - var realPrependNodePathSetting = stdout.filter(function (line) { - return line.match(/npm_config_scripts_prepend_node_path=(true|auto)/) - }).length > 0 - - if (prependNodePathSetting === 'warn-only') { - if (symlinkedNode) { - t.equal(stderr, '', 'does not spit out a warning') - } else if (withDirOfCurrentNode) { - t.match(stderr, /npm WARN lifecycle/, 'spit out a warning') - t.match(stderr, /npm is using .*node-bin.my_bundled_node(.exe)?/, 'mention the path of the binary npm itself is using.') - if (extraNode) { - var regex = new RegExp( - 'The node binary used for scripts is.*' + - process.execPath.replace(/[/\\]/g, '.')) - t.match(stderr, regex, 'reports the current binary vs conflicting') - } else if (systemNode !== null) { - var regexSystemNode = new RegExp( - 'The node binary used for scripts is.*' + - systemNode.replace(/[/\\]/g, '.') - ) - t.match(stderr, regexSystemNode, 'reports the system binary vs conflicting') - } else { - t.match(stderr, /there is no node binary in the current PATH/, 'informs user that there is no node binary in PATH') - } - } else { - t.same(stderr, '') - } - } - - if (withDirOfCurrentNode && realPrependNodePathSetting) { - expectedPaths.push('{{PKG}}/node-bin/my_bundled_node') - } - var expect = expectedPaths.concat(newPATH.split(pathSplit)).map(function (p) { - return p.replace(/\\/g, '/') - }) - t.same(actual, expect) - t.end() - }) -} diff --git a/test/tap/link.js b/test/tap/link.js deleted file mode 100644 index adb24b44f3d72..0000000000000 --- a/test/tap/link.js +++ /dev/null @@ -1,193 +0,0 @@ -var mkdirp = require('mkdirp') -var path = require('path') -var test = require('tap').test -var lstatSync = require('fs').lstatSync -var writeFileSync = require('fs').writeFileSync - -var common = require('../common-tap.js') - -var link = path.join(common.pkg, 'link') -var linkScoped = path.join(common.pkg, 'link-scoped') -var linkInstall = path.join(common.pkg, 'link-install') -var linkInside = path.join(linkInstall, 'node_modules', 'inside') -var linkRoot = path.join(common.pkg, 'link-root') - -var config = 'prefix = ' + linkRoot -var configPath = path.join(link, '_npmrc') - -var OPTS = { - env: { - 'npm_config_userconfig': configPath - } -} - -var readJSON = { - name: 'foo', - version: '1.0.0', - description: '', - main: 'index.js', - author: '', - license: 'ISC' -} - -var readScopedJSON = { - name: '@scope/foo', - version: '1.0.0', - description: '', - main: 'index.js', - author: '', - license: 'ISC' -} - -var installJSON = { - name: 'bar', - version: '1.0.0', - description: '', - main: 'index.js', - author: '', - license: 'ISC' -} - -var insideInstallJSON = { - name: 'inside', - version: '1.0.0', - description: '', - main: 'index.js', - author: '', - license: 'ISC' -} - -test('setup', function (t) { - mkdirp.sync(linkRoot) - mkdirp.sync(link) - writeFileSync( - path.join(link, 'package.json'), - JSON.stringify(readJSON, null, 2) - ) - mkdirp.sync(linkScoped) - writeFileSync( - path.join(linkScoped, 'package.json'), - JSON.stringify(readScopedJSON, null, 2) - ) - mkdirp.sync(linkInstall) - writeFileSync( - path.join(linkInstall, 'package.json'), - JSON.stringify(installJSON, null, 2) - ) - mkdirp.sync(linkInside) - writeFileSync( - path.join(linkInside, 'package.json'), - JSON.stringify(insideInstallJSON, null, 2) - ) - writeFileSync(configPath, config) - common.npm(['ls', '-g', '--depth=0'], OPTS, function (err, c, out) { - t.ifError(err) - t.equal(c, 0, 'set up ok') - t.notOk(out.match(/UNMET DEPENDENCY foo@/), "foo isn't in global") - t.end() - }) -}) - -test('create global link', function (t) { - process.chdir(link) - common.npm(['link'], OPTS, function (err, c, out) { - t.ifError(err, 'link has no error') - common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /foo@1.0.0/, 'creates global link ok') - t.end() - }) - }) -}) - -test('create global inside link', function (t) { - process.chdir(linkInside) - common.npm(['link'], OPTS, function (err, c, out) { - t.ifError(err, 'link has no error') - common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /inside@1.0.0/, 'creates global inside link ok') - t.end() - }) - }) -}) - -test('create scoped global link', function (t) { - process.chdir(linkScoped) - common.npm(['link'], OPTS, function (err, c, out) { - t.ifError(err, 'link has no error') - common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /@scope[/]foo@1.0.0/, 'creates global link ok') - t.end() - }) - }) -}) - -test('link-install the package', function (t) { - process.chdir(linkInstall) - common.npm(['link', 'foo'], OPTS, function (err) { - t.ifError(err, 'link-install has no error') - common.npm(['ls'], OPTS, function (err, c, out) { - t.ifError(err) - t.equal(c, 1) - t.has(out, /foo@1.0.0/, 'link-install ok') - t.end() - }) - }) -}) - -test('link-inside-install fails', function (t) { - process.chdir(linkInstall) - t.notOk(lstatSync(linkInside).isSymbolicLink(), 'directory for linked package is not a symlink to begin with') - common.npm(['link', 'inside'], OPTS, function (err, code) { - t.ifError(err, 'npm removed the linked package without error') - t.notEqual(code, 0, 'link operation failed') - t.notOk(lstatSync(linkInside).isSymbolicLink(), 'directory for linked package has not turned into a symlink') - t.end() - }) -}) - -test('link-install the scoped package', function (t) { - process.chdir(linkInstall) - common.npm(['link', linkScoped], OPTS, function (err) { - t.ifError(err, 'link-install has no error') - common.npm(['ls'], OPTS, function (err, c, out) { - t.ifError(err) - t.equal(c, 1) - t.has(out, /@scope[/]foo@1.0.0/, 'link-install ok') - t.end() - }) - }) -}) - -test('ls the linked packages', function (t) { - process.chdir(linkInstall) - common.npm(['ls', '--link'], OPTS, function (err, c, out) { - t.ifError(err, 'ls --link did not have an error') - t.equal(c, 1) - t.has(out, /@scope\/foo@1\.0\.0 ->/, 'output contains scoped link') - t.has(out, /foo@1\.0\.0 ->/, 'output contains link') - t.doesNotHave(out, /inside@1\.0\.0/, 'output does not contain unlinked dependency') - t.end() - }) -}) - -test('cleanup', function (t) { - process.chdir(common.pkg) - common.npm(['rm', 'foo'], OPTS, function (err, code) { - t.ifError(err, 'npm removed the linked package without error') - t.equal(code, 0, 'cleanup foo in local ok') - common.npm(['rm', '-g', 'foo'], OPTS, function (err, code) { - t.ifError(err, 'npm removed the global package without error') - t.equal(code, 0, 'cleanup foo in global ok') - t.end() - }) - }) -}) diff --git a/test/tap/local-args-relative-to-cwd.js b/test/tap/local-args-relative-to-cwd.js deleted file mode 100644 index de95516e2893e..0000000000000 --- a/test/tap/local-args-relative-to-cwd.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var testdir = common.pkg - -var fixture = new Tacks( - Dir({ - example: Dir({ - }), - mod1: Dir({ - 'package.json': File({ - name: 'mod1', - version: '1.0.0' - }) - }), - node_modules: Dir({ - }) - }) -) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -function exists (file) { - try { - fs.statSync(file) - return true - } catch (ex) { - return false - } -} - -test('local-args-relative-to-cwd', function (t) { - var instdir = path.join(testdir, 'example') - var config = ['--loglevel=error'] - common.npm(config.concat(['install', '../mod1']), {cwd: instdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'install ran ok') - t.ok(exists(path.join(testdir, 'node_modules', 'mod1')), 'mod1 installed') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/lockfile-http-deps.js b/test/tap/lockfile-http-deps.js deleted file mode 100644 index b5eaa10760a43..0000000000000 --- a/test/tap/lockfile-http-deps.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict' -const fs = require('fs') -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package-lock.json': File({ - name: 'http-locks', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: { - version: common.registry + '/minimist/-/minimist-0.0.5.tgz', - integrity: 'sha1-16oye87PUY+RBqxrjwA/o7zqhWY=' - } - } - }), - 'package.json': File({ - name: 'http-locks', - version: '1.0.0', - dependencies: { - minimist: common.registry + '/minimist/-/minimist-0.0.5.tgz' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('http deps in lock files', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - const minPackage = JSON.parse(fs.readFileSync(testdir + '/node_modules/minimist/package.json')) - t.is(minPackage.version, '0.0.5', 'package version was maintained') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/logout-scoped.js b/test/tap/logout-scoped.js deleted file mode 100644 index 114cc09da7382..0000000000000 --- a/test/tap/logout-scoped.js +++ /dev/null @@ -1,69 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.join(pkg, '_npmrc') -var opts = { cwd: pkg } - -var contents = `foo=boo -@bar:registry=http://localhost:${common.port} -//localhost:${common.port}/:_authToken=glarb -` - -function mocks (server) { - server.delete('/-/user/token/glarb') - .reply(200, {}) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('npm logout', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm( - [ - 'logout', - '--registry', common.registry, - '--scope', '@bar', - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.ifError(err, 'no error output') - t.notOk(code, 'exited OK') - - var config = fs.readFileSync(outfile, 'utf8') - t.equal(config.trim(), 'foo=boo', 'creds gone') - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync(outfile, contents) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/logout.js b/test/tap/logout.js deleted file mode 100644 index 9218b4bf6f1ca..0000000000000 --- a/test/tap/logout.js +++ /dev/null @@ -1,67 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.join(pkg, '_npmrc') -var opts = { cwd: pkg } - -var contents = `foo=boo -//localhost:${common.port}/:_authToken=glarb -` - -function mocks (server) { - server.delete('/-/user/token/glarb') - .reply(200, {}) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('npm logout', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm( - [ - 'logout', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.ifError(err, 'no error output') - t.notOk(code, 'exited OK') - - var config = fs.readFileSync(outfile, 'utf8') - t.notMatch(config, /localhost/, 'creds gone') - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync(outfile, contents) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/meta-test-flaky-root-ownership-test.js b/test/tap/meta-test-flaky-root-ownership-test.js deleted file mode 100644 index 24dd9e3d95dda..0000000000000 --- a/test/tap/meta-test-flaky-root-ownership-test.js +++ /dev/null @@ -1,20 +0,0 @@ -const t = require('tap') -if (!process.getuid || process.getuid() !== 0 || !process.env.SUDO_UID || !process.env.SUDO_GID) { - t.pass('this test only runs in sudo mode') - t.end() - process.exit(0) -} - -const common = require('../common-tap.js') -const fs = require('fs') -const mkdirp = require('mkdirp') -mkdirp.sync(common.cache + '/root/owned') -fs.writeFileSync(common.cache + '/root/owned/file.txt', 'should be chowned') -const chown = require('chownr') - -// this will fire after t.teardown() but before process.on('exit') -setTimeout(() => { - chown.sync(common.cache, +process.env.SUDO_UID, +process.env.SUDO_GID) -}, 100) - -t.pass('this is fine') diff --git a/test/tap/nerf-dart.js b/test/tap/nerf-dart.js deleted file mode 100644 index d205e527cc8bb..0000000000000 --- a/test/tap/nerf-dart.js +++ /dev/null @@ -1,32 +0,0 @@ -// taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js -// originally written by Charlie Robbins, https://github.com/indexzero -var test = require('tap').test -var toNerfDart = require('../../lib/config/nerf-dart.js') - -function validNerfDart (uri, valid) { - if (!valid) valid = '//registry.npmjs.org/' - test(uri, function (t) { - t.equal(toNerfDart(uri), valid) - t.end() - }) -} - -validNerfDart('http://registry.npmjs.org') -validNerfDart('http://registry.npmjs.org/some-package') -validNerfDart('http://registry.npmjs.org/some-package?write=true') -validNerfDart('http://user:pass@registry.npmjs.org/some-package?write=true') -validNerfDart('http://registry.npmjs.org/#random-hash') -validNerfDart('http://registry.npmjs.org/some-package#random-hash') - -validNerfDart( - 'http://relative.couchapp.npm/design/-/rewrite/', - '//relative.couchapp.npm/design/-/rewrite/' -) -validNerfDart( - 'http://relative.couchapp.npm:8080/design/-/rewrite/', - '//relative.couchapp.npm:8080/design/-/rewrite/' -) -validNerfDart( - 'http://relative.couchapp.npm:8080/design/-/rewrite/some-package', - '//relative.couchapp.npm:8080/design/-/rewrite/' -) diff --git a/test/tap/nested-extraneous.js b/test/tap/nested-extraneous.js deleted file mode 100644 index 1764a41c75279..0000000000000 --- a/test/tap/nested-extraneous.js +++ /dev/null @@ -1,53 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var mkdirp = require('mkdirp') -var fs = require('fs') -var rimraf = require('rimraf') -var path = require('path') - -var pkg = common.pkg -var pj = { - name: 'nested-extraneous', - version: '1.2.3' -} - -var dep = path.resolve(pkg, 'node_modules', 'dep') -var deppj = { - name: 'nested-extraneous-dep', - version: '1.2.3', - dependencies: { - 'nested-extra-depdep': '*' - } -} - -var depdep = path.resolve(dep, 'node_modules', 'depdep') -var depdeppj = { - name: 'nested-extra-depdep', - version: '1.2.3' -} - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(depdep) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pj)) - fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(deppj)) - fs.writeFileSync(path.resolve(depdep, 'package.json'), JSON.stringify(depdeppj)) - t.end() -}) - -test('test', function (t) { - common.npm(['ls'], { - cwd: pkg - }, function (er, code, sto, ste) { - if (er) throw er - t.notEqual(code, 0) - t.notSimilar(ste, /depdep/) - t.notSimilar(sto, /depdep/) - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/no-global-warns.js b/test/tap/no-global-warns.js deleted file mode 100644 index 27963ea50f95e..0000000000000 --- a/test/tap/no-global-warns.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mkdirp = require('mkdirp') -var writeFileSync = require('fs').writeFileSync -var common = require('../common-tap.js') - -var base = common.pkg -var mockGlobal = path.join(base, 'global') -var toInstall = path.join(base, 'to-install') - -var config = 'prefix = ' + base -var configPath = path.join(base, '_npmrc') - -// use a clean environment for this test -// otherwise local dev-time npm settings can throw it off -var OPTS = { - env: Object.keys(process.env).filter(function (k) { - return !/^npm_config_/i.test(k) - }).reduce(function (set, k) { - set[k] = process.env[k] - return set - }, {}) -} - -var installJSON = { - name: 'to-install', - version: '1.0.0', - description: '', - main: 'index.js', - author: '', - license: 'ISC' -} - -test('setup', function (t) { - mkdirp.sync(mockGlobal) - mkdirp.sync(toInstall) - writeFileSync( - path.join(toInstall, 'package.json'), - JSON.stringify(installJSON, null, 2) - ) - writeFileSync(configPath, config) - t.end() -}) - -test('no-global-warns', function (t) { - common.npm( - [ - 'install', '-g', - '--userconfig=' + configPath, - toInstall - ], - OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'installed w/o error') - const preWarn = 'npm WARN You are using a pre-release version ' + - 'of node and things may not work as expected' - stderr = stderr.trim().replace(preWarn, '') - t.is(stderr, '', 'no warnings printed to stderr') - t.end() - }) -}) diff --git a/test/tap/no-scan-full-global-dir.js b/test/tap/no-scan-full-global-dir.js deleted file mode 100644 index 7501b881c98cc..0000000000000 --- a/test/tap/no-scan-full-global-dir.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var requireInject = require('require-inject') -var npm = require('../../lib/npm.js') - -// XXX update this when rpt's realpath.js is extracted out -var rptRealpath = require.resolve('read-package-tree/realpath.js') - -const common = require('../common-tap.js') -const pkg = common.pkg -var packages = { - test: {package: {name: 'test'}, path: pkg, children: ['abc', 'def', 'ghi', 'jkl']}, - abc: {package: {name: 'abc'}, path: path.join(pkg, 'node_modules', 'abc')}, - def: {package: {name: 'def'}, path: path.join(pkg, 'node_modules', 'def')}, - ghi: {package: {name: 'ghi'}, path: path.join(pkg, 'node_modules', 'ghi')}, - jkl: {package: {name: 'jkl'}, path: path.join(pkg, 'node_modules', 'jkl')} -} -var dirs = {} -var files = {} -Object.keys(packages).forEach(function (name) { - dirs[path.join(packages[name].path, 'node_modules')] = packages[name].children || [] - files[path.join(packages[name].path, 'package.json')] = packages[name].package -}) - -var mockReaddir = function (name, cb) { - if (dirs[name]) return cb(null, dirs[name]) - var er = new Error('No such mock: ' + name) - er.code = 'ENOENT' - cb(er) -} -var mockReadPackageJson = function (file, cb) { - if (files[file]) return cb(null, files[file]) - var er = new Error('No such mock: ' + file) - er.code = 'ENOENT' - cb(er) -} -var mockFs = Object.create(fs) -mockFs.realpath = function (dir, cb) { - return cb(null, dir) -} - -const mockRptRealpath = path => Promise.resolve(path) - -test('setup', function (t) { - npm.load(function () { - t.pass('npm loaded') - t.end() - }) -}) - -test('installer', function (t) { - t.plan(1) - var installer = requireInject('../../lib/install.js', { - 'fs': mockFs, - 'readdir-scoped-modules': mockReaddir, - 'read-package-json': mockReadPackageJson, - 'mkdirp': function (path, cb) { cb() }, - [rptRealpath]: mockRptRealpath - }) - - var Installer = installer.Installer - class TestInstaller extends Installer { - constructor (where, dryrun, args) { - super(where, dryrun, args) - this.global = true - } - loadArgMetadata (cb) { - this.args = this.args.map(function (arg) { return {name: arg} }) - cb() - } - } - - var inst = new TestInstaller(pkg, false, ['def', 'abc']) - inst.loadCurrentTree(function () { - var kids = inst.currentTree.children.map(function (child) { return child.package.name }) - t.isDeeply(kids, ['abc', 'def']) - t.end() - }) -}) - -test('uninstaller', function (t) { - t.plan(1) - var uninstaller = requireInject('../../lib/uninstall.js', { - 'fs': mockFs, - 'readdir-scoped-modules': mockReaddir, - 'read-package-json': mockReadPackageJson, - 'mkdirp': function (path, cb) { cb() }, - [rptRealpath]: mockRptRealpath - }) - - var Uninstaller = uninstaller.Uninstaller - class TestUninstaller extends Uninstaller { - constructor (where, dryrun, args) { - super(where, dryrun, args) - this.global = true - } - } - - var uninst = new TestUninstaller(pkg, false, ['ghi', 'jkl']) - uninst.loadCurrentTree(function () { - var kids = uninst.currentTree.children.map(function (child) { return child.package.name }) - t.isDeeply(kids, ['ghi', 'jkl']) - t.end() - }) -}) diff --git a/test/tap/noargs-install-config-save.js b/test/tap/noargs-install-config-save.js deleted file mode 100644 index cb1af408abb5c..0000000000000 --- a/test/tap/noargs-install-config-save.js +++ /dev/null @@ -1,76 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') - -var mr = require('npm-registry-mock') - -var pkg = common.pkg - -function writePackageJson () { - rimraf.sync(pkg) - mkdirp.sync(pkg) - mkdirp.sync(pkg + '/cache') - - fs.writeFileSync(pkg + '/package.json', JSON.stringify({ - 'author': 'Rocko Artischocko', - 'name': 'noargs', - 'version': '0.0.0', - 'devDependencies': { - 'underscore': '1.3.1' - } - }), 'utf8') -} - -var env = { - 'npm_config_save': true, - 'npm_config_registry': common.registry, - 'npm_config_cache': pkg + '/cache', - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH -} -var OPTS = { - cwd: pkg, - env: env -} - -test('does not update the package.json with empty arguments', function (t) { - writePackageJson() - t.plan(2) - - mr({ port: common.port }, function (er, s) { - common.npm('install', OPTS, function (er, code, stdout, stderr) { - if (er) throw er - t.is(code, 0) - if (code !== 0) { - console.error('#', stdout) - console.error('#', stderr) - } - var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) - s.close() - t.equal(text.indexOf('"dependencies'), -1, 'dependencies do not exist in file') - }) - }) -}) - -test('updates the package.json (adds dependencies) with an argument', function (t) { - writePackageJson() - t.plan(2) - - mr({ port: common.port }, function (er, s) { - common.npm(['install', 'underscore', '-P'], OPTS, function (er, code, stdout, stderr) { - if (er) throw er - t.is(code, 0) - s.close() - var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.notEqual(text.indexOf('"dependencies'), -1, 'dependencies exist in file') - }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/node-modules-path-munge.js b/test/tap/node-modules-path-munge.js deleted file mode 100644 index fb116806c8cbc..0000000000000 --- a/test/tap/node-modules-path-munge.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common-tap.js') -var t = require('tap') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var path = require('path') -var dir = path.join(common.pkg, 'my_node_modules') -var script = process.platform === 'win32' ? 'echo %PATH%' : 'echo $PATH' - -t.test('setup', function (t) { - rimraf.sync(dir) - mkdirp.sync(dir) - fs.writeFileSync(dir + '/package.json', JSON.stringify({ - name: 'my_node_modules', - version: '1.2.3', - scripts: { - test: script - } - })) - t.end() -}) - -t.test('verify PATH is munged right', function (t) { - common.npm(['test'], { cwd: dir }, function (err, code, stdout, stderr) { - if (err) { - throw err - } - t.equal(code, 0, 'exit ok') - t.notOk(stderr, 'should have no stderr') - var expect = path.resolve(dir, 'node_modules', '.bin').toLowerCase() - t.contains(stdout.toLowerCase(), expect) - t.end() - }) -}) - -t.test('cleanup', function (t) { - rimraf.sync(dir) - t.end() -}) diff --git a/test/tap/normalize-package-explode.js b/test/tap/normalize-package-explode.js deleted file mode 100644 index 57faec8b60250..0000000000000 --- a/test/tap/normalize-package-explode.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' -var test = require('tap').test -var log = require('npmlog') -var npm = require('../../lib/npm.js') - -var idealTree = { - package: { - name: 'a b c', - version: '3.what' - }, - children: [], - warnings: [] -} - -test('setup', function (t) { - npm.load({}, t.end) -}) - -test('validate-tree', function (t) { - log.disableProgress() - var validateTree = require('../../lib/install/validate-tree.js') - validateTree(idealTree, log.newGroup('validate'), function (er) { - t.pass("we didn't crash") - t.end() - }) -}) diff --git a/test/tap/npm-api-not-loaded-error.js b/test/tap/npm-api-not-loaded-error.js deleted file mode 100644 index 8bf263503874e..0000000000000 --- a/test/tap/npm-api-not-loaded-error.js +++ /dev/null @@ -1,48 +0,0 @@ -var test = require('tap').test -const common = require('../common-tap.js') -var npm = require('../..') -var path = require('path') -var rimraf = require('rimraf') -var npmrc = path.join(common.pkg, 'npmrc') -var fs = require('fs') - -test('setup', function (t) { - fs.writeFileSync(npmrc, 'foo = bar\n', 'ascii') - t.end() -}) - -test('calling set/get on config pre-load should throw', function (t) { - var threw = true - try { - npm.config.get('foo') - threw = false - } catch (er) { - t.equal(er.message, 'npm.load() required') - } finally { - t.ok(threw, 'get before load should throw') - } - - threw = true - try { - npm.config.set('foo', 'bar') - threw = false - } catch (er) { - t.equal(er.message, 'npm.load() required') - } finally { - t.ok(threw, 'set before load should throw') - } - - npm.load({ userconfig: npmrc }, function (er) { - if (er) throw er - - t.equal(npm.config.get('foo'), 'bar') - npm.config.set('foo', 'baz') - t.equal(npm.config.get('foo'), 'baz') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(npmrc) - t.end() -}) diff --git a/test/tap/onload.js b/test/tap/onload.js deleted file mode 100644 index 4750fa6f88c2a..0000000000000 --- a/test/tap/onload.js +++ /dev/null @@ -1,39 +0,0 @@ -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var opts = { cwd: common.pkg } -var binDir = '../../node_modules/.bin' -var fixture = path.resolve(__dirname, binDir) -var onload = path.resolve(__dirname, '../fixtures/onload.js') - -test('setup', function (t) { - rimraf.sync(path.join(common.pkg, 'node_modules')) - t.end() -}) - -test('npm bin with valid onload script', function (t) { - var args = ['--onload', onload, 'bin'] - common.npm(args, opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bin ran without issue') - t.equal(stderr.trim(), 'called onload') - t.equal(code, 0, 'exit ok') - t.equal(stdout, fixture + '\n') - t.end() - }) -}) - -test('npm bin with invalid onload script', function (t) { - var onloadScript = onload + 'jsfd' - var args = ['--onload', onloadScript, '--loglevel=warn', 'bin'] - common.npm(args, opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bin ran without issue') - t.match(stderr, /npm WARN onload-script failed to require onload script/) - t.match(stderr, /MODULE_NOT_FOUND/) - t.notEqual(stderr.indexOf(onloadScript), -1) - t.equal(code, 0, 'exit ok') - var res = path.resolve(stdout) - t.equal(res, fixture + '\n') - t.end() - }) -}) diff --git a/test/tap/optional-metadep-rollback-collision.js b/test/tap/optional-metadep-rollback-collision.js deleted file mode 100644 index b62d63d7f760f..0000000000000 --- a/test/tap/optional-metadep-rollback-collision.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var deps = path.resolve(pkg, 'deps') -var opdep = path.resolve(pkg, 'node_modules', 'opdep') -var cache = common.cache -var createServer = require('http').createServer -var mr = require('npm-registry-mock') -var serverPort = 27991 - -var json = { - name: 'optional-metadep-rollback-collision', - version: '1.0.0', - description: 'let\'s just see about that race condition', - optionalDependencies: { - opdep: 'file:./deps/opdep' - } -} - -var d1 = { - name: 'd1', - version: '1.0.0', - description: 'I FAIL CONSTANTLY', - scripts: { - preinstall: 'sleep 1' - }, - dependencies: { - foo: 'http://localhost:' + serverPort + '/' - } -} - -var d2 = { - name: 'd2', - version: '1.0.0', - description: 'how do you *really* know you exist?', - scripts: { - postinstall: 'node blart.js' - }, - dependencies: { - 'request': '^0.9.0', - mkdirp: '^0.3.5', - wordwrap: '^0.0.2' - } -} - -var opdep_json = { - name: 'opdep', - version: '1.0.0', - description: 'To explode, of course!', - main: 'index.js', - dependencies: { - d1: 'file:../d1', - d2: 'file:../d2' - } -} - -var blart = ` -var rando = require('crypto').randomBytes -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var writeFile = require('graceful-fs').writeFile - -var BASEDIR = resolve(__dirname, 'arena') - -var keepItGoingLouder = {} -var writers = 0 -var errors = 0 - -function gensym () { return rando(16).toString('hex') } - -function writeAlmostForever (filename) { - if (!keepItGoingLouder[filename]) { - writers-- - if (writers < 1) return done() - } else { - writeFile(filename, keepItGoingLouder[filename], function (err) { - if (err) errors++ - - writeAlmostForever(filename) - }) - } -} - -function done () { - rimraf(BASEDIR, function () { - if (errors > 0) console.log('not ok - %d errors', errors) - else console.log('ok') - }) -} - -mkdirp(BASEDIR, function go () { - for (var i = 0; i < 16; i++) { - var filename = resolve(BASEDIR, gensym() + '.txt') - - keepItGoingLouder[filename] = '' - for (var j = 0; j < 512; j++) keepItGoingLouder[filename] += filename - - writers++ - writeAlmostForever(filename) - } - - setTimeout(function viktor () { - // kill all the writers - keepItGoingLouder = {} - }, 3 * 1000) -}) -` - -test('setup', function (t) { - const badServer = createServer(function (req, res) { - setTimeout(function () { - res.writeHead(404) - res.end() - }, 1000) - }).listen(serverPort, () => t.parent.teardown(() => badServer.close())) - - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mkdirp.sync(path.join(deps, 'd1')) - fs.writeFileSync( - path.join(deps, 'd1', 'package.json'), - JSON.stringify(d1, null, 2) - ) - - mkdirp.sync(path.join(deps, 'd2')) - fs.writeFileSync( - path.join(deps, 'd2', 'package.json'), - JSON.stringify(d2, null, 2) - ) - fs.writeFileSync(path.join(deps, 'd2', 'blart.js'), blart) - - mkdirp.sync(path.join(deps, 'opdep')) - fs.writeFileSync( - path.join(deps, 'opdep', 'package.json'), - JSON.stringify(opdep_json, null, 2) - ) - mr({ port: common.port }, function (er, server) { - t.parent.teardown(() => server.close()) - t.end() - }) -}) - -test('go go test racer', t => common.npm( - [ - '--prefix', pkg, - '--fetch-retries', '0', - '--loglevel', 'error', - '--no-progress', - '--registry', common.registry, - '--parseable', - '--cache', cache, - 'install' - ], - { - cwd: pkg, - env: { - PATH: process.env.PATH, - Path: process.env.Path - }, - stdio: 'pipe' - } -).spread((code, stdout, stderr) => { - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install exited with code 0') - t.notOk(/not ok/.test(stdout), 'should not contain the string \'not ok\'') -})) - -test('verify results', function (t) { - t.throws(function () { - fs.statSync(opdep) - }) - t.end() -}) diff --git a/test/tap/org.js b/test/tap/org.js deleted file mode 100644 index 7315cf0b6faf1..0000000000000 --- a/test/tap/org.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict' - -var test = require('tap').test -var common = require('../common-tap.js') - -var mr = common.fakeRegistry.compat - -var server - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -const names = ['add', 'set'] -const roles = ['developer', 'admin', 'owner'] - -names.forEach(function (name) { - test('org ' + name + ' [orgname] [username]: defaults to developer', function (t) { - const membershipData = { - org: { - name: 'myorg', - size: 1 - }, - user: 'myuser', - role: 'developer' - } - server.put('/-/org/myorg/user', JSON.stringify({ - user: 'myuser' - })).reply(200, membershipData) - common.npm([ - 'org', 'add', 'myorg', 'myuser', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - - t.same(JSON.parse(stdout), membershipData) - t.end() - }) - }) - - roles.forEach(function (role) { - test('org ' + name + ' [orgname] [username]: accepts role ' + role, function (t) { - const membershipData = { - org: { - name: 'myorg', - size: 1 - }, - user: 'myuser', - role: role - } - server.put('/-/org/myorg/user', JSON.stringify({ - user: 'myuser' - })).reply(200, membershipData) - common.npm([ - 'org', name, 'myorg', 'myuser', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - - t.same(JSON.parse(stdout), membershipData) - t.end() - }) - }) - }) -}) - -test('org rm [orgname] [username]', function (t) { - const membershipData = { - otheruser: 'admin' - } - server.delete('/-/org/myorg/user', JSON.stringify({ - user: 'myuser' - })).reply(204, {}) - server.get('/-/org/myorg/user') - .reply(200, membershipData) - common.npm([ - 'org', 'rm', 'myorg', 'myuser', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.deepEqual(JSON.parse(stdout), { - user: 'myuser', - org: 'myorg', - deleted: true, - userCount: 1 - }, 'got useful info') - t.end() - }) -}) - -test('org ls [orgname]', function (t) { - const membershipData = { - username: 'admin', - username2: 'foo' - } - server.get('/-/org/myorg/user') - .reply(200, membershipData) - common.npm([ - 'org', 'ls', 'myorg', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), membershipData, 'outputs members') - t.end() - }) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server.done() - server.close() - t.end() -}) diff --git a/test/tap/outdated-bad-read-tree.js b/test/tap/outdated-bad-read-tree.js deleted file mode 100644 index eb4bac36ef083..0000000000000 --- a/test/tap/outdated-bad-read-tree.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var npm = require('../../lib/npm.js') - -test('setup', function (t) { - npm.load({progress: false}, t.end) -}) - -test('outdated', function (t) { - var rptError = new Error('read-package-tree') - var outdated = requireInject('../../lib/outdated.js', { - 'read-package-tree': function (dir, cb) { - cb(rptError) - } - }) - outdated([], function (err) { - t.is(err, rptError) - t.end() - }) -}) diff --git a/test/tap/outdated-color.js b/test/tap/outdated-color.js deleted file mode 100644 index 11c967650f3b0..0000000000000 --- a/test/tap/outdated-color.js +++ /dev/null @@ -1,75 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -function hasControlCodes (str) { - return str.length !== ansiTrim(str).length -} - -function ansiTrim (str) { - var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' + - '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g') - return str.replace(r, '') -} - -var json = { - name: 'outdated-color', - description: 'fixture', - version: '0.0.1', - dependencies: { - underscore: '1.3.1' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -// note hard to automate tests for color = true -// as npm kills the color config when it detects -// it's not running in a tty -test('does not use ansi styling', function (t) { - t.plan(4) - mr({ port: common.port }, function (er, s) { // create mock registry. - common.npm( - [ - '--registry', common.registry, - 'outdated', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err) - t.is(code, 1, 'npm outdated exited with code 1') - t.ok(stdout, stdout.length) - t.ok(!hasControlCodes(stdout)) - s.close() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/outdated-depth.js b/test/tap/outdated-depth.js deleted file mode 100644 index 368d32230abf0..0000000000000 --- a/test/tap/outdated-depth.js +++ /dev/null @@ -1,76 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap') - -var pkg = common.pkg - -var json = { - name: 'outdated-depth', - version: '1.2.3', - dependencies: { - underscore: '1.3.1', - 'npm-test-peer-deps': '0.0.0' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - t.end() -}) - -test('outdated depth zero', function (t) { - var expected = [ - pkg, - 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', - '1.3.1', - null - ] - - mr({ port: common.port }, function (er, s) { - npm.load( - { - depth: 0, - loglevel: 'silent', - registry: common.registry - }, - function () { - npm.install('.', function (er) { - if (er) throw new Error(er) - npm.outdated(function (err, d) { - if (err) { - throw err - } - t.is(process.exitCode, 1, 'exit code set to 1') - process.exitCode = 0 - t.deepEqual(d[0], expected) - t.equal(d.length, 1) - npm.config.set('depth', 1) - npm.outdated(function (err, d) { - t.equal(d.length, 2) - if (err) { - throw err - } - t.is(process.exitCode, 1, 'exit code set to 1') - process.exitCode = 0 - s.close() - t.end() - }) - }) - }) - } - ) - }) -}) diff --git a/test/tap/outdated-git.js b/test/tap/outdated-git.js deleted file mode 100644 index 15db1a30c7c74..0000000000000 --- a/test/tap/outdated-git.js +++ /dev/null @@ -1,61 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') -var rimraf = require('rimraf') - -var common = require('../common-tap.js') -var npm = require('../../') - -// config -var pkg = common.pkg -var cache = common.cache -var json = { - name: 'outdated-git', - author: 'Rocko Artischocko', - description: 'fixture', - version: '0.0.1', - main: 'index.js', - dependencies: { - 'foo-github': 'robertkowalski/foo', - 'foo-private': 'git://github.com/robertkowalski/foo-private.git', - 'foo-private-credentials': 'git://user:pass@github.com/robertkowalski/foo-private.git' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('discovers new versions in outdated', function (t) { - process.chdir(pkg) - t.plan(7) - npm.load({cache: cache, registry: common.registry, loglevel: 'silent'}, function () { - npm.commands.outdated([], function (er, d) { - t.ifError(er, 'npm outdated completed successfully') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.equal(d[0][3], 'git') - t.equal(d[0][4], 'git') - t.equal(d[0][5], 'github:robertkowalski/foo') - t.equal(d[1][5], 'git://github.com/robertkowalski/foo-private.git') - t.equal(d[2][5], 'git://user:pass@github.com/robertkowalski/foo-private.git') - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(cache) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2), 'utf8') -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/outdated-json.js b/test/tap/outdated-json.js deleted file mode 100644 index 77db52cc72521..0000000000000 --- a/test/tap/outdated-json.js +++ /dev/null @@ -1,123 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'outdated-json', - author: 'Rockbert', - version: '0.0.0', - dependencies: { - underscore: '~1.3.1' - }, - devDependencies: { - request: '~0.9.0' - } -} - -var expected = { - underscore: { - current: '1.3.3', - wanted: '1.3.3', - latest: '1.5.1', - location: 'node_modules' + path.sep + 'underscore' - }, - request: { - current: '0.9.5', - wanted: '0.9.5', - latest: '2.27.0', - location: 'node_modules' + path.sep + 'request' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'mock registry should never fail to start') - server = s - common.npm( - [ - '--registry', common.registry, - '--silent', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install ran without raising error code') - - t.end() - } - ) - }) -}) - -test('it should log json data', function (t) { - common.npm( - [ - '--registry', common.registry, - '--silent', - '--json', - 'outdated' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err, 'npm outdated ran without error') - t.is(code, 1, 'npm outdated exited with code 1') - var out - t.doesNotThrow(function () { - out = JSON.parse(stdout) - }, 'output correctly parsed as JSON') - t.deepEqual(out, expected) - - t.end() - } - ) -}) - -test('it should log json data even when the list is empty', function (t) { - common.npm( - [ - 'rm', - 'request', - 'underscore' - ], - EXEC_OPTS, - function (er, code, stdout) { - t.ifError(er, 'run without error') - t.is(code, 0, 'successful exit status') - common.npm( - [ - '--registry', common.registry, - '--silent', - '--json', - 'outdated' - ], - EXEC_OPTS, - function (er, code, stdout) { - t.ifError(er, 'run without error') - t.is(code, 0, 'successful exit status') - t.same(JSON.parse(stdout), {}, 'got an empty object printed') - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/test/tap/outdated-latest.js b/test/tap/outdated-latest.js deleted file mode 100644 index 073b71da91cc6..0000000000000 --- a/test/tap/outdated-latest.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -function exampleManifest (version) { - return { - name: 'example', - version: version - } -} - -const examplePackument = { - 'name': 'example', - 'dist-tags': { - 'latest': '1.2.4', - 'beta': '1.2.6' - }, - 'versions': { - '1.2.0': exampleManifest('1.2.0'), - '1.2.1': exampleManifest('1.2.1'), - '1.2.2': exampleManifest('1.2.2'), - '1.2.3': exampleManifest('1.2.3'), - '1.2.4': exampleManifest('1.2.4'), - '1.2.5': exampleManifest('1.2.5'), - '1.2.6': exampleManifest('1.2.6') - } -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - example: Dir({ - 'package.json': File({ - name: 'example', - version: '1.2.3' - }) - }) - }), - 'package.json': File({ - name: 'outdated-latest', - version: '1.0.0', - dependencies: { - example: '^1.2.0' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -let server - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.get('/example').reply(200, examplePackument) - t.done() - }) -}) - -test('example', function (t) { - return common.npm(['outdated', '--json'], conf).spread((code, stdout, stderr) => { - t.is(code, 1, 'files ARE outdated!') - const result = JSON.parse(stdout.trim()) - t.comment(stderr.trim()) - // your assertions here - t.like(result, {example: {current: '1.2.3', wanted: '1.2.4', latest: '1.2.4'}}, 'got latest, not beta') - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/outdated-long.js b/test/tap/outdated-long.js deleted file mode 100644 index 8cd2ceadb96fc..0000000000000 --- a/test/tap/outdated-long.js +++ /dev/null @@ -1,93 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -// config -var pkg = common.pkg -var cache = common.cache - -var json = { - name: 'outdated-long', - description: 'fixture', - version: '0.0.1', - dependencies: { - underscore: '1.3.1' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('it should not throw', function (t) { - var originalLog = console.log - - var output = [] - var expOut = [ - 'add\tunderscore\t1.3.1\tnode_modules/underscore\t\t', - path.resolve(pkg, 'node_modules', 'underscore') + - ':underscore@1.3.1' + - ':underscore@1.3.1' + - ':underscore@1.5.1' + - ':dependencies' - ] - - var expData = [ - [ - pkg, - 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', - '1.3.1', - 'dependencies' - ] - ] - - console.log = function () { - output.push.apply(output, arguments) - } - mr({ port: common.port }, function (er, s) { - npm.load( - { - cache: cache, - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - npm.config.set('long', true) - // since it's possible for the homepage of a package to change, after the - // install we read the value from the package.json directly to specify our - // expected output. - expOut[1] = expOut[1] + ':' + JSON.parse(fs.readFileSync(path.resolve(pkg, 'node_modules', 'underscore', 'package.json'))).homepage - npm.outdated(function (er, d) { - t.ifError(err, 'npm outdated ran without error') - t.is(process.exitCode, 1, 'exit code set to 1') - process.exitCode = 0 - console.log = originalLog - output[0] = output[0].replace(/\\/g, '/') - t.same(output, expOut) - t.same(d, expData) - - s.close() - t.end() - }) - }) - } - ) - }) -}) diff --git a/test/tap/outdated-remote.js b/test/tap/outdated-remote.js deleted file mode 100644 index e6cbd0e8acdde..0000000000000 --- a/test/tap/outdated-remote.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - 'foo-http': Dir({ - 'package.json': File({ - name: 'foo-http', - version: '1.0.0' - }) - }), - 'foo-https': Dir({ - 'package.json': File({ - name: 'foo-https', - version: '1.0.0' - }) - }) - }), - 'package.json': File({ - name: 'outdated-remote', - version: '1.0.0', - dependencies: { - 'foo-http': 'http://example.com/foo.tar.gz', - 'foo-https': 'https://example.com/foo.tar.gz' - } - }) - }) -})) - -function setup () { - fixture.create(basedir) -} - -test('setup', t => { - setup() - return common.fakeRegistry.listen() -}) - -test('discovers new versions in outdated', t => { - return common.npm(['outdated', '--json'], conf).then(([code, stdout, stderr]) => { - t.is(code, 1, 'npm outdated completed successfully') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - const data = JSON.parse(stdout) - t.same(data['foo-http'], { - current: '1.0.0', - wanted: 'remote', - latest: 'remote', - location: '' - }) - t.same(data['foo-https'], { - current: '1.0.0', - wanted: 'remote', - latest: 'remote', - location: '' - }) - }) -}) - -test('cleanup', t => { - common.fakeRegistry.close() - t.done() -}) diff --git a/test/tap/outdated-symlink.js b/test/tap/outdated-symlink.js deleted file mode 100644 index 5ec089758a3ca..0000000000000 --- a/test/tap/outdated-symlink.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Symlink = Tacks.Symlink -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: path.join(testdir, 'main'), - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - broken: Dir({ - 'package.json': File({ - name: 'broken', - version: '1.0.0' - }) - }), - main: Dir({ - node_modules: Dir({ - unbroken: Symlink('/testdir/unbroken') - }), - 'package-lock.json': File({ - name: 'main', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - broken: { - version: 'file:../broken' - }, - unbroken: { - version: 'file:../unbroken' - } - } - }), - 'package.json': File({ - name: 'main', - version: '1.0.0', - dependencies: { - broken: 'file:../broken', - unbroken: 'file:../unbroken' - } - }) - }), - unbroken: Dir({ - 'package.json': File({ - name: 'unbroken', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('outdated sees broken links', function (t) { - common.npm(['outdated', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'command ran not ok') - t.comment(stderr.trim()) - t.comment(stdout.trim()) - t.same(JSON.parse(stdout), { - broken: { - wanted: 'linked', - latest: 'linked', - location: '' - } - }) - t.done() - }) -}) - -test('outdated with long output sees broken links', function (t) { - common.npm(['outdated', '--long', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'command ran not ok') - t.comment(stderr.trim()) - t.comment(stdout.trim()) - t.same(JSON.parse(stdout), { - broken: { - wanted: 'linked', - latest: 'linked', - type: 'dependencies', - location: '' - } - }) - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/outdated.js b/test/tap/outdated.js deleted file mode 100644 index e64b7b0f813c8..0000000000000 --- a/test/tap/outdated.js +++ /dev/null @@ -1,123 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -// config -var pkg = common.pkg -var cache = common.cache -var originalLog - -var json = { - name: 'outdated', - description: 'fixture', - version: '0.0.1', - dependencies: { - underscore: '1.3.1', - async: '0.2.9', - checker: '0.5.1' - } -} - -test('setup', function (t) { - originalLog = console.log - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('it should not throw', function (t) { - var output = [] - var expOut = [ - path.resolve(pkg, 'node_modules', 'async') + - ':async@0.2.9' + - ':async@0.2.9' + - ':async@0.2.10' + - '\n' + - path.resolve(pkg, 'node_modules', 'checker') + - ':checker@0.5.1' + - ':checker@0.5.1' + - ':checker@0.5.2' + - '\n' + - path.resolve(pkg, 'node_modules', 'underscore') + - ':underscore@1.3.1' + - ':underscore@1.3.1' + - ':underscore@1.5.1' - ] - - var expData = [ - [ - pkg, - 'async', - '0.2.9', - '0.2.9', - '0.2.10', - '0.2.9', - null - ], - [ - pkg, - 'checker', - '0.5.1', - '0.5.1', - '0.5.2', - '0.5.1', - null - ], - [ - pkg, - 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', - '1.3.1', - null - ] - ] - - console.log = function () {} - mr({ port: common.port }, function (er, s) { - npm.load( - { - cache: cache, - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - console.log = function () { - output.push.apply(output, arguments) - } - npm.outdated(function (er, d) { - t.ifError(err, 'outdated completed without error') - t.equals(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - output = output.map(function (x) { return x.replace(/\r/g, '') }) - console.log = originalLog - - t.same(output, expOut) - t.same(d, expData) - - s.close() - t.end() - }) - }) - } - ) - }) -}) - -test('cleanup', function (t) { - console.log = originalLog - t.end() -}) diff --git a/test/tap/override-bundled.js b/test/tap/override-bundled.js deleted file mode 100644 index 7f87c0999fe06..0000000000000 --- a/test/tap/override-bundled.js +++ /dev/null @@ -1,191 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var test = require('tap').test -var fs = require('fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var common = require('../common-tap.js') - -var testname = path.basename(__filename, '.js') -var testdir = common.pkg -var testmod = path.resolve(testdir, 'top-test') -var testtgz = testmod + '-1.0.0.tgz' - -var bundleupdatesrc = path.resolve(testmod, 'bundle-update') -var bundleupdatetgz = bundleupdatesrc + '-1.0.0.tgz' -var bundleupdateNEW = path.resolve(bundleupdatesrc, 'NEW') -var bundleupdateNEWpostinstall = path.resolve(testdir, 'node_modules', 'bundle-update', 'NEW') -var bundleupdatebad = path.resolve(testmod, 'node_modules', 'bundle-update') - -var bundlekeepsrc = path.resolve(testmod, 'bundle-keep') -var bundlekeeptgz = bundlekeepsrc + '-1.0.0.tgz' -var bundlekeep = path.resolve(testmod, 'node_modules', 'bundle-keep') -var bundlekeepOLD = path.resolve(bundlekeep, 'OLD') -var bundlekeepOLDpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-keep', 'OLD') - -var bundledeepsrc = path.resolve(testmod, 'bundle-deep') -var bundledeeptgz = bundledeepsrc + '-1.0.0.tgz' -var bundledeep = path.resolve(testmod, 'node_modules', 'bundle-deep') -var bundledeepOLD = path.resolve(bundledeep, 'OLD') -var bundledeepOLDpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-deep', 'OLD') - -var bundledeepupdatesrc = path.resolve(testmod, 'bundle-deep-update') -var bundledeepupdatetgz = bundledeepupdatesrc + '-1.0.0.tgz' -var bundledeepupdate = path.resolve(bundledeep, 'node_modules', 'bundle-deep-update') -var bundledeepupdateNEW = path.resolve(bundledeepupdatesrc, 'NEW') -var bundledeepupdateNEWpostinstall = path.resolve(testdir, 'node_modules', 'bundle-deep-update', 'NEW') - -var testjson = { - dependencies: {'top-test': 'file:' + testtgz} -} - -var testmodjson = { - name: 'top-test', - version: '1.0.0', - dependencies: { - 'bundle-update': bundleupdatetgz, - 'bundle-keep': bundlekeeptgz, - 'bundle-deep': bundledeeptgz - }, - bundledDependencies: ['bundle-update', 'bundle-keep', 'bundle-deep'], - files: ['OLD', 'NEW'] -} -var bundlejson = { - name: 'bundle-update', - version: '1.0.0', - files: ['OLD', 'NEW'] -} - -var bundlekeepjson = { - name: 'bundle-keep', - version: '1.0.0', - _requested: { - rawSpec: bundlekeeptgz - }, - _resolved: bundlekeeptgz, - _shasum: 'baadf00d', - files: ['OLD', 'NEW'] - -} -var bundledeepjson = { - name: 'bundle-deep', - version: '1.0.0', - dependencies: { - 'bundle-deep-update': bundledeepupdatetgz - }, - _requested: { - rawSpec: bundledeeptgz - }, - _resolved: bundlekeeptgz, - _shasum: 'deadbeef', - files: ['OLD', 'NEW'] - -} - -var bundledeepupdatejson = { - version: '1.0.0', - name: 'bundle-deep-update', - files: ['OLD', 'NEW'] - -} - -function writepjs (dir, content) { - fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(content, null, 2)) -} - -function setup () { - mkdirp.sync(testdir) - writepjs(testdir, testjson) - mkdirp.sync(testmod) - writepjs(testmod, testmodjson) - - mkdirp.sync(bundleupdatesrc) - writepjs(bundleupdatesrc, bundlejson) - fs.writeFileSync(bundleupdateNEW, '') - mkdirp.sync(bundleupdatebad) - writepjs(bundleupdatebad, bundlejson) - - mkdirp.sync(bundlekeepsrc) - writepjs(bundlekeepsrc, bundlekeepjson) - mkdirp.sync(bundlekeep) - writepjs(bundlekeep, bundlekeepjson) - fs.writeFileSync(bundlekeepOLD, '') - - mkdirp.sync(bundledeepsrc) - writepjs(bundledeepsrc, bundledeepjson) - mkdirp.sync(bundledeep) - writepjs(bundledeep, bundledeepjson) - fs.writeFileSync(bundledeepOLD, '') - - mkdirp.sync(bundledeepupdatesrc) - writepjs(bundledeepupdatesrc, bundledeepupdatejson) - mkdirp.sync(bundledeepupdate) - writepjs(bundledeepupdate, bundledeepupdatejson) - fs.writeFileSync(bundledeepupdateNEW, '') -} - -function cleanup () { - rimraf.sync(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - return Bluebird.all([ - common.npm(['pack', bundleupdatesrc], {cwd: path.dirname(bundleupdatetgz), stdio: 'inherit'}), - common.npm(['pack', bundlekeepsrc], {cwd: path.dirname(bundlekeeptgz), stdio: 'inherit'}), - common.npm(['pack', bundledeepupdatesrc], {cwd: path.dirname(bundledeepupdatetgz), stdio: 'inherit'}) - ]).map((result) => result[0]).spread((bundleupdate, bundlekeep, bundledeepupdate) => { - t.is(bundleupdate, 0, 'bundleupdate') - t.is(bundlekeep, 0, 'bundlekeep') - t.is(bundledeepupdate, 0, 'bundledeepupdate') - }).then(() => { - return common.npm(['pack', bundledeepsrc], {cwd: path.dirname(bundledeeptgz), stdio: 'inherit'}) - }).spread((code) => { - t.is(code, 0, 'bundledeep') - return common.npm(['pack', testmod], {cwd: path.dirname(testtgz), stdio: 'inherit'}) - }).spread((code) => { - t.is(code, 0, 'testmod') - }) -}) - -test('bundled', function (t) { - common.npm(['install', '--loglevel=verbose'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.plan(9) - t.is(code, 0, 'npm itself completed ok') - - // This tests that after the install we have a freshly installed version - // of `bundle-update` (in alignment with the package.json), instead of the - // version that was bundled with `top-test`. - // If npm doesn't do this, and selects the bundled version, things go very - // wrong because npm thinks it has a different module (with different - // metadata) installed in that location and will go off and try to do - // _things_ to it. Things like chmod in particular, which in turn results - // in the dreaded ENOENT errors. - t.like(stderr, new RegExp('npm WARN ' + testname), "didn't stomp on other warnings") - t.like(stderr, /npm verb.*bundle-update/, 'included update warning about bundled dep') - t.like(stderr, /npm verb.*bundle-deep-update/, 'included update warning about deeply bundled dep') - t.like(stderr, /npm WARN top-test@1\.0\.0 had bundled packages that do not match/, 'single grouped warning') - fs.stat(bundleupdateNEWpostinstall, function (missing) { - t.ok(!missing, 'package.json overrode bundle') - }) - fs.stat(bundledeepupdateNEWpostinstall, function (missing) { - t.ok(!missing, 'deep package.json overrode bundle') - }) - // Relatedly, when upgrading, if a bundled module is replacing an existing - // module we want to choose the bundled version, not the version we're replacing. - fs.stat(bundlekeepOLDpostinstall, function (missing) { - t.ok(!missing, 'no override when package.json matches') - }) - fs.stat(bundledeepOLDpostinstall, function (missing) { - t.ok(!missing, 'deep no override when package.json matches') - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/owner.js b/test/tap/owner.js deleted file mode 100644 index 622b272852c7d..0000000000000 --- a/test/tap/owner.js +++ /dev/null @@ -1,159 +0,0 @@ -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var basedir = common.pkg -var cachedir = common.cache - -var server - -var EXEC_OPTS = { - cwd: basedir, - stdio: [0, 'pipe', 2], - env: common.newEnv().extend({ - npm_config_cache: cachedir - }) -} - -var jashkenas = { - name: 'jashkenas', - email: 'jashkenas@gmail.com' -} - -var othiym23 = { - name: 'othiym23', - email: 'forrest@npmjs.com' -} - -var bcoe = { - name: 'bcoe', - email: 'ben@npmjs.com' -} - -function shrt (user) { - return user.name + ' <' + user.email + '>\n' -} - -function mocks (server) { - server.get('/-/user/org.couchdb.user:othiym23') - .many().reply(200, othiym23) - - // test 1 - server.get('/underscore') - .reply(200, { _id: 'underscore', _rev: 1, maintainers: [jashkenas] }) - server.put( - '/underscore/-rev/1', - { _id: 'underscore', _rev: 1, maintainers: [jashkenas, othiym23] }, - {} - ).reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) - - // test 2 - server.get('/@xxx%2fscoped') - .reply(200, { _id: '@xxx/scoped', _rev: 1, maintainers: [bcoe] }) - server.put( - '/@xxx%2fscoped/-rev/1', - { _id: '@xxx/scoped', _rev: 1, maintainers: [bcoe, othiym23] }, - {} - ).reply(200, { _id: '@xxx/scoped', _rev: 2, maintainers: [bcoe, othiym23] }) - - // test 3 - server.get('/underscore') - .reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) - - // test 4 - server.get('/underscore') - .reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) - server.put( - '/underscore/-rev/2', - { _id: 'underscore', _rev: 2, maintainers: [jashkenas] }, - {} - ).reply(200, { _id: 'underscore', _rev: 3, maintainers: [jashkenas] }) -} - -test('setup', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - server = s - t.end() - }) -}) - -test('npm owner add', function (t) { - common.npm( - [ - '--loglevel', 'warn', - '--registry', common.registry, - 'owner', 'add', 'othiym23', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner add ran without error') - t.notOk(code, 'npm owner add exited cleanly') - t.notOk(stderr, 'npm owner add ran silently') - t.equal(stdout, '+ othiym23 (underscore)\n', 'got expected add output') - - t.end() - } - ) -}) - -test('npm owner add (scoped)', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - 'owner', 'add', 'othiym23', '@xxx/scoped' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner add (scoped) ran without error') - t.notOk(code, 'npm owner add (scoped) exited cleanly') - t.notOk(stderr, 'npm owner add (scoped) ran silently') - t.equal(stdout, '+ othiym23 (@xxx/scoped)\n', 'got expected scoped add output') - - t.end() - } - ) -}) - -test('npm owner ls', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - 'owner', 'ls', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner ls ran without error') - t.notOk(code, 'npm owner ls exited cleanly') - t.notOk(stderr, 'npm owner ls ran silently') - t.equal(stdout, shrt(jashkenas) + shrt(othiym23), 'got expected ls output') - - t.end() - } - ) -}) - -test('npm owner rm', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - 'owner', 'rm', 'othiym23', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner rm ran without error') - t.notOk(code, 'npm owner rm exited cleanly') - t.notOk(stderr, 'npm owner rm ran silently') - t.equal(stdout, '- othiym23 (underscore)\n', 'got expected rm output') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/test/tap/pack-files-and-ignores.js b/test/tap/pack-files-and-ignores.js deleted file mode 100644 index 4d9b97a32ad25..0000000000000 --- a/test/tap/pack-files-and-ignores.js +++ /dev/null @@ -1,707 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') -var tar = require('tar') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-files') -var targetpath = path.resolve(basepath, 'target') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -test('basic file inclusion', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'include', - 'sub/include' - ] - }), - include: File(''), - sub: Dir({ include: File('') }), - notincluded: File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('include'), 'toplevel file included') - t.ok(fileExists('sub/include'), 'nested file included') - t.notOk(fileExists('notincluded'), 'unspecified file not included') - done() - }) -}) - -test('basic file exclusion', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - 'ignore\n' + - 'sub/ignore\n' - ), - include: File(''), - ignore: File(''), - sub: Dir({ ignore: File('') }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.notOk(fileExists('sub/ignore'), 'nested file excluded') - t.ok(fileExists('include'), 'unignored file included') - done() - }) -}) - -test('toplevel-only and blanket ignores', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - './shallow1\n' + - '/shallow2\n' + - '/sub/onelevel\n' + - 'deep\n' + - '' - ), - shallow1: File(''), - shallow2: File(''), - deep: File(''), - sub: Dir({ - shallow1: File(''), - shallow2: File(''), - onelevel: File(''), - deep: File(''), - sub: Dir({ - deep: File(''), - onelevel: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('shallow2'), '/ file excluded') - t.ok(fileExists('sub/shallow1'), 'nested ./ file included') - t.ok(fileExists('sub/shallow2'), 'nested / file included') - t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') - t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') - t.notOk(fileExists('deep'), 'deep file excluded') - t.notOk(fileExists('sub/deep'), 'nested deep file excluded') - t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') - t.ok(fileExists('shallow1'), './ file included') - done() - }) -}) - -test('.npmignore works for nested directories recursively', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - '/ignore\n' + - 'deep\n' - ), - include: File(''), - ignore: File(''), - deep: File(''), - sub: Dir({ - ignore: File(''), - include: File(''), - deep: File(''), - sub: Dir({ - '.npmignore': File( - '/ignore\n' - ), - ignore: File(''), - include: File(''), - deep: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.ok(fileExists('include'), 'unignored file included') - t.ok(fileExists('sub/ignore'), 'same-name file in nested dir included') - t.ok(fileExists('sub/include'), 'unignored nested dir file included') - t.notOk(fileExists('sub/sub/ignore'), 'sub-sub-directory file excluded') - t.ok(fileExists('sub/sub/include'), 'sub-sube-directory file included') - t.notOk(fileExists('deep'), 'deep file excluded') - t.notOk(fileExists('sub/deep'), 'sub-dir deep file excluded') - t.notOk(fileExists('sub/sub/deep'), 'sub-sub-dir deep file excluded') - done() - }) -}) - -test('.gitignore should have identical semantics', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.gitignore': File( - './shallow1\n' + - '/shallow2\n' + - '/sub/onelevel\n' + - 'deep\n' + - '' - ), - shallow1: File(''), - shallow2: File(''), - deep: File(''), - sub: Dir({ - shallow1: File(''), - shallow2: File(''), - onelevel: File(''), - deep: File(''), - sub: Dir({ - deep: File(''), - onelevel: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('shallow2'), '/ file excluded') - t.ok(fileExists('sub/shallow1'), 'nested ./ file included') - t.ok(fileExists('sub/shallow2'), 'nested / file included') - t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') - t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') - t.notOk(fileExists('deep'), 'deep file excluded') - t.notOk(fileExists('sub/deep'), 'nested deep file excluded') - t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') - t.ok(fileExists('shallow1'), './ file included') - done() - }) -}) - -test('.npmignore should always be overridden by files array', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'include', - 'sub' - ] - }), - '.npmignore': File( - 'include\n' + - 'ignore\n' + - 'sub/included\n' - ), - include: File(''), - ignore: File(''), - sub: Dir({ - included: File('') - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.ok(fileExists('include'), 'unignored file included') - t.ok(fileExists('sub/included'), 'nested file included') - done() - }) -}) - -test('.gitignore supported for ignores', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.gitignore': File( - 'ignore\n' + - 'sub/ignore\n' - ), - include: File(''), - ignore: File(''), - sub: Dir({ ignore: File('') }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.notOk(fileExists('sub/ignore'), 'nested file excluded') - t.ok(fileExists('include'), 'unignored file included') - done() - }) -}) - -test('.npmignore completely overrides .gitignore', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - 'ignore\n' + - 'sub/ignore\n' - ), - '.gitignore': File( - 'include\n' + - 'sub/include\n' + - 'extra\n' - ), - include: File(''), - sub: Dir({ include: File('') }), - extra: File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('include'), 'gitignored toplevel file included') - t.ok(fileExists('extra'), 'gitignored extra toplevel file included') - t.ok(fileExists('sub/include'), 'gitignored nested file included') - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.notOk(fileExists('sub/ignore'), 'nested file excluded') - done() - }) -}) - -test('files array overrides .npmignore', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'include', - 'sub/include' - ] - }), - '.npmignore': File( - 'include\n' + - 'sub/include\n' - ), - include: File(''), - sub: Dir({ include: File('') }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('include'), 'toplevel file included') - t.ok(fileExists('sub/include'), 'nested file included') - done() - }) -}) - -test('includes files regardless of emptiness', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'full', - 'empty' - ] - }), - full: File('This file has contents~'), - empty: File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('full'), 'contentful file included') - t.ok(fileExists('empty'), 'empty file included') - done() - }) -}) - -test('.npmignore itself gets included', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - '.npmignore' - ] - }), - '.npmignore': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('.npmignore'), '.npmignore included') - done() - }) -}) - -test('include default files when missing files spec', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - 'index.js': File(''), - foo: File(''), - node_modules: Dir({foo: Dir({bar: File('')})}) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('index.js'), 'index.js included') - t.ok(fileExists('foo'), 'foo included') - t.notOk(fileExists('node_modules'), 'node_modules not included') - done() - }) -}) - -test('include main file', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - main: 'foo.js', - files: [] - }), - 'index.js': File(''), - 'foo.js': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('foo.js'), 'foo.js included because of main') - t.notOk(fileExists('index.js'), 'index.js not included') - done() - }) -}) - -test('certain files ignored by default', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.git': Dir({foo: File('')}), - '.svn': Dir({foo: File('')}), - 'CVS': Dir({foo: File('')}), - '.hg': Dir({foo: File('')}), - '.lock-wscript': File(''), - '.wafpickle-0': File(''), - '.wafpickle-5': File(''), - '.wafpickle-50': File(''), - 'build': Dir({'config.gypi': File('')}), - 'npm-debug.log': File(''), - '.npmrc': File(''), - '.foo.swp': File(''), - 'core': Dir({core: File(''), foo: File('')}), - '.DS_Store': Dir({foo: File('')}), - '._ohno': File(''), - '._ohnoes': Dir({noes: File('')}), - 'foo.orig': File(''), - 'package-lock.json': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('.git'), '.git not included') - t.notOk(fileExists('.svn'), '.svn not included') - t.notOk(fileExists('CVS'), 'CVS not included') - t.notOk(fileExists('.hg'), '.hg not included') - t.notOk(fileExists('.lock-wscript'), '.lock-wscript not included') - t.notOk(fileExists('.wafpickle-0'), '.wafpickle-0 not included') - t.notOk(fileExists('.wafpickle-5'), '.wafpickle-5 not included') - t.notOk(fileExists('.wafpickle-50'), '.wafpickle-50 not included') - t.notOk(fileExists('build/config.gypi'), 'build/config.gypi not included') - t.notOk(fileExists('npm-debug.log'), 'npm-debug.log not included') - t.notOk(fileExists('.npmrc'), '.npmrc not included') - t.notOk(fileExists('.foo.swp'), '.foo.swp not included') - t.ok(fileExists('core'), 'core/ included') - t.ok(fileExists('core/foo'), 'core/foo included') - t.notOk(fileExists('core/core'), 'core/core not included') - t.notOk(fileExists('.DS_Store'), '.DS_Store not included') - t.notOk(fileExists('.DS_Store/foo'), '.DS_Store/foo not included') - t.notOk(fileExists('._ohno'), '._ohno not included') - t.notOk(fileExists('._ohnoes'), '._ohnoes not included') - t.notOk(fileExists('foo.orig'), 'foo.orig not included') - t.notOk(fileExists('package-lock.json'), 'package-lock.json not included') - done() - }) -}) - -test('default-ignored files can be explicitly included', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - '.git', - '.svn', - 'CVS', - '.hg', - '.lock-wscript', - '.wafpickle-0', - '.wafpickle-5', - '.wafpickle-50', - 'build/config.gypi', - 'npm-debug.log', - '.npmrc', - '.foo.swp', - 'core', - '.DS_Store', - '._ohno', - '._ohnoes', - 'foo.orig', - 'package-lock.json' - ] - }), - '.git': Dir({foo: File('')}), - '.svn': Dir({foo: File('')}), - 'CVS': Dir({foo: File('')}), - '.hg': Dir({foo: File('')}), - '.lock-wscript': File(''), - '.wafpickle-0': File(''), - '.wafpickle-5': File(''), - '.wafpickle-50': File(''), - 'build': Dir({'config.gypi': File('')}), - 'npm-debug.log': File(''), - '.npmrc': File(''), - '.foo.swp': File(''), - 'core': Dir({core: File(''), foo: File('')}), - '.DS_Store': Dir({foo: File('')}), - '._ohno': File(''), - '._ohnoes': Dir({noes: File('')}), - 'foo.orig': File(''), - 'package-lock.json': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('.git'), '.git should never be included') - t.ok(fileExists('.svn'), '.svn included') - t.ok(fileExists('CVS'), 'CVS included') - t.ok(fileExists('.hg'), '.hg included') - t.ok(fileExists('.lock-wscript'), '.lock-wscript included') - t.ok(fileExists('.wafpickle-0'), '.wafpickle-0 included') - t.ok(fileExists('.wafpickle-5'), '.wafpickle-5 included') - t.ok(fileExists('.wafpickle-50'), '.wafpickle-50 included') - t.ok(fileExists('build/config.gypi'), 'build/config.gypi included') - t.ok(fileExists('npm-debug.log'), 'npm-debug.log included') - t.ok(fileExists('.npmrc'), '.npmrc included') - t.ok(fileExists('.foo.swp'), '.foo.swp included') - t.ok(fileExists('core'), 'core/ included') - t.ok(fileExists('core/foo'), 'core/foo included') - t.ok(fileExists('core/core'), 'core/core included') - t.ok(fileExists('.DS_Store'), '.DS_Store included') - t.ok(fileExists('._ohno'), '._ohno included') - t.ok(fileExists('._ohnoes'), '._ohnoes included') - t.ok(fileExists('foo.orig'), 'foo.orig included') - t.ok(fileExists('package-lock.json'), 'package-lock.json included') - done() - }) -}) - -test('certain files included unconditionally', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - 'package.json', - 'README', - 'Readme', - 'readme.md', - 'readme.randomext', - 'changelog', - 'CHAngelog', - 'ChangeLOG.txt', - 'history', - 'HistorY', - 'HistorY.md', - 'license', - 'licence', - 'LICENSE', - 'LICENCE' - ), - 'README': File(''), - 'Readme': File(''), - 'readme.md': File(''), - 'readme.randomext': File(''), - 'changelog': File(''), - 'CHAngelog': File(''), - 'ChangeLOG.txt': File(''), - 'history': File(''), - 'HistorY': File(''), - 'HistorY.md': File(''), - 'license': File(''), - 'licence': File(''), - 'LICENSE': File(''), - 'LICENCE': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('package.json'), 'package.json included') - t.ok(fileExists('README'), 'README included') - t.ok(fileExists('Readme'), 'Readme included') - t.ok(fileExists('readme.md'), 'readme.md included') - t.ok(fileExists('readme.randomext'), 'readme.randomext included') - t.ok(fileExists('changelog'), 'changelog included') - t.ok(fileExists('CHAngelog'), 'CHAngelog included') - t.ok(fileExists('ChangeLOG.txt'), 'ChangeLOG.txt included') - t.ok(fileExists('license'), 'license included') - t.ok(fileExists('licence'), 'licence included') - t.ok(fileExists('LICENSE'), 'LICENSE included') - t.ok(fileExists('LICENCE'), 'LICENCE included') - done() - }) -}) - -test('unconditional inclusion does not capture modules', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - 'node_modules': Dir({ - 'readme': Dir({ 'file': File('') }), - 'README': Dir({ 'file': File('') }), - 'licence': Dir({ 'file': File('') }), - 'license': Dir({ 'file': File('') }), - 'history': Dir({ 'file': File('') }), - 'History': Dir({ 'file': File('') }), - 'changelog': Dir({ 'file': File('') }), - 'ChangeLOG': Dir({ 'file': File('') }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('node_modules/readme/file'), 'readme module not included') - t.notOk(fileExists('node_modules/README/file'), 'README module not included') - t.notOk(fileExists('node_modules/licence/file'), 'licence module not included') - t.notOk(fileExists('node_modules/license/file'), 'license module not included') - t.notOk(fileExists('node_modules/history/file'), 'history module not included') - t.notOk(fileExists('node_modules/History/file'), 'History module not included') - t.notOk(fileExists('node_modules/changelog/file'), 'changelog module not included') - t.notOk(fileExists('node_modules/ChangeLOG/file'), 'ChangeLOG module not included') - - done() - }) -}) - -test('folder-based inclusion works', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'sub1/sub', - 'sub2' - ] - }), - sub1: Dir({ - sub: Dir({ - include1: File(''), - include2: File('') - }), - ignored: File('') - }), - sub2: Dir({ - include1: File(''), - include2: File(''), - empty: Dir({}) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('sub1/sub/include1'), 'nested dir included') - t.ok(fileExists('sub1/sub/include2'), 'nested dir included') - t.notOk(fileExists('sub1/ignored'), 'unspecified file not included') - - t.ok(fileExists('sub2/include1'), 'dir contents included') - t.ok(fileExists('sub2/include2'), 'dir contents included') - t.notOk(fileExists('sub2/empty'), 'empty dir not included') - - done() - }) -}) - -test('file that starts with @ sign included normally', (t) => { - const fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '@sub1': Dir({ - sub: Dir({ - include1: File('') - }) - }), - sub2: Dir({ - '@include': File(''), - '@sub3': Dir({ - include1: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('@sub1/sub/include1'), '@ dir included') - - t.ok(fileExists('sub2/@include'), '@ file included') - t.ok(fileExists('sub2/@sub3/include1'), 'nested @ dir included') - - done() - }) -}) - -function fileExists (file) { - try { - return !!fs.statSync(path.resolve(targetpath, 'package', file)) - } catch (_) { - return false - } -} - -function withFixture (t, fixture, tester) { - fixture.create(fixturepath) - mkdirp.sync(targetpath) - common.npm(['pack', fixturepath], {cwd: basepath}, extractAndCheck) - function extractAndCheck (err, code) { - if (err) throw err - t.is(code, 0, 'pack went ok') - extractTarball(checkTests) - } - function checkTests (err) { - if (err) throw err - tester(removeAndDone) - } - function removeAndDone (err) { - if (err) throw err - fixture.remove(fixturepath) - rimraf.sync(basepath) - t.done() - } -} - -function extractTarball (cb) { - // Unpack to disk so case-insensitive filesystems are consistent - tar.extract({ - file: basepath + '/npm-test-files-1.2.5.tgz', - cwd: targetpath, - sync: true - }) - - cb() -} diff --git a/test/tap/pack-scoped.js b/test/tap/pack-scoped.js deleted file mode 100644 index 06d02297fd5d0..0000000000000 --- a/test/tap/pack-scoped.js +++ /dev/null @@ -1,81 +0,0 @@ -// verify that prepublish runs on pack and publish -var test = require('tap').test -var common = require('../common-tap') -var fs = require('graceful-fs') -var join = require('path').join -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var pkg = common.pkg -var manifest = join(pkg, 'package.json') -var tmp = join(pkg, 'tmp') -var cache = common.cache - -var data = { - name: '@scope/generic-package', - version: '90000.100001.5' -} - -test('setup', function (t) { - var n = 0 - - rimraf.sync(pkg) - - mkdirp(pkg, then()) - mkdirp(cache, then()) - mkdirp(tmp, then()) - - function then () { - n++ - return function (er) { - t.ifError(er) - if (--n === 0) next() - } - } - - function next () { - fs.writeFile(manifest, JSON.stringify(data), 'ascii', done) - } - - function done (er) { - t.ifError(er) - - t.pass('setup done') - t.end() - } -}) - -test('test', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) env[i] = process.env[i] - } - - common.npm([ - 'pack', - '--loglevel', 'warn' - ], { - cwd: pkg, - env: env - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm pack finished without error') - t.equal(code, 0, 'npm pack exited ok') - t.notOk(stderr, 'got stderr data: ' + JSON.stringify('' + stderr)) - stdout = stdout.trim() - var regex = new RegExp('scope-generic-package-90000.100001.5.tgz', 'ig') - t.ok(stdout.match(regex), 'found package') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/pack.js b/test/tap/pack.js deleted file mode 100644 index 23c8296d003cd..0000000000000 --- a/test/tap/pack.js +++ /dev/null @@ -1,199 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const test = require('tap').test -const common = require('../common-tap') -const fs = BB.promisifyAll(require('graceful-fs')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') - -const Dir = Tacks.Dir -const File = Tacks.File - -const testDir = common.pkg -const tmp = path.join(testDir, 'tmp') -const cache = common.cache - -test('basic pack', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5' - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.match(stderr, /notice\s+\d+[a-z]+\s+package\.json/gi, 'mentions package.json') - t.match(stdout, /generic-package-90000\.100001\.5\.tgz/ig, 'found pkg') - return fs.statAsync( - path.join(testDir, 'generic-package-90000.100001.5.tgz') - ) - }) - .then((stat) => t.ok(stat, 'tarball written to cwd')) - .then(() => rimraf(testDir)) -}) - -test('pack with bundled', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5', - dependencies: { - '@bundle/dep': '^1.0.0', - 'regular-dep': '^1.0.0' - }, - bundleDependencies: [ - '@bundle/dep', - 'regular-dep' - ] - }), - 'node_modules': new Dir({ - 'regular-dep': new Dir({ - 'package.json': new File({ - name: 'regular-dep', - version: '1.0.0' - }) - }), - '@bundle': new Dir({ - 'dep': new Dir({ - 'package.json': new File({ - name: '@bundle/dep', - version: '1.0.0' - }) - }) - }) - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.match(stderr, /notice\s+\d+[a-z]+\s+package\.json/gi, 'mentions package.json') - t.match(stderr, /notice\s+regular-dep/, 'regular dep mentioned') - t.match(stderr, /notice\s+@bundle\/dep/, 'bundled dep mentioned') - }) - .then(() => rimraf(testDir)) -}) - -test('pack --dry-run', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5' - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--dry-run', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.match(stdout, /generic-package-90000\.100001\.5\.tgz/ig, 'found pkg') - return fs.statAsync( - path.join(testDir, 'generic-package-90000.100001.5.tgz') - ) - .then( - () => { throw new Error('should have failed') }, - (err) => t.equal(err.code, 'ENOENT', 'no tarball written!') - ) - }) - .then(() => rimraf(testDir)) -}) - -test('pack --json', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5' - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--dry-run', - '--json', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.equal(stderr.trim(), '', 'no notice output') - t.similar(JSON.parse(stdout), [{ - filename: 'generic-package-90000.100001.5.tgz', - files: [{path: 'package.json'}], - entryCount: 1 - }], 'pack details output as valid json') - }) - .then(() => rimraf(testDir)) -}) - -test('postpack', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5', - scripts: { - postpack: 'node -e "var fs = require(\'fs\'); fs.openSync(\'postpack-step\', \'w+\'); if (!fs.existsSync(\'generic-package-90000.100001.5.tgz\')) { throw new Error(\'tar archive does not exist on postpack\') }"' - } - }) - })) - - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - return fs.statAsync( - path.join(testDir, 'postpack-step') - ) - }) - .then(() => rimraf(testDir)) -}) diff --git a/test/tap/peer-deps.js b/test/tap/peer-deps.js deleted file mode 100644 index 558fe9c4e6d96..0000000000000 --- a/test/tap/peer-deps.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -var expected = [ 'peer dep missing: request@0.9.x, required by npm-test-peer-deps@0.0.0' ] - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-peer-deps-installer', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps': '*' - } -} - -function setup (cb) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - var opts = { cache: common.cache, registry: common.registry } - npm.load(opts, cb) -} - -test('installs the peer dependency directory structure', function (t) { - mr({ port: common.port }, function (er, s) { - setup(function (err) { - if (err) return t.fail(err) - - npm.install('.', function (err) { - if (err) return t.fail(err) - - npm.commands.ls([], true, function (err, _, results) { - if (err) return t.fail(err) - - t.deepEqual(results.problems, expected) - s.close() - t.end() - }) - }) - }) - }) -}) diff --git a/test/tap/pick-manifest-from-registry-metadata.js b/test/tap/pick-manifest-from-registry-metadata.js deleted file mode 100644 index 3af354aed3819..0000000000000 --- a/test/tap/pick-manifest-from-registry-metadata.js +++ /dev/null @@ -1,145 +0,0 @@ -'use strict' -var test = require('tap').test - -var pickManifest = require('../../lib/utils/pick-manifest-from-registry-metadata.js') - -test('basic carat range selection', function (t) { - var metadata = { - 'dist-tags': { - 'example': '1.1.0' - }, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '1.1.0': { version: '1.1.0' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('^1.0.0', 'latest', versions, metadata) - t.equal(selected.manifest.version, '1.1.0', 'picked the right manifest using ^') - t.equal(selected.resolvedTo, '1.1.0', 'resolved using version match') - selected = pickManifest('^1.0.0', 'example', versions, metadata) - t.equal(selected.manifest.version, '1.1.0', 'picked the right manifest using ^') - t.equal(selected.resolvedTo, 'example', 'resolved using tag') - t.end() -}) - -test('basic tilde range selection', function (t) { - var metadata = { - 'dist-tags': { - 'example': '1.1.0' - }, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '1.1.0': { version: '1.1.0' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('~1.0.0', 'latest', versions, metadata) - t.equal(selected.manifest.version, '1.0.2', 'picked the right manifest using ~') - t.equal(selected.resolvedTo, '1.0.2', 'resolved using version match') - t.end() -}) - -test('basic mathematical range selection', function (t) { - var metadata = { - 'dist-tags': {}, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('>=1.0.0 <2', 'example', versions, metadata) - t.equal(selected.manifest.version, '1.0.2', 'picked the right manifest using mathematical range') - t.equal(selected.resolvedTo, '1.0.2', 'resolved using version match') - t.end() -}) - -test('basic version selection', function (t) { - var metadata = { - 'dist-tags': {}, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('1.0.0', 'latest', versions, metadata) - t.equal(selected.manifest.version, '1.0.0', 'picked the right manifest using specific version') - t.equal(selected.resolvedTo, '1.0.0', 'resolved using version match') - t.end() -}) - -test('nothing if range does not match anything', function (t) { - var metadata = { - 'dist-tags': {}, - versions: { - '1.0.0': { version: '1.0.0' }, - '2.0.0': { version: '2.0.0' }, - '2.0.5': { version: '2.0.5' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('^2.1.0', 'latest', versions, metadata) - t.equal(selected, undefined, 'no manifest matched') - t.end() -}) - -test('if `defaultTag` matches a given range, use it', function (t) { - var metadata = { - 'dist-tags': { - foo: '1.0.1' - }, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('^1.0.0', 'foo', versions, metadata) - t.equal(selected.manifest.version, '1.0.1', 'picked the version for foo') - t.equal(selected.resolvedTo, 'foo', 'resolved using tag') - - selected = pickManifest('^2.0.0', 'foo', versions, metadata) - t.equal(selected.manifest.version, '2.0.0', 'no match, no foo') - t.equal(selected.resolvedTo, '2.0.0', 'resolved using version match') - - t.end() -}) - -test('* ranges use `defaultTag` if no versions match', function (t) { - var metadata = { - 'dist-tags': { - beta: '2.0.0-beta.0' - }, - versions: { - '1.0.0-pre.0': { version: '1.0.0-pre.0' }, - '1.0.0-pre.1': { version: '1.0.0-pre.1' }, - '2.0.0-beta.0': { version: '2.0.0-beta.0' }, - '2.0.0-beta.1': { version: '2.0.0-beta.1' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('*', 'beta', versions, metadata) - t.equal(selected.manifest.version, '2.0.0-beta.0', 'used defaultTag for all-prerelease splat.') - t.equal(selected.resolvedTo, 'beta', 'resolved using tag') - t.end() -}) - -test('no result if metadata has no versions', function (t) { - var selected = pickManifest('^1.0.0', 'latest', [], {'dist-tags': {}, versions: {}}) - t.equal(selected, undefined, 'no versions, no result') - t.end() -}) diff --git a/test/tap/ping.js b/test/tap/ping.js deleted file mode 100644 index 3687b05bd4518..0000000000000 --- a/test/tap/ping.js +++ /dev/null @@ -1,95 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var opts = { cwd: pkg } - -var outfile = path.join(pkg, '_npmrc') - -var contents = function () { -}.toString().split('\n').slice(1, -1).join('\n') - -var pingResponse = { - host: 'registry.npmjs.org', - ok: true, - username: null, - peer: 'example.com' -} - -function mocks (server) { - server.get('/-/ping?write=true').reply(200, JSON.stringify(pingResponse)) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('npm ping', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm([ - 'ping', - '--registry', common.registry, - '--loglevel', 'notice', - '--userconfig', outfile - ], opts, function (err, code, stdout, stderr) { - s.close() - t.ifError(err, 'command completed') - t.notOk(code, 'exited OK') - - t.match(stderr, /PING/, 'ping notification output') - t.match(stderr, /PONG/, 'pong response output') - t.end() - }) - }) -}) - -test('npm ping --json', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm([ - 'ping', - '--json', - '--registry', common.registry, - '--loglevel', 'notice', - '--userconfig', outfile - ], opts, function (err, code, stdout, stderr) { - s.close() - t.ifError(err, 'command completed') - t.notOk(code, 'exited OK') - - const json = JSON.parse(stdout.trim()) - t.similar(json, { - registry: common.registry, - details: pingResponse - }, 'JSON info returned') - t.equal(typeof json.time, 'number', 'got a timestamp') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync(outfile, contents) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/prepare.js b/test/tap/prepare.js deleted file mode 100644 index d0966000735c4..0000000000000 --- a/test/tap/prepare.js +++ /dev/null @@ -1,89 +0,0 @@ -// verify that prepare runs on pack and publish -var common = require('../common-tap') -var test = require('tap').test -var fs = require('graceful-fs') -var join = require('path').join -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var pkg = common.pkg -var tmp = join(pkg, 'tmp') -var cache = common.cache - -test('setup', function (t) { - var n = 0 - cleanup() - mkdirp(pkg, then()) - mkdirp(cache, then()) - mkdirp(tmp, then()) - function then () { - n++ - return function (er) { - if (er) throw er - if (--n === 0) next() - } - } - - function next () { - fs.writeFile(join(pkg, 'package.json'), JSON.stringify({ - name: 'npm-test-prepare', - version: '1.2.5', - scripts: { prepare: 'echo ok' } - }), 'ascii', function (er) { - if (er) throw er - - t.pass('setup done') - t.end() - }) - } -}) - -test('test', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } - } - - common.npm([ - 'pack', - '--loglevel', 'warn' - ], { - cwd: pkg, - env: env, - nodeExecPath: process.execPath - }, function (err, code, stdout, stderr) { - t.equal(code, 0, 'pack finished successfully') - t.ifErr(err, 'pack finished successfully') - - t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) - var c = stdout.trim() - var regex = new RegExp( - '> npm-test-prepare@1.2.5 prepare [^\\r\\n]+\\r?\\n' + - '> echo ok\\r?\\n' + - '\\r?\\n' + - 'ok\\r?\\n' + - 'npm-test-prepare-1.2.5.tgz', 'ig' - ) - - t.match(c, regex) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.pass('cleaned up') - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/prepublish-only.js b/test/tap/prepublish-only.js deleted file mode 100644 index 988d507c6359f..0000000000000 --- a/test/tap/prepublish-only.js +++ /dev/null @@ -1,136 +0,0 @@ -// verify that prepublishOnly runs _only_ on publish -var join = require('path').join - -var mr = require('npm-registry-mock') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var path = require('path') - -var common = require('../common-tap') - -var pkg = common.pkg -var cachedir = common.cache -var tmpdir = join(pkg, 'tmp') - -var env = { - 'npm_config_cache': cachedir, - 'npm_config_tmp': tmpdir, - 'npm_config_global': 'false' -} - -for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } -} - -var server - -var fixture = new Tacks(Dir({ - cache: Dir(), - tmp: Dir(), - '.npmrc': File([ - 'progress=false', - 'registry=' + common.registry, - '//localhost:1337/:username=username', - '//localhost:1337/:_authToken=deadbeeffeed' - ].join('\n') + '\n'), - helper: Dir({ - 'script.js': File([ - '#!/usr/bin/env node\n', - 'console.log("ok")\n' - ].join('\n') + '\n' - ), - 'package.json': File({ - name: 'helper', - version: '6.6.6', - bin: './script.js' - }) - }), - 'package.json': File({ - name: 'npm-test-prepublish-only', - version: '1.2.5', - dependencies: { - 'helper': 'file:./helper' - }, - scripts: { - build: 'helper', - prepublishOnly: 'node ' + path.resolve(__dirname, '../../') + ' run build' - } - }) -})) - -test('setup', function (t) { - fixture.create(pkg) - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - common.npm( - [ - 'install', - '--loglevel', 'error', - '--cache', cachedir, - '--tmp', tmpdir - ], - { - cwd: pkg, - env: env - }, - function (err, code, stdout, stderr) { - t.equal(code, 0, 'install exited OK') - t.ifErr(err, 'installed successfully') - - t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) - - t.end() - } - ) - }) -}) - -test('test', function (t) { - server.filteringRequestBody(function () { return true }) - .put('/npm-test-prepublish-only', true) - .reply(201, {ok: true}) - - common.npm( - [ - 'publish', - '--loglevel', 'warn', - '--scripts-prepend-node-path' - ], - { - cwd: pkg, - env: env - }, - function (err, code, stdout, stderr) { - t.equal(code, 0, 'publish ran without error') - t.ifErr(err, 'published successfully') - - t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) - var c = stdout.trim() - var regex = new RegExp( - '> npm-test-prepublish-only@1.2.5 prepublishOnly [^\\r\\n]+\\r?\\n' + - '> .* run build\\r?\\n' + - '\\r?\\n' + - '\\r?\\n' + - '> npm-test-prepublish-only@1.2.5 build [^\\r\\n]+\\r?\\n' + - '> helper\\r?\\n' + - '\\r?\\n' + - 'ok\\r?\\n' + - '\\+ npm-test-prepublish-only@1.2.5', 'ig' - ) - - t.match(c, regex) - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/prepublish.js b/test/tap/prepublish.js deleted file mode 100644 index e561d057f2124..0000000000000 --- a/test/tap/prepublish.js +++ /dev/null @@ -1,118 +0,0 @@ -// verify that prepublish runs on install, pack, and publish -var common = require('../common-tap') -var test = require('tap').test -var fs = require('graceful-fs') -var join = require('path').join -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var pkg = common.pkg -var tmp = join(pkg, 'tmp') -var cache = common.cache - -test('setup', function (t) { - var n = 0 - cleanup() - mkdirp(pkg, then()) - mkdirp(cache, then()) - mkdirp(tmp, then()) - function then () { - n++ - return function (er) { - if (er) throw er - if (--n === 0) next() - } - } - - function next () { - fs.writeFile(join(pkg, 'package.json'), JSON.stringify({ - name: 'npm-test-prepublish', - version: '1.2.5', - scripts: { prepublish: 'echo ok' } - }), 'ascii', function (er) { - if (er) throw er - - t.pass('setup done') - t.end() - }) - } -}) - -test('prepublish deprecation warning on `npm pack`', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } - } - - common.npm([ - 'pack', - '--loglevel', 'warn' - ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { - t.equal(code, 0, 'pack finished successfully') - t.ifErr(err, 'pack finished successfully') - - t.match(stderr, /`prepublish` scripts are deprecated/) - var c = stdout.trim() - var regex = new RegExp('' + - '> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n' + - '> echo ok\\r?\\n' + - '\\r?\\n' + - 'ok\\r?\\n' + - 'npm-test-prepublish-1.2.5.tgz', 'ig') - - t.match(c, regex) - t.end() - }) -}) - -test('prepublish deprecation warning on `npm install`', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } - } - - common.npm([ - 'install', - '--loglevel', 'warn' - ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { - t.equal(code, 0, 'pack finished successfully') - t.ifErr(err, 'pack finished successfully') - - t.match(stderr, /`prepublish` scripts are deprecated/) - var c = stdout.trim() - var regex = new RegExp('' + - '> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n' + - '> echo ok\\r?\\n' + - '\\r?\\n' + - 'ok' + - '', 'ig') - - t.match(c, regex) - t.end() - }) -}) -test('cleanup', function (t) { - cleanup() - t.pass('cleaned up') - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/process-logger.js b/test/tap/process-logger.js deleted file mode 100644 index 45c4e708cc1bb..0000000000000 --- a/test/tap/process-logger.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' -const test = require('tap').test -require('../../lib/npm.js') - -test('process logging', (t) => { - t.ok(process.listenerCount('log') >= 1, `log listener attached ${process.listenerCount('log')} >= 1`) - t.doesNotThrow(() => process.emit('log', 'error', 'test', 'this'), 'logging does not throw') - t.doesNotThrow(() => process.emit('log', 2348), 'invalid args do not throw') - t.doesNotThrow(() => process.emit('log', null), 'null does not throw') - t.doesNotThrow(() => process.emit('log', {}), 'obj does not throw') - t.done() -}) diff --git a/test/tap/progress-config.js b/test/tap/progress-config.js deleted file mode 100644 index 92468004f2c53..0000000000000 --- a/test/tap/progress-config.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' -var test = require('tap').test -var log = require('npmlog') -var fs = require('graceful-fs') -const common = require('../common-tap.js') -var configName = common.pkg + '/npmrc' - -// We use requireInject to get a fresh copy of -// the npm singleton each time we require it. -// If we didn't, we'd have shared state between -// these various tests. -var requireInject = require('require-inject') - -// Make sure existing environment vars don't muck up the test -process.env = {} -// Pretend that stderr is a tty regardless, so we can get consistent -// results. -process.stderr.isTTY = true - -test('setup', function (t) { - fs.writeFileSync(configName, '') - t.done() -}) - -function getFreshNpm () { - return requireInject.withEmptyCache('../../lib/npm.js', {npmlog: log}) -} - -test('disabled', function (t) { - t.plan(1) - var npm = getFreshNpm() - npm.load({userconfig: configName, progress: false}, function () { - t.is(log.progressEnabled, false, 'should be disabled') - }) -}) - -test('enabled', function (t) { - t.plan(1) - var npm = getFreshNpm() - npm.load({userconfig: configName, progress: true}, function () { - t.is(log.progressEnabled, true, 'should be enabled') - }) -}) - -test('default', function (t) { - t.plan(1) - var npm = getFreshNpm() - npm.load({userconfig: configName}, function () { - t.is(log.progressEnabled, true, 'should be enabled') - }) -}) - -test('default-travis', function (t) { - t.plan(1) - process.env.TRAVIS = 'true' - var npm = getFreshNpm() - npm.load({userconfig: configName}, function () { - t.is(log.progressEnabled, false, 'should be disabled') - delete process.env.TRAVIS - }) -}) - -test('default-ci', function (t) { - t.plan(1) - process.env.CI = 'true' - var npm = getFreshNpm() - npm.load({userconfig: configName}, function () { - t.is(log.progressEnabled, false, 'should be disabled') - delete process.env.CI - }) -}) - -test('unicode-true', function (t) { - var npm = getFreshNpm() - npm.load({userconfig: configName, unicode: true}, function () { - t.is(log.gauge._theme.hasUnicode, true, 'unicode will be selected') - t.done() - }) -}) - -test('unicode-false', function (t) { - var npm = getFreshNpm() - npm.load({userconfig: configName, unicode: false}, function () { - t.is(log.gauge._theme.hasUnicode, false, 'unicode will NOT be selected') - t.done() - }) -}) diff --git a/test/tap/publish-access-scoped.js b/test/tap/publish-access-scoped.js deleted file mode 100644 index 7b9a3ecb59b9c..0000000000000 --- a/test/tap/publish-access-scoped.js +++ /dev/null @@ -1,65 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mr = require('npm-registry-mock') -var common = require('../common-tap') -var server - -var pkg = common.pkg - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - t.pass('setup done') - server = s - t.end() - }) -}) - -test('scoped packages pass public access if set', function (t) { - server.filteringRequestBody(function (body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, 'public', 'access level is correct') - }, 'converted body back into object') - return true - }).put('/@bigco%2fpublish-access', true).reply(201, {ok: true}) - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: '@bigco/publish-access', - version: '1.2.5', - public: true - }), - 'ascii', - function (er) { - t.ifError(er, 'package file written') - common.npm( - [ - 'publish', - '--access', 'public', - '--cache', common.cache, - '--loglevel', 'silly', - '--registry', common.registry - ], - { - cwd: pkg - }, - function (er) { - t.ifError(er, 'published without error') - - server.done() - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - process.chdir(__dirname) - server.close() - t.end() -}) diff --git a/test/tap/publish-access-unscoped-restricted-fails.js b/test/tap/publish-access-unscoped-restricted-fails.js deleted file mode 100644 index f615fa60f2450..0000000000000 --- a/test/tap/publish-access-unscoped-restricted-fails.js +++ /dev/null @@ -1,38 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var common = require('../common-tap.js') - -var pkg = common.pkg - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: 'publish-access', - version: '1.2.5' - })) - t.pass('setup done') - t.end() -}) - -test('unscoped packages cannot be restricted', function (t) { - var args = ['--access=restricted', '--loglevel=warn', '--registry=' + common.registry] - var opts = {stdio: [0, 1, 'pipe'], cwd: pkg} - common.npm(['publish'].concat(args), opts, function (err, code, stdout, stderr) { - if (err) throw err - t.notEqual(code, 0, 'publish not successful') - t.match(stderr, "Can't restrict access to unscoped packages.") - - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/publish-access-unscoped.js b/test/tap/publish-access-unscoped.js deleted file mode 100644 index a7ea8e6694849..0000000000000 --- a/test/tap/publish-access-unscoped.js +++ /dev/null @@ -1,65 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mr = require('npm-registry-mock') -var common = require('../common-tap') -var server - -var pkg = common.pkg - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - t.pass('setup done') - server = s - t.end() - }) -}) - -test('unscoped packages can be explicitly set as public', function (t) { - server.filteringRequestBody(function (body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, 'public', 'access level is correct') - }, 'converted body back into object') - return true - }).put('/publish-access', true).reply(201, {ok: true}) - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: 'publish-access', - version: '1.2.5', - public: true - }), - 'ascii', - function (er) { - t.ifError(er, 'package file written') - common.npm( - [ - 'publish', - '--access', 'public', - '--cache', common.cache, - '--loglevel', 'silly', - '--registry', common.registry - ], - { - cwd: pkg - }, - function (er) { - t.ifError(er, 'published without error') - - server.done() - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - process.chdir(__dirname) - server.close() - t.end() -}) diff --git a/test/tap/publish-config.js b/test/tap/publish-config.js deleted file mode 100644 index 0d6406316b4a0..0000000000000 --- a/test/tap/publish-config.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const test = require('tap').test -const fs = require('fs') -const pkg = common.pkg - -fs.writeFileSync(pkg + '/package.json', JSON.stringify({ - name: 'npm-test-publish-config', - version: '1.2.3', - publishConfig: { - registry: common.registry - } -}), 'utf8') - -fs.writeFileSync(pkg + '/fixture_npmrc', - '//localhost:' + common.port + '/:email = fancy@feast.net\n' + - '//localhost:' + common.port + '/:username = fancy\n' + - '//localhost:' + common.port + '/:_password = ' + Buffer.from('feast').toString('base64')) - -test(function (t) { - let child - t.plan(5) - require('http').createServer(function (req, res) { - t.pass('got request on the fakey fake registry') - let body = '' - req.on('data', (d) => { body += d }) - req.on('end', () => { - this.close() - res.statusCode = 500 - res.end(JSON.stringify({ - error: 'sshhh. naptime nao. \\^O^/ <(YAWWWWN!)' - })) - t.match(body, /"beta"/, 'got expected tag') - child.kill('SIGINT') - }) - }).listen(common.port, () => { - t.pass('server is listening') - - // don't much care about listening to the child's results - // just wanna make sure it hits the server we just set up. - // - // there are plenty of other tests to verify that publish - // itself functions normally. - // - // Make sure that we don't sit around waiting for lock files - child = common.npm([ - 'publish', - '--userconfig=' + pkg + '/fixture_npmrc', - '--tag=beta', - '--loglevel', 'error' - ], { - cwd: pkg, - env: { - 'npm_config_cache_lock_stale': 1000, - 'npm_config_cache_lock_wait': 1000, - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH, - USERPROFILE: process.env.USERPROFILE - } - }, function (err, code, stdout, stderr) { - t.comment(stdout) - t.comment(stderr) - t.ifError(err, 'publish command finished successfully') - t.notOk(code, 'npm install exited with code 0') - }) - }) -}) diff --git a/test/tap/publish-invalid-semver-tag.js b/test/tap/publish-invalid-semver-tag.js deleted file mode 100644 index b5d499f377248..0000000000000 --- a/test/tap/publish-invalid-semver-tag.js +++ /dev/null @@ -1,76 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../lib/npm.js') -var mkdirp = require('mkdirp') -var path = require('path') -var fs = require('fs') -var mr = require('npm-registry-mock') - -var PKG_DIR = common.pkg -let cacheIteration = 0 -let CACHE_DIR - -var DEFAULT_PKG = { - 'name': 'examples', - 'version': '1.2.3' -} - -const isRoot = process.getuid && process.getuid() === 0 -const sudoUID = isRoot ? +process.env.SUDO_UID : null -const sudoGID = isRoot ? +process.env.SUDO_GID : null -const { chownSync } = require('fs') -function resetPackage (options) { - CACHE_DIR = path.resolve(common.cache, '' + cacheIteration++) - mkdirp.sync(CACHE_DIR) - npm.config.set('cache', CACHE_DIR) - - if (isRoot && sudoUID && sudoGID) { - chownSync(CACHE_DIR, sudoUID, sudoGID) - } - - fs.writeFileSync(path.resolve(PKG_DIR, 'package.json'), DEFAULT_PKG) -} - -test('setup', function (t) { - mkdirp.sync(PKG_DIR) - process.chdir(PKG_DIR) - - mr({ port: common.port }, function (er, server) { - if (er) { - throw er - } - t.parent.teardown(() => server.close()) - npm.load({ - cache: common.cache, - registry: common.registry, - cwd: PKG_DIR - }, function (err) { - if (err) { - throw err - } - t.end() - }) - }) -}) - -test('attempt publish with semver-like version', function (t) { - resetPackage({}) - - npm.config.set('tag', 'v1.x') - npm.commands.publish([], function (err) { - t.notEqual(err, null) - t.same(err.message, 'Tag name must not be a valid SemVer range: v1.x') - t.end() - }) -}) - -test('attempt publish with semver-like version', function (t) { - resetPackage({}) - - npm.config.set('tag', '1.2.3') - npm.commands.publish([], function (err) { - t.notEqual(err, null) - t.same(err.message, 'Tag name must not be a valid SemVer range: 1.2.3') - t.end() - }) -}) diff --git a/test/tap/publish-scoped.js b/test/tap/publish-scoped.js deleted file mode 100644 index 82873688cdce9..0000000000000 --- a/test/tap/publish-scoped.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var common = require('../common-tap') -var mr = require('npm-registry-mock') - -var pkg = common.pkg - -var server - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: '@bigco/publish-organized', - version: '1.2.5' - }, null, 2), - 'ascii') -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('npm publish should honor scoping', function (t) { - server.filteringRequestBody(verify) - .put('/@bigco%2fpublish-organized', true) - .reply(201, {ok: true}) - - var configuration = [ - 'progress=false', - 'cache=' + common.cache, - 'registry=http://nonexistent.lvh.me', - '//localhost:' + common.port + '/:username=username', - '//localhost:' + common.port + '/:_password=' + Buffer.from('password').toString('base64'), - '//localhost:' + common.port + '/:email=' + 'ogd@aoaioxxysz.net', - '@bigco:registry=' + common.registry - ] - var configFile = path.join(pkg, '.npmrc') - - fs.writeFileSync(configFile, configuration.join('\n') + '\n') - - common.npm(['publish'], {'cwd': pkg, nodeExecPath: process.execPath}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'published without error') - server.done() - t.end() - }) - - function verify (body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - var current = parsed.versions['1.2.5'] - t.equal( - current._npmVersion, - require(path.resolve(__dirname, '../../package.json')).version, - 'npm version is correct' - ) - - t.equal( - current._nodeVersion, - process.versions.node, - 'node version is correct' - ) - }, 'converted body back into object') - - return true - } -}) - -test('cleanup', function (t) { - server.close() - process.chdir(__dirname) - t.end() -}) diff --git a/test/tap/publish.js b/test/tap/publish.js deleted file mode 100644 index 453abcecd47ab..0000000000000 --- a/test/tap/publish.js +++ /dev/null @@ -1,162 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap') -const fs = require('fs') -const mr = BB.promisify(require('npm-registry-mock')) -const path = require('path') -const test = require('tap').test - -const testDir = common.pkg - -function setup () { - fs.writeFileSync( - path.join(testDir, 'package.json'), - JSON.stringify({ - name: 'publish-organized', - version: '1.2.5' - }, null, 2), - 'utf8' - ) - - fs.writeFileSync( - path.join(testDir, 'index.js'), - 'hello', - 'utf8' - ) -} - -let port = common.port -function withServer (cb) { - return mr({port: port++, throwOnUnmatched: true}) - .tap(cb) - .then((server) => { - server.done() - return server.close() - }) -} - -test('basic npm publish', (t) => { - setup() - return withServer((server) => { - server.filteringRequestBody(verify) - .put('/publish-organized', true) - .reply(201, {ok: true}) - - return common.npm([ - 'publish', - '--no-color', - '--cache', common.cache, - '--registry=' + common.registry.replace(common.port, server.port), - `--//localhost:${server.port}/:username=username`, - `--//localhost:${server.port}/:_password=` + Buffer.from('password').toString('base64'), - `--//localhost:${server.port}/:email=` + 'ogd@aoaioxxysz.net' - ], { - 'cwd': testDir, - nodeExecPath: process.execPath - }) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - }) - - function verify (body) { - t.doesNotThrow(() => { - const parsed = JSON.parse(body) - const current = parsed.versions['1.2.5'] - t.equal( - current._npmVersion, - require(path.resolve(__dirname, '../../package.json')).version, - 'npm version is correct' - ) - - t.equal( - current._nodeVersion, - process.versions.node, - 'node version is correct' - ) - }, 'converted body back into object') - - return true - } - }) -}) - -test('npm publish --dry-run', (t) => { - setup() - return common.npm([ - 'publish', - '--dry-run', - '--registry=https://example.registry/fake', - '--cache', common.cache, - '--loglevel=notice', - '--no-color' - ], {'cwd': testDir}) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - t.match(stderr, /notice\s+\d+[a-z]+\s+package\.json/gi, 'mentions package.json') - t.match(stderr, /notice\s+\d+[a-z]+\s+index\.js/gi, 'mentions index.js') - }) -}) - -test('npm publish --json', (t) => { - setup() - return withServer((server) => { - server.filteringRequestBody(() => true) - .put('/publish-organized', true) - .reply(201, {ok: true}) - return common.npm([ - 'publish', - '--json', - '--registry', common.registry.replace(common.port, server.port), - '--cache', common.cache - ], {'cwd': testDir}) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - t.similar(JSON.parse(stdout), { - name: 'publish-organized', - version: '1.2.5', - files: [ - {path: 'index.js'}, - {path: 'package.json'} - ], - entryCount: 2 - }, 'JSON output reflects package contents') - t.equal(stderr.trim(), '', 'nothing on stderr') - }) - }) -}) - -test('npm publish --dry-run --json', (t) => { - setup() - return common.npm([ - 'publish', - '--dry-run', - '--json', - '--registry=https://example.registry/fake', - '--cache', common.cache, - '--loglevel=notice', - '--no-color' - ], {'cwd': testDir}) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - t.similar(JSON.parse(stdout), { - name: 'publish-organized', - version: '1.2.5', - files: [ - {path: 'index.js'}, - {path: 'package.json'} - ], - entryCount: 2 - }, 'JSON output reflects package contents') - t.equal(stderr.trim(), '', 'nothing on stderr') - }) -}) diff --git a/test/tap/pwd-prefix.js b/test/tap/pwd-prefix.js deleted file mode 100644 index 1b59f5c838cc8..0000000000000 --- a/test/tap/pwd-prefix.js +++ /dev/null @@ -1,35 +0,0 @@ -// This test ensures that a few commands do the same -// thing when the cwd is where package.json is, and when -// the package.json is one level up. - -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var root = path.resolve(__dirname, '../..') -var lib = path.resolve(root, 'lib') -var commands = ['run', 'version'] - -commands.forEach(function (cmd) { - // Should get the same stdout and stderr each time - var stdout, stderr - - test(cmd + ' in root', function (t) { - common.npm([cmd], {cwd: root}, function (er, code, so, se) { - if (er) throw er - t.notOk(code, 'npm ' + cmd + ' exited with code 0') - stdout = so - stderr = se - t.end() - }) - }) - - test(cmd + ' in lib', function (t) { - common.npm([cmd], {cwd: lib}, function (er, code, so, se) { - if (er) throw er - t.notOk(code, 'npm ' + cmd + ' exited with code 0') - t.equal(so, stdout) - t.equal(se, stderr) - t.end() - }) - }) -}) diff --git a/test/tap/repo.js b/test/tap/repo.js deleted file mode 100644 index 75e1017270246..0000000000000 --- a/test/tap/repo.js +++ /dev/null @@ -1,212 +0,0 @@ -var common = require('../common-tap.js') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var rimraf = require('rimraf') -var fs = require('fs') -var path = require('path') -var fakeBrowser = path.join(__dirname, '_script.sh') -var outFile = path.join(__dirname, '/_output') - -var opts = { cwd: __dirname } - -common.pendIfWindows('This is trickier to convert without opening new shells') - -test('setup', function (t) { - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + JSON.stringify(__dirname) + '/_output\n' - fs.writeFileSync(fakeBrowser, s, 'ascii') - fs.chmodSync(fakeBrowser, '0755') - t.pass('made script') - t.end() -}) - -test('npm repo underscore', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'underscore', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/jashkenas/underscore\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo optimist - github (https://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'optimist', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/substack/node-optimist\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo npm-test-peer-deps - no repo', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'npm-test-peer-deps', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 1, 'exit not ok') - s.close() - t.end() - }) - }) -}) - -test('npm repo test-repo-url-http - non-github (http://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'test-repo-url-http', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'http://gitlab.com/evanlucas/test-repo-url-http\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo test-repo-url-https - non-github (https://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'test-repo-url-https', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-https\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo test-repo-url-ssh - non-github (ssh://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'test-repo-url-ssh', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-ssh\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -/* ----- Test by new mock registry: BEGIN ----- */ - -const Tacks = require('tacks') -const mockTar = require('../util/mock-tarball.js') - -const { Dir, File } = Tacks -const testDir = path.join(__dirname, path.basename(__filename, '.js')) - -let server -test('setup mocked registry', t => { - common.fakeRegistry.compat({}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('npm repo test-repo-with-directory', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}) - })) - fixture.create(testDir) - const packument = { - name: 'test-repo-with-directory', - 'dist-tags': { latest: '1.2.3' }, - versions: { - '1.2.3': { - name: 'test-repo-with-directory', - version: '1.2.3', - dist: { - tarball: `${server.registry}/test-repo-with-directory/-/test-repo-with-directory-1.2.3.tgz` - }, - repository: { - type: 'git', - url: 'git+https://github.com/foo/test-repo-with-directory.git', - directory: 'some/directory' - } - } - } - } - server.get('/test-repo-with-directory').reply(200, packument) - return mockTar({ - 'package.json': JSON.stringify({ - name: 'test-repo-with-directory', - version: '1.2.3' - }) - }).then(tarball => { - server.get('/test-repo-with-directory/-/test-repo-with-directory-1.2.3.tgz').reply(200, tarball) - return common.npm([ - 'repo', 'test-repo-with-directory', - '--registry=' + server.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ]) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0) - t.comment(stdout) - t.comment(stderr) - - const res = fs.readFileSync(outFile, 'ascii') - t.equal(res, 'https://github.com/foo/test-repo-with-directory/tree/master/some/directory\n') - rimraf.sync(outFile) - }) -}) - -test('cleanup mocked registry', t => { - server.close() - rimraf.sync(testDir) - t.end() -}) - -/* ----- Test by new mock registry: END ----- */ - -test('cleanup', function (t) { - fs.unlinkSync(fakeBrowser) - t.pass('cleaned up') - t.end() -}) diff --git a/test/tap/retry-on-stale-cache.js b/test/tap/retry-on-stale-cache.js deleted file mode 100644 index 7e3d291a5bdd7..0000000000000 --- a/test/tap/retry-on-stale-cache.js +++ /dev/null @@ -1,195 +0,0 @@ -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test -var common = require('../common-tap') -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -var workdir = common.pkg -var cachedir = common.cache -var modulesdir = path.join(workdir, 'modules') -var oldModule = path.join(modulesdir, 'good-night-0.1.0.tgz') -var newModule = path.join(modulesdir, 'good-night-1.0.0.tgz') - -var config = [ - '--cache', cachedir, - '--prefix', workdir, - '--registry', common.registry -] - -var fixture = new Tacks(Dir({ - 'modules': Dir({ - 'good-night-0.1.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed934f4bc43010c57beea7187a59056dd36eff80' + - 'de85050541c1f3d8c634da4e4a925a8af8dd6db7bb8ba0e0c15559e9eff2' + - '206f929909bc06f327143c6826f51f8d2267cf30c6d2388641c32c61ef75' + - '4d9426e084519a25491645cbcc61e192c5d1e0ef7b90cf688d453d8cf2dd' + - '77a65d60a707c28b0b031e61cdbd33f08452c52949515aef64729eb93652' + - 'd168323ff4d9f6bce026d7b2b11bafef11b1eb3a221a2aa6126c6da9f4e8' + - '5e691f6e908a1a697b5ff346196995eec7023399c1c7fe95cc3999f57077' + - 'b717d7979efbeafef5a7fd2336b90f6a943484ff477a7c917f96c5bbfc87' + - '493ae63f627138e7ff37c815195571bf52e268b1820e0d0825498055d069' + - '6939d8521ab86f2dace0815715a0a9386f16c7e7730c676666660e9837c0' + - 'f6795d000c0000', - 'hex' - )), - 'good-night-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed954d6bc24010863dfb2bb6b9a8503793b849a0' + - 'eda5979efa052d484184252e495a331b76d78a94fef76e8cf683163cd42a' + - '957d2e03796777268187543c7de299f0aba6d2472db1b5650020668cd81a' + - '24117cae4bc23822ad208c93284a1208c216040318c436dff6223f31d386' + - '2bbbca6fef69de85bcd77fc24b9b583ce4a5f04e88974939e96391e5c63b' + - '6e9267a17421b10e030a14d6cf2742a7aaa8cc2a5b2c38e7f3f91c116d47' + - 'd3c2672697aa4eaf1425771c2725c7f579252aa90b23d5a26ed04de87f9f' + - '3f2d52817ab9dcf0fee2f6d26bbfb6f7fdd10e8895f77ec90bb4f2ffc98c' + - '0dfe439c7cf81fc4b5ff213070feef8254a2965341a732eb76b4cef39c12' + - 'e456eb52d82a29198dc637639f9c751fce8796eba35ea777ea0c3c14d6fe' + - '532314f62ba9ccf6676cf21fbefcff59ed3f4b22e7ff2e60110bc37d2fe1' + - '70381c8e9df306642df14500100000', - 'hex' - )) - }) -})) - -var server - -// In this test we mock a situation where the user has a package in his cache, -// a newer version of the package is published, and the user tried to install -// said new version while requestion that the cache be used. -// npm should see that it doesn't have the package in its cache and hit the -// registry. -var onlyOldMetadata = { - 'name': 'good-night', - 'dist-tags': { - 'latest': '0.1.0' - }, - 'versions': { - '0.1.0': { - 'name': 'good-night', - 'version': '0.1.0', - 'dist': { - 'shasum': '2a746d49dd074ba0ec2d6ff13babd40c658d89eb', - 'tarball': 'http://localhost:' + common.port + '/good-night/-/good-night-0.1.0.tgz' - } - } - } -} - -var oldAndNewMetadata = Object.assign({}, onlyOldMetadata) -oldAndNewMetadata['dist-tags'] = { latest: '1.0.0' } -oldAndNewMetadata.versions = Object.assign({ - '1.0.0': { - 'name': 'good-night', - 'version': '1.0.0', - 'dist': { - 'shasum': 'f377bf002a0a8fc4085d347a160a790b76896bc3', - 'tarball': 'http://localhost:' + common.port + '/good-night/-/good-night-1.0.0.tgz' - } - } -}, oldAndNewMetadata.versions) - -function setup () { - cleanup() - fixture.create(workdir) -} - -function cleanup () { - fixture.remove(workdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('setup initial server', function (t) { - mr({ - port: common.port, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - - server.get('/good-night') - .many({ min: 1, max: 1 }) - .reply(200, onlyOldMetadata) - server.get('/good-night/-/good-night-0.1.0.tgz') - .many({ min: 1, max: 1 }) - .replyWithFile(200, oldModule) - - t.end() - }) -}) - -test('install initial version', function (t) { - common.npm(config.concat([ - 'install', 'good-night' - ]), {stdio: 'inherit'}, function (err, code) { - if (err) throw err - t.is(code, 0, 'initial install succeeded') - server.done() - t.end() - }) -}) - -test('cleanup initial server', function (t) { - server.close() - t.end() -}) - -test('setup new server', function (t) { - mr({ - port: common.port, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - - server.get('/good-night') - .many({ min: 1, max: 1 }) - .reply(200, oldAndNewMetadata) - - server.get('/good-night/-/good-night-1.0.0.tgz') - .many({ min: 1, max: 1 }) - .replyWithFile(200, newModule) - - t.end() - }) -}) - -test('install new version', function (t) { - common.npm(config.concat([ - '--prefer-offline', - 'install', 'good-night@1.0.0' - ]), {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stderr, '', 'no error output') - t.is(code, 0, 'install succeeded') - - t.end() - }) -}) - -test('install does not hit server again', function (t) { - // The mock server route definitions ensure we don't hit the server again - common.npm(config.concat([ - '--prefer-offline', - '--parseable', - 'install', 'good-night' - ]), {stdio: [0, 'pipe', 2]}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'install succeeded') - - t.match(stdout, /^update\tgood-night\t1.0.0\t/, 'installed latest version') - server.done() - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) diff --git a/test/tap/run-script-filter-private.js b/test/tap/run-script-filter-private.js deleted file mode 100644 index 31f1912fd103a..0000000000000 --- a/test/tap/run-script-filter-private.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var opts = { cwd: pkg } - -var json = { - name: 'run-script-filter-private', - version: '1.2.3' -} - -var npmrc = '//blah.com:_harsh=realms\n' - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - fs.writeFileSync( - path.resolve(pkg, '.npmrc'), - npmrc - ) - t.end() -}) - -test('npm run-script env', function (t) { - common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'using default env script') - t.notOk(stderr, 'should not generate errors') - t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') - t.notMatch(stdout, /harsh/, 'unexpected config not there') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/run-script.js b/test/tap/run-script.js deleted file mode 100644 index 52798c03a3d81..0000000000000 --- a/test/tap/run-script.js +++ /dev/null @@ -1,374 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test -var rimraf = require('rimraf') - -var common = require('../common-tap') - -var pkg = common.pkg -var cache = common.cache -var tmp = path.resolve(pkg, 'tmp') - -var opts = { cwd: pkg } - -var fullyPopulated = { - 'name': 'runscript', - 'version': '1.2.3', - 'scripts': { - 'start': 'node -e "console.log(process.argv[1] || \'start\')"', - 'prewith-pre': 'node -e "console.log(process.argv[1] || \'pre\')"', - 'with-pre': 'node -e "console.log(process.argv[1] || \'main\')"', - 'with-post': 'node -e "console.log(process.argv[1] || \'main\')"', - 'postwith-post': 'node -e "console.log(process.argv[1] || \'post\')"', - 'prewith-both': 'node -e "console.log(process.argv[1] || \'pre\')"', - 'with-both': 'node -e "console.log(process.argv[1] || \'main\')"', - 'postwith-both': 'node -e "console.log(process.argv[1] || \'post\')"', - 'stop': 'node -e "console.log(process.argv[1] || \'stop\')"', - 'env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', - 'npm-env-vars': 'node -e "console.log(process.env.npm_run_script_foo_var)"', - 'package-env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', - 'prefixed-package-env-vars': 'node -e "console.log(process.env.npm_package_run_script_foo_var)"' - }, - 'run_script_foo_var': 'run_script_test_foo_val' -} - -var lifecycleOnly = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'prestart': 'echo prestart' - } -} - -var directOnly = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'whoa': 'echo whoa' - } -} - -var both = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'prestart': 'echo prestart', - 'whoa': 'echo whoa' - } -} - -var preversionOnly = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'preversion': 'echo preversion' - } -} - -var exitCode = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'start': 'node -e "process.exit(7)"' - } -} - -var shell = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'start': 'echo foo' - } -} - -function testOutput (t, command, er, code, stdout, stderr) { - var lines - - if (er) throw er - - if (stderr) { - throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) - } - - lines = stdout.trim().split('\n') - stdout = lines.filter(function (line) { - return line.trim() !== '' && line[0] !== '>' - }).join(';') - - t.equal(stdout, command) - t.end() -} - -function writeMetadata (object) { - fs.writeFileSync( - path.resolve(pkg, 'package.json'), - JSON.stringify(object, null, 2) + '\n' - ) -} - -function cleanup () { - rimraf.sync(pkg) -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - mkdirp.sync(tmp) - writeMetadata(fullyPopulated) - t.end() -}) - -test('npm run-script start', function (t) { - common.npm(['run-script', 'start'], opts, testOutput.bind(null, t, 'start')) -}) - -test('npm run-script with args', function (t) { - common.npm(['run-script', 'start', '--', 'stop'], opts, testOutput.bind(null, t, 'stop')) -}) - -test('npm run-script with args that contain spaces', function (t) { - common.npm(['run-script', 'start', '--', 'hello world'], opts, testOutput.bind(null, t, 'hello world')) -}) - -test('npm run-script with args that contain single quotes', function (t) { - common.npm(['run-script', 'start', '--', 'they"re awesome'], opts, testOutput.bind(null, t, 'they"re awesome')) -}) - -test('npm run-script with args that contain double quotes', function (t) { - common.npm(['run-script', 'start', '--', 'what"s "up"?'], opts, testOutput.bind(null, t, 'what"s "up"?')) -}) - -test('npm run-script with args that contain ticks', function (t) { - common.npm(['run-script', 'start', '--', 'what\'s \'up\'?'], opts, testOutput.bind(null, t, 'what\'s \'up\'?')) -}) - -test('npm run-script with pre script', function (t) { - common.npm(['run-script', 'with-post'], opts, testOutput.bind(null, t, 'main;post')) -}) - -test('npm run-script with post script', function (t) { - common.npm(['run-script', 'with-pre'], opts, testOutput.bind(null, t, 'pre;main')) -}) - -test('npm run-script with both pre and post script', function (t) { - common.npm(['run-script', 'with-both'], opts, testOutput.bind(null, t, 'pre;main;post')) -}) - -test('npm run-script with both pre and post script and with args', function (t) { - common.npm(['run-script', 'with-both', '--', 'an arg'], opts, testOutput.bind(null, t, 'pre;an arg;post')) -}) - -test('npm run-script explicitly call pre script with arg', function (t) { - common.npm(['run-script', 'prewith-pre', '--', 'an arg'], opts, testOutput.bind(null, t, 'an arg')) -}) - -test('npm run-script test', function (t) { - common.npm(['run-script', 'test'], opts, function (er, code, stdout, stderr) { - t.match(stderr, /npm ERR! missing script: test/) - t.ifError(er, 'npm run-script test ran without issue') - t.ok(stderr, 'should generate errors') - t.end() - }) -}) - -test('npm run-script env', function (t) { - common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'using default env script') - t.notOk(stderr, 'should not generate errors') - t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') - t.end() - }) -}) - -test('npm run-script nonexistent-script', function (t) { - common.npm(['run-script', 'nonexistent-script'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'npm run-script nonexistent-script did not cause npm to explode') - t.ok(stderr, 'should generate errors') - t.end() - }) -}) - -test('npm run-script restart when there isn\'t restart', function (t) { - common.npm(['run-script', 'restart'], opts, testOutput.bind(null, t, 'stop;start')) -}) - -test('npm run-script nonexistent-script with --if-present flag', function (t) { - common.npm(['run-script', '--if-present', 'nonexistent-script'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'npm run-script --if-present non-existent-script ran without issue') - t.notOk(stderr, 'should not generate errors') - t.end() - }) -}) - -test('npm run-script env vars accessible', function (t) { - process.env.run_script_foo_var = 'run_script_test_foo_val' - common.npm(['run-script', 'env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.match(stdout, - new RegExp(process.env.run_script_foo_var), - 'script had env access') - t.end() - }) -}) - -test('npm run-script package.json vars injected', function (t) { - common.npm(['run-script', 'package-env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.match(stdout, - new RegExp(fullyPopulated.run_script_foo_var), - 'script injected package.json value') - t.end() - }) -}) - -test('npm run-script package.json vars injected with prefix', function (t) { - common.npm(['run-script', 'prefixed-package-env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.match(stdout, - new RegExp(fullyPopulated.run_script_foo_var), - 'script injected npm_package-prefixed package.json value') - t.end() - }) -}) - -test('npm run-script env vars stripped npm-prefixed', function (t) { - process.env.npm_run_script_foo_var = 'run_script_test_foo_val' - common.npm(['run-script', 'npm-env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.notMatch(stdout, - new RegExp(process.env.npm_run_script_foo_var), - 'script stripped npm-prefixed env var') - t.end() - }) -}) - -test('npm run-script no-params (lifecycle only)', function (t) { - var expected = [ - 'Lifecycle scripts included in scripted:', - ' prestart', - ' echo prestart', - '' - ].join('\n') - - writeMetadata(lifecycleOnly) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script no-params (preversion only)', function (t) { - var expected = [ - 'Lifecycle scripts included in scripted:', - ' preversion', - ' echo preversion', - '' - ].join('\n') - - writeMetadata(preversionOnly) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script no-params (direct only)', function (t) { - var expected = [ - 'Scripts available in scripted via `npm run-script`:', - ' whoa', - ' echo whoa', - '' - ].join('\n') - - writeMetadata(directOnly) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script script-shell config', function (t) { - writeMetadata(shell) - - common.npm(['run-script', 'start', '--script-shell', 'echo'], opts, testOutput.bind(null, t, '-c echo foo')) -}) - -test('npm run-script no-params (direct only)', function (t) { - var expected = [ - 'Lifecycle scripts included in scripted:', - ' prestart', - ' echo prestart', - '', - 'available via `npm run-script`:', - ' whoa', - ' echo whoa', - '' - ].join('\n') - - writeMetadata(both) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script keep non-zero exit code', function (t) { - writeMetadata(exitCode) - - common.npm(['run-script', 'start'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.equal(code, 7, 'got expected exit code') - t.ok(stderr, 'should generate errors') - t.end() - }) -}) - -test('npm run-script nonexistent script and display suggestions', function (t) { - writeMetadata(directOnly) - - common.npm(['run-script', 'whoop'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 1, 'got expected exit code') - t.has(stderr, 'Did you mean this?') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/save-optional.js b/test/tap/save-optional.js deleted file mode 100644 index 9985451684d07..0000000000000 --- a/test/tap/save-optional.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const fs = require('fs') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - stdio: [0, 1, 2], - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'silly' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - example: Dir({ - 'package.json': File({ - name: 'example', - version: '1.0.0' - }) - }), - 'package.json': File({ - name: 'save-optional', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('example', function (t) { - common.npm(['install', '-O', '--package-lock-only', 'file:example'], conf, function (err, code) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const plock = JSON.parse(fs.readFileSync(`${testdir}/package-lock.json`)) - t.like(plock, { dependencies: { example: { optional: true } } }, 'optional status saved') - // your assertions here - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/scope-header.js b/test/tap/scope-header.js deleted file mode 100644 index f4eb7ae12c104..0000000000000 --- a/test/tap/scope-header.js +++ /dev/null @@ -1,160 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var withScope = path.join(testdir, 'with-scope') -var withoutScope = path.join(testdir, 'without-scope') -var onlyProjectScope = path.join(testdir, 'only-project-scope') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' -}) - -var conf = function (cwd) { - return { - cwd: cwd || testdir, - env: env - } -} -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'with-scope': Dir({ - 'package.json': File({ - name: '@example/with-scope', - version: '1.0.0' - }) - }), - 'without-scope': Dir({ - 'package.json': File({ - name: 'without-scope', - version: '1.0.0' - }) - }), - 'only-project-scope': Dir({ - '.npmrc': File('@example:registry=thisisinvalid\n'), - 'package.json': File({ - name: '@example/only-project-scope', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -var scopeHeaderTestGotScope = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'scope-header-test', - version: '1.0.0', - gotScope: true - } - } -} -var scopeHeaderTestNoScope = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'scope-header-test', - version: '1.0.0', - gotScope: false - } - } -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.get('/scope-header-test', { - 'NPM-Scope': '@example' - }).many().reply('200', scopeHeaderTestGotScope) - server.get('/scope-header-test', {}).many().reply('200', scopeHeaderTestNoScope) - t.done() - }) -}) - -test('with-scope', function (t) { - common.npm(['view', '--cache-min=0', 'scope-header-test', 'gotScope'], conf(withScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', 'got version matched to scope header') - t.done() - }) -}) - -test('without-scope', function (t) { - common.npm(['view', '--cache-min=0', 'scope-header-test', 'gotScope'], conf(withoutScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'false', 'got version matched to NO scope header') - t.done() - }) -}) - -test('scope can be forced by having an explicit one', function (t) { - common.npm([ - 'view', - '--cache-min=0', - '--scope=example', - 'scope-header-test', - 'gotScope' - ], conf(withoutScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', 'got version matched to scope header') - t.done() - }) -}) - -test('only the project scope is used', function (t) { - common.npm([ - 'view', - '--cache-min=0', - 'scope-header-test', 'gotScope' - ], conf(onlyProjectScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', 'got version scope') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/scripts-whitespace-windows.js b/test/tap/scripts-whitespace-windows.js deleted file mode 100644 index 9a301dca526d0..0000000000000 --- a/test/tap/scripts-whitespace-windows.js +++ /dev/null @@ -1,88 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg -var tmp = path.resolve(pkg, 'tmp') -var cache = common.cache -var dep = path.resolve(pkg, 'dep') - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'scripts-whitespace-windows', - version: '1.0.0', - description: 'a test', - repository: 'git://github.com/robertkowalski/bogus', - scripts: { - foo: 'foo --title "Analysis of" --recurse -d report src' - }, - dependencies: { - 'scripts-whitespace-windows-dep': '0.0.1' - }, - license: 'WTFPL' -} - -var dependency = { - name: 'scripts-whitespace-windows-dep', - version: '0.0.1', - bin: [ 'bin/foo' ] -} - -var foo = function () { /* -#!/usr/bin/env node - -if (process.argv.length === 8) - console.log('npm-test-fine') -*/ }.toString().split('\n').slice(1, -1).join('\n') - -test('setup', function (t) { - mkdirp.sync(tmp) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'README.md'), - "### THAT'S RIGHT\n" - ) - - mkdirp.sync(path.join(dep, 'bin')) - fs.writeFileSync( - path.join(dep, 'package.json'), - JSON.stringify(dependency, null, 2) - ) - fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) - - common.npm(['i', dep], { - cwd: pkg, - env: Object.assign({ - npm_config_cache: cache, - npm_config_tmp: tmp, - npm_config_prefix: pkg, - npm_config_global: 'false' - }, process.env) - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm i ' + dep + ' finished without error') - t.equal(code, 0, 'npm i ' + dep + ' exited ok') - t.notOk(stderr, 'no output stderr') - t.end() - }) -}) - -test('test', function (t) { - common.npm(['run', 'foo'], EXEC_OPTS, function (err, code, stdout, stderr) { - stderr = stderr.trim() - if (stderr) console.error(stderr) - t.ifErr(err, 'npm run finished without error') - t.equal(code, 0, 'npm run exited ok') - t.notOk(stderr, 'no output stderr: ' + stderr) - stdout = stdout.trim() - t.ok(/npm-test-fine/.test(stdout)) - t.end() - }) -}) diff --git a/test/tap/search.all-package-search.js b/test/tap/search.all-package-search.js deleted file mode 100644 index 9b3b989f9c726..0000000000000 --- a/test/tap/search.all-package-search.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict' - -const cacheFile = require('npm-cache-filename') -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const path = require('path') -const qs = require('querystring') -const Tacks = require('tacks') -const test = require('tap').test - -const {File} = Tacks - -const common = require('../common-tap.js') - -const CACHE_DIR = common.cache -const cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') -const cachePath = path.join(cacheBase, '.cache.json') -const chownr = require('chownr') -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -let server - -test('setup', function (t) { - mkdirp.sync(cacheBase) - fixOwner(CACHE_DIR) - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.pass('all set up') - t.done() - }) -}) - -const searches = [ - { - term: 'cool', - description: 'non-regex search', - location: 103 - }, - { - term: '/cool/', - description: 'regex search', - location: 103 - }, - { - term: 'cool', - description: 'searches name field', - location: 103 - }, - { - term: 'ool', - description: 'excludes matches for --searchexclude', - location: 205, - inject: { - other: { name: 'other', description: 'this is a simple tool' } - }, - extraOpts: ['--searchexclude', 'cool'] - }, - { - term: 'neat lib', - description: 'searches description field', - location: 141, - inject: { - cool: { - name: 'cool', version: '5.0.0', description: 'this is a neat lib' - } - } - }, - { - term: 'foo', - description: 'skips description field with --no-description', - location: 80, - inject: { - cool: { - name: 'cool', version: '5.0.0', description: 'foo bar!' - } - }, - extraOpts: ['--no-description'] - }, - { - term: 'zkat', - description: 'searches maintainers by name', - location: 155, - inject: { - cool: { - name: 'cool', - version: '5.0.0', - maintainers: [{ - name: 'zkat' - }] - } - } - }, - { - term: '=zkat', - description: 'searches maintainers unambiguously by =name', - location: 154, - inject: { - bar: { name: 'bar', description: 'zkat thing', version: '1.0.0' }, - cool: { - name: 'cool', - version: '5.0.0', - maintainers: [{ - name: 'zkat' - }] - } - } - }, - { - term: 'github.com', - description: 'searches projects by url', - location: 205, - inject: { - bar: { - name: 'bar', - url: 'gitlab.com/bar', - // For historical reasons, `url` is only present if `versions` is there - versions: ['1.0.0'], - version: '1.0.0' - }, - cool: { - name: 'cool', - version: '5.0.0', - versions: ['1.0.0'], - url: 'github.com/cool/cool' - } - } - }, - { - term: 'monad', - description: 'searches projects by keywords', - location: 197, - inject: { - cool: { - name: 'cool', - version: '5.0.0', - keywords: ['monads'] - } - } - } -] - -// These test classic hand-matched searches -searches.forEach(function (search) { - test(search.description, function (t) { - const query = qs.stringify({ - text: search.term, - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(404, {}) - const now = Date.now() - const cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '5.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - for (let k in search.inject) { - cacheContents[k] = search.inject[k] - } - const fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) - fixOwner(cachePath) - common.npm([ - 'search', search.term, - '--registry', common.registry, - '--cache', CACHE_DIR, - '--loglevel', 'error', - '--color', 'always' - ].concat(search.extraOpts || []), - {}, - function (err, code, stdout, stderr) { - t.equal(stderr, '', 'no error output') - t.notEqual(stdout, '', 'got output') - t.equal(code, 0, 'search finished successfully') - t.ifErr(err, 'search finished successfully') - // \033 == \u001B - const markStart = '\u001B\\[[0-9][0-9]m' - const markEnd = '\u001B\\[0m' - - const re = new RegExp(markStart + '.*?' + markEnd) - - const cnt = stdout.search(re) - t.equal( - cnt, - search.location, - search.description + ' search for ' + search.term - ) - t.end() - }) - }) -}) - -test('cleanup', function (t) { - server.done() - server.close() - t.end() -}) diff --git a/test/tap/search.js b/test/tap/search.js deleted file mode 100644 index 049706cc0892d..0000000000000 --- a/test/tap/search.js +++ /dev/null @@ -1,254 +0,0 @@ -'use strict' - -const cacheFile = require('npm-cache-filename') -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const path = require('path') -const qs = require('querystring') -const test = require('tap').test - -const Tacks = require('tacks') -const File = Tacks.File - -const common = require('../common-tap.js') - -// this test uses a fresh cache for each test block -// create them all in common.cache so that we can verify -// them for root-owned files in sudotest -let CACHE_DIR -let cacheBase -let cachePath -let cacheCounter = 1 -function setup () { - CACHE_DIR = common.cache + '/' + cacheCounter++ - cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') - cachePath = path.join(cacheBase, '.cache.json') - mkdirp.sync(cacheBase) - fixOwner(CACHE_DIR) -} - -const chownr = require('chownr') -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -let server - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.pass('all set up') - t.done() - }) -}) - -test('notifies when there are no results', function (t) { - setup() - const query = qs.stringify({ - text: 'none', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [] - }) - common.npm([ - 'search', 'none', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.match(stdout, /No matches found/, 'Useful message on search failure') - t.done() - }) -}) - -test('spits out a useful error when no cache nor network', function (t) { - setup() - const query = qs.stringify({ - text: 'foo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(404, {}) - server.get('/-/all').many().reply(404, {}) - const cacheContents = {} - const fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) - fixOwner(cachePath) - common.npm([ - 'search', 'foo', - '--registry', common.registry, - '--loglevel', 'silly', - '--json', - '--fetch-retry-mintimeout', 0, - '--fetch-retry-maxtimeout', 0, - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'non-zero exit code') - t.match(JSON.parse(stdout).error.summary, /No search sources available/) - t.match(stderr, /No search sources available/, 'useful error') - t.done() - }) -}) - -test('can switch to JSON mode', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'foo', version: '2.0.0' } } - ] - }) - common.npm([ - 'search', 'oo', - '--json', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.similar(JSON.parse(stdout), [ - { - name: 'cool', - version: '1.0.0' - }, - { - name: 'foo', - version: '2.0.0' - } - ], 'results returned as valid json') - t.done() - }) -}) - -test('JSON mode does not notify on empty', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [] - }) - common.npm([ - 'search', 'oo', - '--json', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.deepEquals(JSON.parse(stdout), [], 'no notification about no results') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.done() - }) -}) - -test('can switch to tab separated mode', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'foo', description: 'this\thas\ttabs', version: '2.0.0' } } - ] - }) - common.npm([ - 'search', 'oo', - '--parseable', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stdout, 'cool\t\t\tprehistoric\t1.0.0\t\nfoo\tthis has tabs\t\tprehistoric\t2.0.0\t\n', 'correct output, including replacing tabs in descriptions') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.done() - }) -}) - -test('tab mode does not notify on empty', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [] - }) - common.npm([ - 'search', 'oo', - '--parseable', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stdout, '', 'no notification about no results') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.done() - }) -}) - -test('no arguments provided should error', function (t) { - setup() - common.npm(['search', '--cache', CACHE_DIR], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'search finished unsuccessfully') - - t.match( - stderr, - /search must be called with arguments/, - 'should have correct error message' - ) - t.end() - }) -}) - -test('cleanup', function (t) { - server.done() - server.close() - t.end() -}) diff --git a/test/tap/semver-doc.js b/test/tap/semver-doc.js deleted file mode 100644 index 1cc978201c7a4..0000000000000 --- a/test/tap/semver-doc.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tap').test - -test('semver doc is up to date', function (t) { - var path = require('path') - var moddoc = path.join(__dirname, '../../node_modules/semver/README.md') - var mydoc = path.join(__dirname, '../../docs/content/using-npm/semver.md') - var fs = require('fs') - var mod = fs.readFileSync(moddoc, 'utf8').replace(/semver\(1\)/, 'semver(7)') - var my = fs.readFileSync(mydoc, 'utf8') - t.equal(my, mod) - t.end() -}) diff --git a/test/tap/shared-linked.js b/test/tap/shared-linked.js deleted file mode 100644 index 517be4699d973..0000000000000 --- a/test/tap/shared-linked.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Symlink = Tacks.Symlink -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var mr = require('npm-registry-mock') - -var testdir = common.pkg -var bugdir = path.join(testdir, 'modules', 'bug') - -// This is an absolutely minimal version of the optimist included with -// npm-registry-mock. -var optimist = Dir({ - 'package.json': File({ - dependencies: { - minimist: '~0.0.1', - wordwrap: '~0.0.2' - }, - name: 'optimist', - version: '0.6.0' - }), - node_modules: Dir({ - minimist: Dir({ - 'package.json': File({ - _shasum: 'd7aa327bcecf518f9106ac6b8f003fa3bcea8566', - _resolve: 'foo', - name: 'minimist', - version: '0.0.5' - }) - }), - wordwrap: Dir({ - 'package.json': File({ - _shasum: 'b79669bb42ecb409f83d583cad52ca17eaa1643f', - _resolve: 'foo', - name: 'wordwrap', - version: '0.0.2' - }) - }) - }) -}) - -var fixture = new Tacks( - Dir({ - global: Dir({ - lib: Dir({ - node_modules: Dir({ - linked1: Symlink('../../../modules/linked1/'), - linked2: Symlink('../../../modules/linked2/') - }) - }) - }), - modules: Dir({ - bug: Dir({ - node_modules: Dir({ - linked1: Symlink('../../../global/lib/node_modules/linked1'), - linked2: Symlink('../../../global/lib/node_modules/linked2') - }), - 'package.json': File({ - name: 'bug', - version: '10800.0.0', - devDependencies: { - optimist: '0.6.0', - linked1: '^1.0.0', - linked2: '^1.0.0' - } - }) - }), - linked1: Dir({ - 'package.json': File({ - name: 'linked1', - version: '1.0.0', - devDependencies: { - optimist: '0.6.0' - } - }), - node_modules: Dir({ - optimist: optimist - }) - }), - linked2: Dir({ - 'package.json': File({ - name: 'linked2', - version: '1.0.0', - devDependencies: { - optimist: '0.6.0', - linked1: '^1.0.0' - } - }), - node_modules: Dir({ - linked1: Symlink('../../../global/lib/node_modules/linked1'), - optimist: optimist - }) - }) - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -var server -test('setup', function (t) { - setup() - mr({port: common.port}, function (er, s) { - t.ifError(er) - server = s - t.end() - }) -}) - -test('shared-linked', function (t) { - var options = { - cwd: bugdir, - env: Object.assign({}, process.env, { - npm_config_prefix: path.join(testdir, 'global') - }) - } - var config = [ - '--cache', common.cache, - '--registry', common.registry, - '--unicode', 'false' - ] - - common.npm(config.concat(['install', '--dry-run', '--parseable']), options, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0) - var got = stdout.trim().replace(/\s+\n/g, '\n').replace(/\\/g, '/') - var expected = - 'add\tminimist\t0.0.5\tnode_modules/minimist\n' + - 'add\twordwrap\t0.0.2\tnode_modules/wordwrap\n' + - 'add\toptimist\t0.6.0\tnode_modules/optimist' - t.is(got, expected, 'just an optimist install please') - server.done() - t.end() - }) -}) - -test('cleanup', function (t) { - if (server) server.close() - cleanup() - t.end() -}) diff --git a/test/tap/shrinkwrap-_auth.js b/test/tap/shrinkwrap-_auth.js deleted file mode 100644 index 2987e3eec0ace..0000000000000 --- a/test/tap/shrinkwrap-_auth.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var writeFileSync = require('graceful-fs').writeFileSync - -var mkdirp = require('mkdirp') -var http = require('http') -var ssri = require('ssri') -var t = require('tap') -var test = t.test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') - -var modules = path.resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -var tarballURL = common.registry + tarballPath -var tarball = path.resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') -var tarballIntegrity = ssri.fromData(fs.readFileSync(tarball)).toString() - -var _auth = '0xabad1dea' - -var contents = '_auth=' + _auth + '\n' + - '\'always-auth\'=true\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.0.0' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - lockfileVersion: 1, - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - integrity: tarballIntegrity, - version: '1.3.1' - } - } -} - -var server = http.createServer() -t.teardown(() => server.close()) - -const errors = [] -server.on('request', (req, res) => { - const auth = 'Basic ' + _auth - if (req.method === 'GET' && req.url === tarballPath) { - if (req.headers.authorization === auth) { - res.writeHead(200, 'ok') - res.end(fs.readFileSync(tarball)) - } else { - res.writeHead(403, 'unauthorized') - errors.push("Got authorization of '" + req.headers.authorization + "' expected '" + auth + "'") - res.end() - } - } else { - res.writeHead(500) - errors.push('Unknown request: ' + req.method + ' ' + req.url) - res.end() - } -}) - -test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - path.resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - server.listen(common.port, t.end) -}) - -test('authed npm install with shrinkwrapped global package using _auth', function (t) { - common.npm( - [ - 'install', - '--loglevel', 'error', - '--json', - '--fetch-retries', 0, - '--registry', common.registry, - '--userconfig', outfile - ], - {cwd: pkg, stdio: [0, 'pipe', 2]}, - function (err, code, stdout) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - errors.forEach((err) => t.comment('Error: ' + err)) - try { - var results = JSON.parse(stdout) - t.match(results, {added: [{name: '@scoped/underscore', version: '1.3.1'}]}, '@scoped/underscore installed') - } catch (ex) { - console.error('#', ex) - t.ifError(ex, 'stdout was valid JSON') - } - - t.end() - } - ) -}) diff --git a/test/tap/shrinkwrap-default-dev.js b/test/tap/shrinkwrap-default-dev.js deleted file mode 100644 index cd101092d4e92..0000000000000 --- a/test/tap/shrinkwrap-default-dev.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var fs = require('fs') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' - }) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - '@npmtest': Dir({ - example: Dir({ - 'package.json': File({ - name: '@npmtest/example', - version: '1.0.0' - }) - }) - }) - }), - 'package.json': File({ - name: 'shrinkwrap-default-dev', - version: '1.0.0', - devDependencies: { - '@npmtest/example': '1.0.0' - } - }) - }) -})) - -var shrinkwrapPath = path.join(testdir, 'npm-shrinkwrap.json') -var shrinkwrapWithDev = { - name: 'shrinkwrap-default-dev', - version: '1.0.0', - dependencies: { - '@npmtest/example': { - 'version': '1.0.0', - 'dev': true - } - } -} - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('shrinkwrap-default-dev', function (t) { - common.npm(['shrinkwrap'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var swrap = JSON.parse(fs.readFileSync(shrinkwrapPath)) - t.isDeeply(swrap.dependencies, shrinkwrapWithDev.dependencies, 'Shrinkwrap included dev deps by default') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/test/tap/shrinkwrap-dev-dependency.js b/test/tap/shrinkwrap-dev-dependency.js deleted file mode 100644 index 973cb5435b8f2..0000000000000 --- a/test/tap/shrinkwrap-dev-dependency.js +++ /dev/null @@ -1,70 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var opts = [ - '--cache', common.cache, - '--registry', common.registry -] - -var desired = { - name: 'npm-test-shrinkwrap-dev-dependency', - version: '0.0.0', - dependencies: { - request: { - version: '0.9.0', - resolved: common.registry + '/request/-/request-0.9.0.tgz', - integrity: 'sha1-EEn1mm9GWI5tAwkh+7hMovDCcU4=' - }, - underscore: { - version: '1.3.1', - resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz', - integrity: 'sha1-bLiq0Od+tdu/tUsivNhpcwnPlkE=' - } - } -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-dev-dependency', - version: '0.0.0', - dependencies: { - request: '0.9.0', - underscore: '1.3.1' - }, - devDependencies: { - underscore: '1.5.1' - } -} - -test("shrinkwrap doesn't strip out the dependency", function (t) { - t.plan(3) - - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - process.chdir(pkg) - - mr({port: common.port}, function (er, s) { - common.npm(opts.concat(['install', '.']), {stdio: [0, 'pipe', 2]}, function (err, code) { - if (err) throw err - if (!t.is(code, 0)) return (s.close(), t.end()) - common.npm(opts.concat(['shrinkwrap']), {stdio: [0, 2, 2]}, function (err, code) { - if (err) throw err - t.is(code, 0) - try { - var results = JSON.parse(fs.readFileSync(path.join(pkg, 'npm-shrinkwrap.json'))) - } catch (ex) { - t.comment(ex) - } - t.deepEqual(results.dependencies, desired.dependencies) - s.close() - t.end() - }) - }) - }) -}) diff --git a/test/tap/shrinkwrap-empty-deps.js b/test/tap/shrinkwrap-empty-deps.js deleted file mode 100644 index 3c68845745a94..0000000000000 --- a/test/tap/shrinkwrap-empty-deps.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const fs = require('fs') -const mr = require('npm-registry-mock') -const path = require('path') -const test = require('tap').test - -const pkg = common.pkg - -const EXEC_OPTS = { cwd: pkg } - -const json = { - author: 'Rockbert', - name: 'shrinkwrap-empty-deps', - version: '0.0.0', - dependencies: {}, - devDependencies: {} -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('returns a list of removed items', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'shrinkwrap' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'shrinkwrap ran without issue') - t.notOk(code, 'shrinkwrap ran without raising error code') - - fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, found) { - t.ifError(err, 'read npm-shrinkwrap.json without issue') - t.same( - JSON.parse(found).dependencies, - undefined, - 'shrinkwrap handled empty deps without exploding' - ) - - s.close() - t.end() - }) - } - ) - }) -}) diff --git a/test/tap/shrinkwrap-extra-metadata.js b/test/tap/shrinkwrap-extra-metadata.js deleted file mode 100644 index 6e652e2db0714..0000000000000 --- a/test/tap/shrinkwrap-extra-metadata.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const fs = require('fs') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm.js') -const path = require('path') -const test = require('tap').test - -const pkg = common.pkg - -const json = { - author: 'Rockbert', - name: 'shrinkwrap-extra-metadata', - version: '0.0.0' -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('adds additional metadata fields from the pkglock spec', function (t) { - mr({ port: common.port }, function (er, s) { - t.teardown(() => s.close()) - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'shrinkwrap' - ], - { cwd: pkg, env: { NODE_PRESERVE_SYMLINKS: 'foo' } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'shrinkwrap ran without issue') - t.notOk(code, 'shrinkwrap ran without raising error code') - - fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, desired) { - t.ifError(err, 'read npm-shrinkwrap.json without issue') - t.same( - { - 'name': 'shrinkwrap-extra-metadata', - 'version': '0.0.0', - 'lockfileVersion': npm.lockfileVersion, - 'preserveSymlinks': 'foo' - }, - JSON.parse(desired), - 'shrinkwrap wrote the expected metadata fields' - ) - - t.end() - }) - } - ) - }) -}) diff --git a/test/tap/shrinkwrap-global-auth.js b/test/tap/shrinkwrap-global-auth.js deleted file mode 100644 index e14a328a43a51..0000000000000 --- a/test/tap/shrinkwrap-global-auth.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var writeFileSync = require('graceful-fs').writeFileSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var ssri = require('ssri') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') - -var modules = path.resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -var tarballURL = common.registry + tarballPath -var tarball = path.resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') -var tarballIntegrity = ssri.fromData(fs.readFileSync(tarball)).toString() - -var contents = 'registry=' + common.registry + '\n' + - '_authToken=0xabad1dea\n' + - '\'always-auth\'=true\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.0.0' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - lockfileVersion: 1, - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - integrity: tarballIntegrity, - version: '1.3.1' - } - } -} - -function mocks (server) { - var auth = 'Bearer 0xabad1dea' - server.get(tarballPath, { authorization: auth }).replyWithFile(200, tarball) - server.get(tarballPath).reply(401, { - error: 'unauthorized', - reason: 'You are not authorized to access this db.' - }) -} - -test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - path.resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - mr({ port: common.port, plugin: mocks }, function (er, s) { - t.parent.teardown(() => s.close()) - t.ok(s, 'set up mock registry') - t.end() - }) -}) - -test('authed npm install with shrinkwrapped global package', function (t) { - common.npm( - [ - 'install', - '--loglevel', 'error', - '--json', - '--fetch-retries', 0, - '--userconfig', outfile, - '--registry', common.registry - ], - {cwd: pkg, stdio: [0, 'pipe', 2]}, - function (err, code, stdout) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - try { - var results = JSON.parse(stdout) - t.match(results, {added: [{name: '@scoped/underscore', version: '1.3.1'}]}, '@scoped/underscore installed') - } catch (ex) { - console.error('#', ex) - t.ifError(ex, 'stdout was valid JSON') - } - - t.end() - } - ) -}) diff --git a/test/tap/shrinkwrap-lifecycle-cwd.js b/test/tap/shrinkwrap-lifecycle-cwd.js deleted file mode 100644 index 78f40f5297628..0000000000000 --- a/test/tap/shrinkwrap-lifecycle-cwd.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({}), - 'package.json': File({ - name: '13252', - version: '1.0.0', - scripts: { - // add this to the end of the command to preserve the debug log: - // || mv npm-debug.log real-debug.log - // removed for windows compat reasons - abc: 'node ' + JSON.stringify(common.bin) + ' shrinkwrap', - shrinkwrap: 'node scripts/shrinkwrap.js' - } - }), - scripts: Dir({ - 'shrinkwrap.js': File( - 'console.log("OK " + process.cwd())' - ) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('shrinkwrap-lifecycle-cwd', function (t) { - common.npm(['run', 'abc'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout.trim(), 'OK ' + testdir, 'got output from lifecycle script') - t.is(stderr.trim().length, 0, 'no errors') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/shrinkwrap-lifecycle.js b/test/tap/shrinkwrap-lifecycle.js deleted file mode 100644 index 6e6bc4c2872b2..0000000000000 --- a/test/tap/shrinkwrap-lifecycle.js +++ /dev/null @@ -1,37 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -test('npm shrinkwrap execution order', function (t) { - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Simen Bekkhus', - name: 'shrinkwrap-lifecycle', - shrinkwrap: '0.0.0', - description: 'Test for npm shrinkwrap execution order', - scripts: { - preshrinkwrap: 'echo this happens first', - shrinkwrap: 'echo this happens second', - postshrinkwrap: 'echo this happens third' - } - }), 'utf8') - common.npm(['shrinkwrap', '--loglevel=error'], { cwd: pkg }, function (err, code, stdout, stderr) { - if (err) throw err - - t.comment(stdout) - t.comment(stderr) - var indexOfFirst = stdout.indexOf('echo this happens first') - var indexOfSecond = stdout.indexOf('echo this happens second') - var indexOfThird = stdout.indexOf('echo this happens third') - - t.ok(indexOfFirst >= 0) - t.ok(indexOfSecond >= 0) - t.ok(indexOfThird >= 0) - - t.ok(indexOfFirst < indexOfSecond) - t.ok(indexOfSecond < indexOfThird) - - t.end() - }) -}) diff --git a/test/tap/shrinkwrap-local-dependency.js b/test/tap/shrinkwrap-local-dependency.js deleted file mode 100644 index 5e6d278d30c25..0000000000000 --- a/test/tap/shrinkwrap-local-dependency.js +++ /dev/null @@ -1,124 +0,0 @@ -var test = require('tap').test -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var Tacks = require('tacks') -var unixFormatPath = require('../../lib/utils/unix-format-path.js') -var File = Tacks.File -var Dir = Tacks.Dir - -var testdir = common.pkg -var cachedir = common.cache -var config = ['--cache=' + cachedir, '--loglevel=error'] - -var shrinkwrap = { - name: 'shrinkwrap-local-dependency', - version: '1.0.0', - dependencies: { - mod2: { - version: 'file:' + unixFormatPath(path.join('mods', 'mod2')), - dependencies: { - mod1: { - version: 'file:' + unixFormatPath(path.join('mods', 'mod1')) - } - } - } - } -} - -var fixture = new Tacks( - Dir({ - cache: Dir(), - mods: Dir({ - mod1: Dir({ - 'package.json': File({ - name: 'mod1', - version: '1.0.0' - }) - }), - mod2: Dir({ - 'package.json': File({ - name: 'mod2', - version: '1.0.0', - dependencies: { - mod1: 'file:' + path.join('..', 'mod1') - } - }) - }) - }), - 'package.json': File({ - name: 'shrinkwrap-local-dependency', - version: '1.0.0', - dependencies: { - mod2: 'file:' + path.join('mods', 'mod2') - } - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanNodeModules () { - rimraf.sync(path.resolve(testdir, 'node_modules')) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('shrinkwrap uses resolved with file: on local deps', function (t) { - setup() - - common.npm(config.concat(['install', '--legacy']), {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.equal(code, 0, 'npm exited normally') - - common.npm(config.concat('shrinkwrap'), {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.equal(code, 0, 'npm exited normally') - var data = fs.readFileSync(path.join(testdir, 'npm-shrinkwrap.json'), { encoding: 'utf8' }) - t.like( - JSON.parse(data).dependencies, - shrinkwrap.dependencies, - 'shrinkwrap looks correct' - ) - t.end() - }) - }) -}) - -function exists (file) { - try { - fs.statSync(file) - return true - } catch (ex) { - return false - } -} - -test("'npm install' should install local packages from shrinkwrap", function (t) { - cleanNodeModules() - - common.npm(config.concat(['install']), {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.equal(code, 0, 'npm exited normally') - t.ok(exists(path.join(testdir, 'node_modules', 'mod2')), 'mod2 exists') - t.ok(exists(path.join(testdir, 'node_modules', 'mod2', 'node_modules', 'mod1')), 'mod1 exists') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/shrinkwrap-nested.js b/test/tap/shrinkwrap-nested.js deleted file mode 100644 index bace44d01aa42..0000000000000 --- a/test/tap/shrinkwrap-nested.js +++ /dev/null @@ -1,165 +0,0 @@ -'use strict' -var test = require('tap').test -var Bluebird = require('bluebird') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fs = require('fs') -var path = require('path') -var common = require('../common-tap.js') - -var testdir = common.pkg -var modAtgz = path.resolve(testdir, 'modA') + '-1.0.0.tgz' -var modB1tgz = path.resolve(testdir, 'modB') + '-1.0.0.tgz' -var modB2tgz = path.resolve(testdir, 'modB') + '-2.0.0.tgz' -var modCtgz = path.resolve(testdir, 'modC') + '-1.0.0.tgz' - -var fixture = new Tacks(Dir({ - 'package.json': File({ - dependencies: { - modA: 'file://' + modAtgz, - modC: 'file://' + modCtgz - } - }), - 'npm-shrinkwrap.json': File({ - dependencies: { - modA: { - version: '1.0.0', - resolved: 'file://' + modAtgz - }, - modB: { - version: '1.0.0', - resolved: 'file://' + modB1tgz - } - } - }), - 'modA': Dir({ - 'package.json': File({ - name: 'modA', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB1tgz - } - }) - }), - 'modB@1': Dir({ - 'package.json': File({ - name: 'modB', - version: '1.0.0' - }), - 'B1': File('') - }), - 'modB@2': Dir({ - 'package.json': File({ - name: 'modB', - version: '2.0.0' - }), - 'B2': File('') - }), - 'modC': Dir({ - 'package.json': File({ - name: 'modC', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB2tgz - } - }) - }) -})) - -var newShrinkwrap = new Tacks(Dir({ - 'npm-shrinkwrap.json': File({ - dependencies: { - modA: { - version: '1.0.0', - resolved: 'file://' + modAtgz - }, - modB: { - version: '1.0.0', - resolved: 'file://' + modB1tgz - }, - modC: { - version: '1.0.0', - resolved: 'file://' + modCtgz, - dependencies: { - modB: { - version: '1.0.0', - resolved: 'file://' + modB1tgz - } - } - } - } - }), - 'node_modules': Dir({ - 'modB@1': Dir({ - 'package.json': File({ - _requested: { - name: 'modB', - raw: 'modB@file:' + modB1tgz, - rawSpec: 'file:' + modB1tgz, - scope: null, - spec: modB1tgz, - type: 'directory' - }, - dependencies: { }, - devDependencies: { }, - name: 'modB', - optionalDependencies: { }, - readme: 'ERROR: No README data found!', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - return Bluebird.try(() => { - return Bluebird.join( - common.npm(['pack', 'file:modB@1'], {cwd: testdir, stdio: [0, 2, 2]}), - common.npm(['pack', 'file:modB@2'], {cwd: testdir, stdio: [0, 2, 2]}), - function (b1, b2) { - t.is(b1[0], 0, 'pack modB@1') - t.is(b2[0], 0, 'pack modB@2') - }) - }).then(() => { - return Bluebird.join( - common.npm(['pack', 'file:modA'], {cwd: testdir, stdio: [0, 2, 2]}), - common.npm(['pack', 'file:modC'], {cwd: testdir, stdio: [0, 2, 2]}), - function (a, c) { - t.is(a[0], 0, 'pack modA') - t.is(c[0], 0, 'pack modC') - }) - }).then(() => { - return common.npm(['install'], {cwd: testdir, stdio: [0, 2, 2]}) - }).spread((code) => { - t.is(code, 0, 'top level install') - t.end() - }) -}) - -test('incremental install', function (t) { - newShrinkwrap.create(testdir) - common.npm(['install'], {cwd: testdir, stdio: [0, 2, 2]}, function (err, code) { - if (err) throw err - t.is(code, 0, 'npm itself completed ok') - fs.stat(path.join(testdir, 'node_modules', 'modC', 'node_modules', 'modB', 'B1'), function (missing) { - t.ok(!missing, 'modC got the updated version of modB') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/shrinkwrap-optional-dependency.js b/test/tap/shrinkwrap-optional-dependency.js deleted file mode 100644 index a08d1538490db..0000000000000 --- a/test/tap/shrinkwrap-optional-dependency.js +++ /dev/null @@ -1,91 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -test('shrinkwrap does not fail on missing optional dependency', function (t) { - t.plan(1) - - var mocks = { - get: { - '/random-package': [404, {}] - } - } - - mr({port: common.port, mocks: mocks}, function (er, s) { - t.parent.teardown(() => s.close()) - setup(function (err) { - if (err) { - throw err - } - - // Install without the optional dependency - npm.install('.', function (err) { - if (err) { - throw err - } - - // Pretend the optional dependency was specified, but somehow failed to load: - json.optionalDependencies = { - 'random-package': '0.0.0' - } - writePackage() - - npm.commands.shrinkwrap([], true, function (err, results) { - if (err) { - throw err - } - - t.deepEqual(results.dependencies, desired.dependencies) - s.close() - t.end() - }) - }) - }) - }) -}) - -var desired = { - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': { - version: '0.0.0', - resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz', - integrity: 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=' - } - } -} - -var json = { - author: 'Maximilian Antoni', - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': '0.0.0' - } -} - -function writePackage () { - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup (cb) { - mkdirp.sync(pkg) - writePackage() - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry, - cwd: pkg - } - npm.load(opts, cb) -} diff --git a/test/tap/shrinkwrap-optional-platform.js b/test/tap/shrinkwrap-optional-platform.js deleted file mode 100644 index f5b87d2f8d445..0000000000000 --- a/test/tap/shrinkwrap-optional-platform.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - mod1: Dir({ - 'package.json': File({ - name: 'mod1', - version: '1.0.0', - scripts: {}, - 'optionalDependencies': { - 'mod2': 'file:../mod2' - }, - os: ['nosuchos'] - }) - }), - mod2: Dir({ - 'package.json': File({ - name: 'mod2', - version: '1.0.0', - scripts: {}, - os: ['nosuchos'] - }) - }), - 'npm-shrinkwrap.json': File({ - name: 'shrinkwrap-optional-platform', - version: '1.0.0', - dependencies: { - mod1: { - version: '1.0.0', - resolved: 'file:mod1', - optional: true - }, - mod2: { - version: '1.0.0', - resolved: 'file:mod2', - optional: true - } - } - }), - 'package.json': File({ - name: 'shrinkwrap-optional-platform', - version: '1.0.0', - optionalDependencies: { - mod1: 'file:mod1' - }, - description: 'x', - repository: 'x', - license: 'Artistic-2.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('example', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.notMatch(stderr, /Exit status 1/, 'did not try to install opt dep') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/test/tap/shrinkwrap-optional-property.js b/test/tap/shrinkwrap-optional-property.js deleted file mode 100644 index c2dc8585aec1c..0000000000000 --- a/test/tap/shrinkwrap-optional-property.js +++ /dev/null @@ -1,87 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -test('shrinkwrap adds optional property when optional dependency', function (t) { - t.plan(1) - - mr({port: common.port}, function (er, s) { - t.parent.teardown(() => s.close()) - setup(function (err) { - if (err) { - throw err - } - - // Install with the optional dependency - npm.install('.', function (err) { - if (err) { - throw err - } - - writePackage() - - npm.commands.shrinkwrap([], true, function (err, results) { - if (err) { - throw err - } - - t.deepEqual(results.dependencies, desired.dependencies) - s.close() - t.end() - }) - }) - }) - }) -}) - -var desired = { - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': { - version: '0.0.0', - resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz', - integrity: 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=' - }, - 'underscore': { - version: '1.3.3', - resolved: 'http://localhost:' + common.port + '/underscore/-/underscore-1.3.3.tgz', - optional: true, - integrity: 'sha1-R6xTaD2vgyv6lS4XdEF9pHgXrkI=' - } - } -} - -var json = { - author: 'Maximilian Antoni', - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': '0.0.0' - }, - optionalDependencies: { - 'underscore': '1.3.3' - } -} - -function writePackage () { - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup (cb) { - writePackage() - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry - } - npm.load(opts, cb) -} diff --git a/test/tap/shrinkwrap-prod-dependency-also.js b/test/tap/shrinkwrap-prod-dependency-also.js deleted file mode 100644 index 1e4e9d7438a2c..0000000000000 --- a/test/tap/shrinkwrap-prod-dependency-also.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var opts = [ - '--cache=' + common.cache, - '--registry=' + common.registry -] - -function reportOutput (t, fh, out) { - var trimmed = out.trim() - if (!trimmed.length) return - var prefix = fh + '> ' - t.comment(prefix + trimmed.split(/\n/).join('\n' + prefix)) -} - -var desired = { - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: { - version: '0.9.0', - resolved: common.registry + '/request/-/request-0.9.0.tgz', - integrity: 'sha1-EEn1mm9GWI5tAwkh+7hMovDCcU4=' - }, - underscore: { - dev: true, - version: '1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', - integrity: 'sha1-0r3oF9F2/63olKtxRY5oKhS4bck=' - } - } -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: '0.9.0' - }, - devDependencies: { - underscore: '1.5.1' - } -} - -test("shrinkwrap --also=development doesn't strip out prod dependencies", function (t) { - t.plan(4) - - mr({port: common.port}, function (er, s) { - t.parent.teardown(() => s.close()) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - common.npm(['install', '.'].concat(opts), {cwd: pkg}, function (err, code, stdout, stderr) { - if (err) return t.fail(err) - t.is(code, 0, 'install') - reportOutput(t, 'out', stdout) - reportOutput(t, 'err', stderr) - common.npm(['shrinkwrap', '--also=development'].concat(opts), {cwd: pkg}, function (err, code, stdout, stderr) { - if (err) return t.fail(err) - var ok = t.is(code, 0, 'shrinkwrap') - reportOutput(t, 'out', stdout) - reportOutput(t, 'err', stderr) - if (ok) { - try { - var results = JSON.parse(fs.readFileSync(path.join(pkg, 'npm-shrinkwrap.json'))) - t.pass('read shrinkwrap') - } catch (ex) { - t.ifError(ex, 'read shrinkwrap') - } - } - t.deepEqual( - results.dependencies, - desired.dependencies, - 'results have dev dep' - ) - s.done() - t.end() - }) - }) - }) -}) diff --git a/test/tap/shrinkwrap-prod-dependency.js b/test/tap/shrinkwrap-prod-dependency.js deleted file mode 100644 index bf6d98bf80152..0000000000000 --- a/test/tap/shrinkwrap-prod-dependency.js +++ /dev/null @@ -1,76 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var npm = require('../../') - -var common = require('../common-tap.js') -var pkg = common.pkg - -var desired = { - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: { - version: '0.9.0', - resolved: common.registry + '/request/-/request-0.9.0.tgz', - integrity: 'sha1-EEn1mm9GWI5tAwkh+7hMovDCcU4=' - }, - underscore: { - dev: true, - version: '1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', - integrity: 'sha1-0r3oF9F2/63olKtxRY5oKhS4bck=' - } - } -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: '0.9.0' - }, - devDependencies: { - underscore: '1.5.1' - } -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - process.chdir(pkg) - - var allOpts = { - cache: common.cache, - registry: common.registry - } - - npm.load(allOpts, t.end) -}) - -test('mock registry', t => { - mr({port: common.port}, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test("shrinkwrap --dev doesn't strip out prod dependencies", t => { - t.plan(1) - npm.install('.', function (err) { - if (err) return t.fail(err) - - npm.config.set('dev', true) - npm.commands.shrinkwrap([], true, function (err, results) { - if (err) return t.fail(err) - - t.deepEqual(results.dependencies, desired.dependencies) - t.end() - }) - }) -}) diff --git a/test/tap/shrinkwrap-resolve-conflict.js b/test/tap/shrinkwrap-resolve-conflict.js deleted file mode 100644 index d1f63f7e62661..0000000000000 --- a/test/tap/shrinkwrap-resolve-conflict.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap.js') -const fs = BB.promisifyAll(require('fs')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const test = require('tap').test -const Tacks = require('tacks') - -const File = Tacks.File -const Dir = Tacks.Dir - -const testDir = common.pkg -const modAdir = path.resolve(testDir, 'modA') -const modBdir = path.resolve(testDir, 'modB') -const modCdir = path.resolve(testDir, 'modC') - -test('conflicts in shrinkwrap are auto-resolved on install', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File({ - name: 'foo', - dependencies: { - modA: 'file://' + modAdir, - modB: 'file://' + modBdir - }, - devDependencies: { - modC: 'file://' + modCdir - } - }), - 'npm-shrinkwrap.json': File( - ` -{ - "name": "foo", - "requires": true, - "lockfileVersion": 1, - "dependencies": { -<<` + `<<` + `<<` + `< HEAD - "modA": { - "version": "file:modA" -||` + `||` + `||` + `| merged common ancestors - "modB": { - "version": "file:modB" -==` + `==` + `==` + `= - "modC": { - "version": "file:modC", - "dev": true ->>` + `>>` + `>>` + `> branch - } - } -} -`), - 'modA': Dir({ - 'package.json': File({ - name: 'modA', - version: '1.0.0' - }) - }), - 'modB': Dir({ - 'package.json': File({ - name: 'modB', - version: '1.0.0' - }) - }), - 'modC': Dir({ - 'package.json': File({ - name: 'modC', - version: '1.0.0' - }) - }) - })) - fixture.create(testDir) - function readJson (file) { - return fs.readFileAsync(path.join(testDir, file)).then(JSON.parse) - } - return BB.fromNode((cb) => { - common.npm([ - 'install', - '--loglevel', 'warn' - ], {cwd: testDir}, (err, code, out, stderr) => { - t.comment(stderr) - t.match(stderr, /warn.*conflict/gi, 'warns about a conflict') - cb(err || (code && new Error('non-zero exit code')) || null, out) - }) - }) - .then(() => BB.join( - readJson('npm-shrinkwrap.json'), - readJson('node_modules/modA/package.json'), - readJson('node_modules/modB/package.json'), - readJson('node_modules/modC/package.json'), - (lockfile, A, B, C) => { - t.deepEqual(lockfile, { - name: 'foo', - requires: true, - lockfileVersion: 1, - dependencies: { - modA: { - version: 'file:modA' - }, - modB: { - version: 'file:modB' - }, - modC: { - version: 'file:modC', - dev: true - } - } - }, 'resolved lockfile matches expectations') - t.equal(A.name, 'modA', 'installed modA') - t.equal(B.name, 'modB', 'installed modB') - t.equal(C.name, 'modC', 'installed modC') - } - )) -}) - -test('cleanup', () => rimraf(testDir)) diff --git a/test/tap/shrinkwrap-save-dev-with-existing-deps.js b/test/tap/shrinkwrap-save-dev-with-existing-deps.js deleted file mode 100644 index 1c35bf226b913..0000000000000 --- a/test/tap/shrinkwrap-save-dev-with-existing-deps.js +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable camelcase */ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg -var installme = path.join(base, 'installme') -var installme_pkg = path.join(installme, 'package.json') -var example = path.join(base, 'example') -var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') -var example_pkg = path.join(example, 'package.json') -var installed_prod = path.join(example, 'node_modules', 'installed-prod') -var installed_prod_pkg = path.join(installed_prod, 'package.json') -var installed_dev = path.join(example, 'node_modules', 'installed-dev') -var installed_dev_pkg = path.join(installed_dev, 'package.json') - -var EXEC_OPTS = { cwd: example } - -var installme_pkg_json = { - name: 'installme', - version: '1.0.0', - dependencies: {} -} - -var example_pkg_json = { - name: 'example', - version: '1.0.0', - dependencies: { - 'installed-prod': '1.0' - }, - devDependencies: { - 'installed-dev': '1.0' - } -} - -var example_shrinkwrap_json = { - name: 'example', - version: '1.0.0', - dependencies: { - 'installed-prod': { - version: '1.0.0' - }, - 'installed-dev': { - version: '1.0.0' - } - } -} - -var installed_prod_pkg_json = { - _id: 'installed-prod@1.0.0', - _integrity: 'sha1-deadbeef', - _resolved: 'foo', - name: 'installed-prod', - version: '1.0.0' -} - -var installed_dev_pkg_json = { - _id: 'installed-dev@1.0.0', - _integrity: 'sha1-deadbeef', - _resolved: 'foo', - name: 'installed-dev', - version: '1.0.0' -} - -function writeJson (filename, obj) { - mkdirp.sync(path.dirname(filename)) - fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) -} - -test('setup', function (t) { - writeJson(installme_pkg, installme_pkg_json) - writeJson(example_pkg, example_pkg_json) - writeJson(example_shrinkwrap, example_shrinkwrap_json) - writeJson(installed_prod_pkg, installed_prod_pkg_json) - writeJson(installed_dev_pkg, installed_dev_pkg_json) - t.end() -}) - -test('install --save-dev leaves prod deps alone', function (t) { - common.npm(['install', '--save-dev', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { - t.ifError(er, "spawn didn't catch fire") - t.is(code, 0, 'install completed ok') - t.is(stderr, '', 'install completed without error output') - var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) - t.ok(shrinkwrap.dependencies['installed-prod'], "save-dev new install didn't remove prod dep") - t.ok(shrinkwrap.dependencies['installed-dev'], "save-dev new install didn't remove dev dep") - t.ok(shrinkwrap.dependencies.installme, 'save-dev new install DID add new dev dep') - t.end() - }) -}) diff --git a/test/tap/shrinkwrap-save-with-existing-dev-deps.js b/test/tap/shrinkwrap-save-with-existing-dev-deps.js deleted file mode 100644 index acf6ac21014d1..0000000000000 --- a/test/tap/shrinkwrap-save-with-existing-dev-deps.js +++ /dev/null @@ -1,79 +0,0 @@ -/* eslint-disable camelcase */ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var base = common.pkg -var installme = path.join(base, 'installme') -var installme_pkg = path.join(installme, 'package.json') -var example = path.join(base, 'example') -var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') -var example_pkg = path.join(example, 'package.json') -var installed = path.join(example, 'node_modules', 'installed') -var installed_pkg = path.join(installed, 'package.json') - -// Ignore max listeners warnings until that gets fixed -var env = Object.keys(process.env).reduce((set, key) => { - if (!set[key]) set[key] = process.env[key] - return set -}, { NODE_NO_WARNINGS: '1' }) - -var EXEC_OPTS = { cwd: example, env: env } - -var installme_pkg_json = { - name: 'installme', - version: '1.0.0', - dependencies: {} -} - -var example_pkg_json = { - name: 'example', - version: '1.0.0', - dependencies: {}, - devDependencies: { - 'installed': '1.0' - } -} - -var example_shrinkwrap_json = { - name: 'example', - version: '1.0.0', - dependencies: { - installed: { - version: '1.0.0' - } - } -} - -var installed_pkg_json = { - _id: 'installed@1.0.0', - name: 'installed', - version: '1.0.0' -} - -function writeJson (filename, obj) { - mkdirp.sync(path.dirname(filename)) - fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) -} - -test('setup', function (t) { - writeJson(installme_pkg, installme_pkg_json) - writeJson(example_pkg, example_pkg_json) - writeJson(example_shrinkwrap, example_shrinkwrap_json) - writeJson(installed_pkg, installed_pkg_json) - t.end() -}) - -test('install --save leaves dev deps alone', t => - common.npm(['install', '--save', 'file://' + installme], EXEC_OPTS) - .then(([code, stdout, stderr]) => { - t.is(code, 0, 'install completed ok') - t.is(stderr, '', 'install completed without error output') - var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) - t.ok(shrinkwrap.dependencies.installed, "save new install didn't remove dev dep") - t.ok(shrinkwrap.dependencies.installme, 'save new install DID add new dep') - })) diff --git a/test/tap/shrinkwrap-scoped-auth.js b/test/tap/shrinkwrap-scoped-auth.js deleted file mode 100644 index cc1b2270012ec..0000000000000 --- a/test/tap/shrinkwrap-scoped-auth.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var writeFileSync = require('graceful-fs').writeFileSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var ssri = require('ssri') -var test = require('tap').test - -var common = require('../common-tap.js') -var toNerfDart = require('../../lib/config/nerf-dart.js') - -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') -var modules = path.resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -var tarballURL = common.registry + tarballPath -var tarball = path.resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') -var tarballIntegrity = ssri.fromData(fs.readFileSync(tarball)).toString() - -function mocks (server) { - var auth = 'Bearer 0xabad1dea' - server.get(tarballPath, { authorization: auth }).replyWithFile(200, tarball) - server.get(tarballPath).reply(401, { - error: 'unauthorized', - reason: 'You are not authorized to access this db.' - }) -} - -var contents = '@scoped:registry=' + common.registry + '\n' + - toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.0.0' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - lockfileVersion: 1, - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - integrity: tarballIntegrity, - version: '1.3.1' - } - } -} - -test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - path.resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - mr({ port: common.port, plugin: mocks }, function (er, s) { - t.parent.teardown(() => s.close()) - t.ok(s, 'set up mock registry') - t.end() - }) -}) - -test('authed npm install with shrinkwrapped scoped package', function (t) { - common.npm( - [ - 'install', - '--loglevel', 'error', - '--json', - '--fetch-retries', 0, - '--userconfig', outfile, - '--registry', common.registry - ], - {cwd: pkg, stdio: [0, 'pipe', 2]}, - function (err, code, stdout) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - try { - var results = JSON.parse(stdout) - t.match(results, {added: [{name: '@scoped/underscore', version: '1.3.1'}]}, '@scoped/underscore installed') - } catch (ex) { - console.error('#', ex) - t.ifError(ex, 'stdout was valid JSON') - } - - t.end() - } - ) -}) diff --git a/test/tap/shrinkwrap-shared-dev-dependency.js b/test/tap/shrinkwrap-shared-dev-dependency.js deleted file mode 100644 index 5aa331f34cc46..0000000000000 --- a/test/tap/shrinkwrap-shared-dev-dependency.js +++ /dev/null @@ -1,89 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var opts = { - env: common.newEnv().extend({ - npm_config_cache: common.cache, - npm_config_registry: common.registry - }), - stdio: [0, 1, 2], - cwd: pkg -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-shared-dev-dependency', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': '0.0.0' - }, - devDependencies: { - 'test-package': '0.0.0' - } -} - -var server -test('setup', function (t) { - setup() - mr({ port: common.port }, function (er, s) { - if (er) throw er - server = s - t.done() - }) -}) - -var desired = { - name: 'npm-test-shrinkwrap-shared-dev-dependency', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': { - version: '0.0.0', - resolved: common.registry + '/test-package-with-one-dep/-/test-package-with-one-dep-0.0.0.tgz', - integrity: 'sha1-JWwVltusKyPRImjatagCuy42Wsg=' - }, - 'test-package': { - version: '0.0.0', - resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz', - integrity: 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=' - } - } -} - -test("shrinkwrap doesn't strip out the shared dependency", function (t) { - t.plan(3) - - return common.npm(['install'], opts).spread((code) => { - t.is(code, 0, 'install') - return common.npm(['shrinkwrap'], opts) - }).spread((code) => { - t.is(code, 0, 'shrinkwrap') - var results = JSON.parse(fs.readFileSync(`${pkg}/npm-shrinkwrap.json`)) - t.like(results.dependencies, desired.dependencies) - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/test/tap/shrinkwrap-version-match.js b/test/tap/shrinkwrap-version-match.js deleted file mode 100644 index e579f84d4b3bd..0000000000000 --- a/test/tap/shrinkwrap-version-match.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fs = require('fs') -var path = require('path') -var common = require('../common-tap.js') - -var testdir = common.pkg -var modAdir = path.resolve(testdir, 'modA') -var modB1dir = path.resolve(testdir, 'modB@1') -var modB2dir = path.resolve(testdir, 'modB@2') -var modCdir = path.resolve(testdir, 'modC') - -var fixture = new Tacks(Dir({ - 'package.json': File({ - dependencies: { - modA: 'file://' + modAdir - }, - devDependencies: { - modC: 'file://' + modCdir - } - }), - 'npm-shrinkwrap.json': File({ - requires: true, - lockfileVersion: 1, - dependencies: { - modA: { - version: 'file://' + modAdir, - requires: { - modB: 'file://' + modB1dir - } - }, - modB: { - version: 'file://' + modB1dir - } - } - }), - 'modA': Dir({ - 'package.json': File({ - name: 'modA', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB1dir - } - }) - }), - 'modB@1': Dir({ - 'package.json': File({ - name: 'modB', - version: '1.0.0' - }), - 'B1': File('') - }), - 'modB@2': Dir({ - 'package.json': File({ - name: 'modB', - version: '2.0.0' - }), - 'B2': File('') - }), - 'modC': Dir({ - 'package.json': File({ - name: 'modC', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB2dir - } - }) - }) -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -// Shrinkwraps need to let you override dependency versions specified in -// package.json files. Indeed, this was already supported, but it was a bit -// to keen on this. Previously, if you had a dep in your shrinkwrap then -// anything that required that dependency would count as a match, regardless -// of version. - -// This test ensures that the broad matching is not done when the matched -// module is not a direct child of the module doing the requiring. - -test('bundled', function (t) { - common.npm(['install'], {cwd: testdir}, function (err, code, out, stderr) { - t.is(err, null, 'No fatal errors running npm') - t.is(code, 0, 'npm itself completed ok') - // Specifically, if B2 exists (or the modB directory under modC at all) - // that means modC was given its own copy of modB. Without the patch - // that went with this test, it wouldn't have been installed because npm - // would have consider modB@1 to have fulfilled modC's requirement. - fs.stat(path.join(testdir, 'node_modules', 'modC', 'node_modules', 'modB', 'B2'), function (missing) { - t.ok(!missing, 'modC got the right version of modB') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/sorted-package-json.js b/test/tap/sorted-package-json.js deleted file mode 100644 index dd62247d9709a..0000000000000 --- a/test/tap/sorted-package-json.js +++ /dev/null @@ -1,58 +0,0 @@ -var test = require('tap').test -var path = require('path') -var common = require('../common-tap.js') -var pkg = common.pkg -var tmp = path.join(pkg, 'tmp') -var cache = common.cache -var fs = require('fs') -var mr = require('npm-registry-mock') -var packageJson = path.resolve(pkg, 'package.json') - -fs.writeFileSync(packageJson, JSON.stringify({ - 'name': 'sorted-package-json', - 'version': '0.0.0', - 'description': '', - 'main': 'index.js', - 'author': 'Rocko Artischocko', - 'license': 'ISC', - 'dependencies': { - 'underscore': '^1.3.3', - 'request': '^0.9.0' - } -}, null, 2), 'utf8') - -test('sorting dependencies', function (t) { - var before = JSON.parse(fs.readFileSync(packageJson).toString()) - - mr({ port: common.port }, function (er, s) { - // underscore is already in the package.json, - // but --save will trigger a rewrite with sort - common.npm([ - 'install', - '--save', 'underscore@1.3.3', - '--no-progress', - '--cache', cache, - '--tmp', tmp, - '--registry', common.registry - ], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'no error') - t.equal(code, 0, 'npm install exited with code') - var result = fs.readFileSync(packageJson).toString() - var resultAsJson = JSON.parse(result) - - s.close() - - t.same(Object.keys(resultAsJson.dependencies), - Object.keys(before.dependencies).sort()) - - t.notSame(Object.keys(resultAsJson.dependencies), - Object.keys(before.dependencies)) - - t.ok(resultAsJson.dependencies.underscore) - t.ok(resultAsJson.dependencies.request) - t.end() - }) - }) -}) diff --git a/test/tap/spawn-enoent-help.js b/test/tap/spawn-enoent-help.js deleted file mode 100644 index cb7c942be8e7b..0000000000000 --- a/test/tap/spawn-enoent-help.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tap').test -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg - -common.pendIfWindows('man pages are not built on Windows') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - t.end() -}) - -test('enoent help', function (t) { - common.npm(['help', 'config'], { - cwd: pkg, - env: { - PATH: '', - Path: '', - 'npm_config_loglevel': 'warn', - 'npm_config_viewer': 'woman' - } - }, function (er, code, sout, serr) { - t.similar(serr, /Check if the file 'emacsclient' is present./) - t.equal(global.cooked, undefined, "Don't leak into global scope") - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/spawn-enoent.js b/test/tap/spawn-enoent.js deleted file mode 100644 index 78153572eeb70..0000000000000 --- a/test/tap/spawn-enoent.js +++ /dev/null @@ -1,38 +0,0 @@ -var test = require('tap').test -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg -var pj = JSON.stringify({ - name: 'x', - version: '1.2.3', - scripts: { start: 'wharble-garble-blorst' } -}, null, 2) + '\n' - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - fs.writeFileSync(pkg + '/package.json', pj) - t.end() -}) - -test('enoent script', function (t) { - common.npm(['start'], { - cwd: pkg, - env: { - PATH: process.env.PATH, - Path: process.env.Path, - 'npm_config_loglevel': 'warn' - } - }, function (er, code, sout, serr) { - t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script\./) - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/spec-local-specifiers.js b/test/tap/spec-local-specifiers.js deleted file mode 100644 index 6ea65278cda26..0000000000000 --- a/test/tap/spec-local-specifiers.js +++ /dev/null @@ -1,752 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var fs = require('fs') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Symlink = Tacks.Symlink -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var isWindows = require('../../lib/utils/is-windows.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: common.emptyEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' - }), - stdio: [0, 'pipe', 2] -} -var confE = { - cwd: testdir, - env: conf.env, - stdio: [0, 'pipe', 'pipe'] -} - -function readJson (file) { - return JSON.parse(fs.readFileSync(file)) -} - -function isSymlink (t, file, message) { - try { - var info = fs.lstatSync(file) - t.is(info.isSymbolicLink(), true, message) - } catch (ex) { - if (ex.code === 'ENOENT') { - t.fail(message, {found: null, wanted: 'symlink', compare: 'fs.lstat(' + file + ')'}) - } else { - t.fail(message, {found: ex, wanted: 'symlink', compare: 'fs.lstat(' + file + ')'}) - } - } -} - -function fileExists (t, file, message) { - try { - fs.statSync(file) - t.pass(message) - } catch (ex) { - if (ex.code === 'ENOENT') { - t.fail(message, {found: null, wanted: 'exists', compare: 'fs.stat(' + file + ')'}) - } else { - t.fail(message, {found: ex, wanted: 'exists', compare: 'fs.stat(' + file + ')'}) - } - } -} - -function noFileExists (t, file, message) { - try { - fs.statSync(file) - t.fail(message, {found: 'exists', wanted: 'not exists', compare: 'fs.stat(' + file + ')'}) - } catch (ex) { - if (ex.code === 'ENOENT') { - t.pass(message) - } else { - t.fail(message, {found: ex, wanted: 'not exists', compare: 'fs.stat(' + file + ')'}) - } - } -} - -var server -var testdirContent = { - node_modules: Dir({}), - pkga: Dir({ - 'package.json': File({ - name: 'pkga', - version: '1.0.0' - }) - }), - pkgb: Dir({ - 'package.json': File({ - name: 'pkgb', - version: '1.0.0' - }) - }), - pkgc: Dir({ - 'package.json': File({ - name: 'pkgc', - version: '1.0.0' - }) - }), - pkgd: Dir({ - 'package.json': File({ - name: 'pkgd', - version: '1.0.0' - }) - }) -} - -var fixture -function setup () { - fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir(testdirContent) - })) - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - process.nextTick(function () { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) - }) -}) - -var installOk = [] -var slashes = [ 'unix', 'win' ] -slashes.forEach(function (os) { - var slash = os === 'unix' - ? function (ss) { return ss.replace(/\\/g, '/') } - : function (ss) { return ss.replace(/\//g, '\\') } - installOk.push(os + '-file-abs-f') - testdirContent[os + '-file-abs-f'] = Dir({ - 'package.json': File({ - name: os + '-file-abs-f', - version: '1.0.0', - dependencies: { - pkga: 'file:' + slash(testdir + '/pkga') - } - }) - }) - installOk.push(os + '-file-abs-fff') - testdirContent[os + '-file-abs-fff'] = Dir({ - 'package.json': File({ - name: os + '-file-abs-fff', - version: '1.0.0', - dependencies: { - pkga: 'file://' + slash(testdir + '/pkga') - } - }) - }) - installOk.push(os + '-file-rel') - testdirContent[os + '-file-rel'] = Dir({ - 'package.json': File({ - name: os + '-file-rel', - version: '1.0.0', - dependencies: { - pkga: 'file:' + slash('../pkga') - } - }) - }) - installOk.push(os + '-file-rel-fffff') - testdirContent[os + '-file-rel-fffff'] = Dir({ - 'package.json': File({ - name: os + '-file-rel-fffff', - version: '1.0.0', - dependencies: { - pkga: 'file:' + slash('/////../pkga') - } - }) - }) -}) - -testdirContent['win-abs-drive-win'] = Dir({ - 'package.json': File({ - name: 'win-abs-drive-win', - version: '1.0.0', - dependencies: { - pkga: 'file:D:\\thing\\pkga' - } - }) -}) - -testdirContent['win-abs-drive-unix'] = Dir({ - 'package.json': File({ - name: 'win-abs-drive-unix', - version: '1.0.0', - dependencies: { - pkga: 'file://D:/thing/pkga' - } - }) -}) - -test('specifiers', function (t) { - t.plan(installOk.length + 2) - installOk.forEach(function (mod) { - t.test(mod, function (t) { - common.npm(['install', '--dry-run', '--json', 'file:' + mod], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.done() - }) - }) - }) - slashes.forEach(function (os) { - t.test('win-abs-drive-' + os, function (t) { - common.npm(['install', '--dry-run', '--json', 'file:win-abs-drive-' + os], confE, function (err, code, stdout, stderr) { - if (err) throw err - t.not(code, 0, 'command errored ok') - t.comment(stderr.trim()) - if (isWindows) { - t.test('verify failure of file-not-found or wrong drive letter on windows') - } else { - var result = JSON.parse(stdout) - t.is(result.error && result.error.code, 'EWINDOWSPATH', 'verify failure due to windows paths not supported on non-Windows') - } - - t.done() - }) - }) - }) -}) -testdirContent['mkdirp'] = Dir({ - 'package.json': File({ - name: 'mkdirp', - version: '9.9.9' - }) -}) -testdirContent['example'] = Dir({ - 'minimist': Dir({ - 'package.json': File({ - name: 'minimist', - version: '9.9.9' - }) - }) -}) -testdirContent['wordwrap'] = Dir({ -}) -testdirContent['prefer-pkg'] = Dir({ - 'package.json': File({ - name: 'perfer-pkg', - version: '1.0.0', - dependencies: { - 'mkdirp': 'latest' - } - }), - 'latest': Dir({ - 'package.json': File({ - name: 'mkdirp', - version: '9.9.9' - }) - }) -}) - -test('ambiguity', function (t) { - t.plan(5) - t.test('arg: looks like package name, is dir', function (t) { - common.npm(['install', 'mkdirp', '--dry-run', '--json'], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'mkdirp', version: '9.9.9'}]}, 'got local dir') - t.done() - }) - }) - t.test('arg: looks like package name, is package', function (t) { - common.npm(['install', 'wordwrap', '--dry-run', '--json'], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'wordwrap', version: '0.0.2'}]}, 'even with local dir w/o package.json, got global') - t.done() - }) - }) - t.test('arg: looks like github repo, is dir', function (t) { - common.npm(['install', 'example/minimist', '--dry-run', '--json'], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'minimist', version: '9.9.9'}]}, 'got local dir') - t.done() - }) - }) - t.test('package: looks like tag, has dir, use tag', function (t) { - common.npm(['install', '--dry-run', '--json'], {cwd: path.join(testdir, 'prefer-pkg'), env: conf.env}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'mkdirp', version: '0.3.5'}]}, 'got local dir') - t.done() - }) - }) - - t.test('test ambiguity for github repos') -}) -testdirContent['existing-matches'] = Dir({ - 'package.json': File({ - name: 'existing-matches', - version: '1.0.0', - dependencies: { - 'pkga': 'file:../pkga', - 'pkgb': 'file:' + testdir + '/pkgb', - 'pkgc': 'file:../pkgc', - 'pkgd': 'file:' + testdir + '/pkgd' - } - }), - 'node_modules': Dir({ - 'pkga': Symlink('../../pkga'), - 'pkgd': Symlink('../../pkgd') - }) -}) - -test('existing install matches', function (t) { - t.plan(1) - // have to make these by hand because tacks doesn't support absolute paths in symlinks - fs.symlinkSync(testdir + '/pkgb', testdir + '/existing-matches/node_modules/pkgb', 'junction') - fs.symlinkSync(testdir + '/pkgc', testdir + '/existing-matches/node_modules/pkgc', 'junction') - t.test('relative symlink counts as match of relative symlink in package.json', function (t) { - common.npm(['ls', '--json'], {cwd: path.join(testdir, 'existing-matches'), env: conf.env}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - t.test('specifically test that output is valid') - // relative symlink counts as match of relative symlink in package.json (pkga) - // relative symlink counts as match of abs symlink in package.json (pkgc) - // abs symlink counts as match of relative symlink in package.json (pkgb) - // abs symlink counts as match of abs symlink in package.json (pkgd) - t.done() - }) - }) -}) -var ibdir = testdir + '/install-behavior' -testdirContent['ib-out'] = Dir({ - 'package.json': File({ - name: 'ib-out', - version: '1.0.0', - dependencies: { - 'minimist': '*' - } - }) -}) - -testdirContent['install-behavior'] = Dir({ - 'package.json': File({ - name: 'install-behavior', - version: '1.0.0' - }), - 'ib-in': Dir({ - 'package.json': File({ - name: 'ib-in', - version: '1.0.0', - dependencies: { - 'mkdirp': '*' - } - }) - }), - 'noext': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260a20dadccc144c1b1841f86000923334363037343536343732' + - '633000728c0c80f2d4760836505a5c925804740aa5e640bca200a78708a8' + - '56ca4bcc4d55b252cacb4fad2851d251502a4b2d2acecccf030a19ea19e8' + - '1928d5720db41b47c1281805a36014501f00005012007200080000', - 'hex' - )), - 'tarball-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260a20dadccc144c1b1841f8606062a6c060686c606e686a6c68' + - '666ec26000e480e5a9ed106ca0b4b824b108e8144acd817845014e0f1150' + - 'ad9497989baa64a5040c85a4c49c1c251d05a5b2d4a2e2ccfc3ca0a0a19e' + - '819e81522dd740bb72148c8251300a4601b50100473dd15800080000', - 'hex' - )), - 'not-module': Dir({}), - 'test-preinstall': Dir({ - 'preinstall.js': File('console.log("CWD:" + process.cwd())'), - 'package.json': File({ - name: 'test-preinstall', - version: '1.0.0', - scripts: { - 'preinstall': 'node ' + ibdir + '/test-preinstall/preinstall.js' - } - }) - }) -}) - -test('install behavior', function (t) { - var ibconf = {cwd: ibdir, env: conf.env.extend({npm_config_loglevel: 'silent'}), stdio: conf.stdio} - t.plan(7) - t.test('transitive deps for in-larger-module cases', function (t) { - common.npm(['install', 'file:ib-in'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - fileExists(t, ibdir + '/node_modules/mkdirp', 'transitive dep flattened') - isSymlink(t, ibdir + '/node_modules/ib-in', 'dep is symlink') - noFileExists(t, ibdir + '/ib-in/node_modules/mkdirp', 'transitive dep not nested') - t.done() - }) - }) - t.test('transitive deps for out-of-larger module cases', function (t) { - common.npm(['install', 'file:../ib-out'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - noFileExists(t, ibdir + '/node_modules/minimist', 'transitive dep not flattened') - fileExists(t, testdir + '/ib-out/node_modules/minimist', 'transitive dep nested') - t.done() - }) - }) - t.test('transitive deps for out-of-larger module cases w/ --preserve-symlinks', function (t) { - rimraf.sync(ibdir + '/node_modules') - rimraf.sync(testdir + '/ib-out/node_modules') - var env = conf.env.extend({NODE_PRESERVE_SYMLINKS: '1'}) - common.npm(['install', 'file:../ib-out'], {cwd: ibdir, env: env}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - fileExists(t, ibdir + '/node_modules/minimist', 'transitive dep flattened') - noFileExists(t, testdir + '/ib-out/node_modules/minimist', 'transitive dep not nested') - t.done() - }) - }) - t.test('tar/tgz/tar.gz should install a tarball', function (t) { - common.npm(['install', 'file:tarball-1.0.0.tgz'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - fileExists(t, ibdir + '/node_modules/tarball') - t.done() - }) - }) - t.test('non tar/tgz/tar.gz files should give good error message', function (t) { - common.npm(['install', 'file:noext', '--json'], ibconf, function (err, code, stdout) { - if (err) throw err - t.not(code, 0, 'do not install files w/o extensions') - noFileExists(t, ibdir + '/node_modules/noext') - var result = JSON.parse(stdout) - t.like(result, {error: {code: 'ENOLOCAL'}}, 'new type of error') - t.done() - }) - }) - t.test('directories without package.json should give good error message', function (t) { - common.npm(['install', 'file:not-module', '--json'], ibconf, function (err, code, stdout) { - if (err) throw err - t.not(code, 0, 'error on dir w/o module') - var result = JSON.parse(stdout) - t.like(result, {error: {code: 'ENOLOCAL'}}, 'new type of error') - t.done() - }) - }) - t.test('verify preinstall step runs after finalize, such that cwd is as expected', function (t) { - common.npm(['install', 'file:test-preinstall'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - isSymlink(t, `${ibdir}/node_modules/test-preinstall`, 'installed as symlink') - t.notLike(stdout, /CWD:.*[.]staging/, 'cwd should not be in staging') - - t.test('verify that env is as expected') - t.done() - }) - }) -}) -var sbdir = testdir + '/save-behavior' -testdirContent['save-behavior'] = Dir({ - 'package.json': File({ - name: 'save-behavior', - version: '1.0.0' - }), - 'npm-shrinkwrap.json': File({ - name: 'save-behavior', - version: '1.0.0', - dependencies: {} - }), - 'transitive': Dir({ - 'package.json': File({ - name: 'transitive', - version: '1.0.0', - dependencies: { - 'pkgc': 'file:../../pkgc' - } - }) - }) -}) -testdirContent['sb-transitive'] = Dir({ - 'package.json': File({ - name: 'sb-transitive', - version: '1.0.0', - dependencies: { - 'sbta': 'file:sbta' - } - }), - 'sbta': Dir({ - 'package.json': File({ - name: 'sbta', - version: '1.0.0' - }) - }) -}) -var sbdirp = testdir + '/save-behavior-pre' -testdirContent['save-behavior-pre'] = Dir({ - 'package.json': File({ - name: 'save-behavior', - version: '1.0.0' - }), - 'npm-shrinkwrap.json': File({ - name: 'save-behavior', - version: '1.0.0', - dependencies: {} - }) -}) -testdirContent['sb-transitive-preserve'] = Dir({ - 'package.json': File({ - name: 'sb-transitive-preserve', - version: '1.0.0', - dependencies: { - 'sbtb': 'file:sbtb' - } - }), - 'sbtb': Dir({ - 'package.json': File({ - name: 'sbtb', - version: '1.0.0' - }) - }) -}) -test('save behavior', function (t) { - t.plan(6) - var sbconf = {cwd: sbdir, env: conf.env, stdio: conf.stdio} - t.test('to package.json and npm-shrinkwrap.json w/ abs', function (t) { - common.npm(['install', '--save', 'file:' + testdir + '/pkga'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - t.is(pjson.dependencies.pkga, 'file:../pkga', 'package.json') - var sdep = shrinkwrap.dependencies - t.like(sdep, {pkga: {version: 'file:../pkga', resolved: null}}, 'npm-shrinkwrap.json') - t.done() - }) - }) - t.test('to package.json and npm-shrinkwrap.json w/ drive abs') - t.test('to package.json and npm-shrinkwrap.json w/ rel', function (t) { - common.npm(['install', '--save', 'file:../pkgb'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - t.is(pjson.dependencies.pkgb, 'file:../pkgb', 'package.json') - var sdep = shrinkwrap.dependencies - t.like(sdep, {pkgb: {version: 'file:../pkgb', resolved: null}}, 'npm-shrinkwrap.json') - t.done() - }) - }) - t.test('internal transitive dependencies of shrinkwraps', function (t) { - common.npm(['install', '--save', 'file:transitive'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - t.is(pjson.dependencies.transitive, 'file:transitive', 'package.json') - var sdep = shrinkwrap.dependencies.transitive || {} - var tdep = shrinkwrap.dependencies.pkgc - t.is(sdep.version, 'file:transitive', 'npm-shrinkwrap.json direct dep') - t.is(tdep.version, 'file:../pkgc', 'npm-shrinkwrap.json transitive dep') - t.done() - }) - }) - t.test('external transitive dependencies of shrinkwraps', function (t) { - common.npm(['install', '--save', 'file:../sb-transitive'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - var deps = pjson.dependencies || {} - t.is(deps['sb-transitive'], 'file:../sb-transitive', 'package.json') - var sdep = shrinkwrap.dependencies['sb-transitive'] || {} - var tdep = sdep.dependencies.sbta - t.like(tdep, {bundled: null, version: 'file:../sb-transitive/sbta'}, 'npm-shrinkwrap.json transitive dep') - t.like(sdep, {bundled: null, version: 'file:../sb-transitive'}, 'npm-shrinkwrap.json direct dep') - t.done() - }) - }) - t.test('external transitive dependencies of shrinkwraps > preserve symlinks', function (t) { - var preserveEnv = conf.env.extend({NODE_PRESERVE_SYMLINKS: '1'}) - var preserveConf = {cwd: sbdirp, env: preserveEnv, stdio: conf.stdio} - common.npm(['install', '--save', 'file:../sb-transitive-preserve'], preserveConf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdirp + '/package.json') - var shrinkwrap = readJson(sbdirp + '/npm-shrinkwrap.json') - t.is(pjson.dependencies['sb-transitive-preserve'], 'file:../sb-transitive-preserve', 'package.json') - var sdep = shrinkwrap.dependencies['sb-transitive-preserve'] || {} - var tdep = shrinkwrap.dependencies.sbtb - t.like(sdep, {bundled: null, version: 'file:../sb-transitive-preserve'}, 'npm-shrinkwrap.json direct dep') - t.like(tdep, {bundled: null, version: 'file:../sb-transitive-preserve/sbtb'}, 'npm-shrinkwrap.json transitive dep') - t.done() - }) - }) -}) - -var rmdir = testdir + '/remove-behavior' -testdirContent['remove-behavior'] = Dir({ - 'rmsymlink': Dir({ - 'package.json': File({ - name: 'remove-behavior', - version: '1.0.0', - dependencies: { - dep1: 'file:dep1' - } - }), - 'package-lock.json': File({ - name: 'remove-behavior', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - dep1: { - version: 'file:dep1', - requires: { - dep2: 'file:dep2' - }, - dependencies: { - dep2: { - version: 'file:dep2', - bundled: true - } - } - } - } - }), - dep1: Dir({ - 'package.json': File({ - name: 'dep1', - version: '1.0.0', - dependencies: { - dep2: 'file:../dep2' - } - }), - 'node_modules': Dir({ - dep2: Symlink('../../dep2') - }) - }), - dep2: Dir({ - 'package.json': File({ - name: 'dep2', - version: '1.0.0' - }) - }), - 'node_modules': Dir({ - dep1: Symlink('../dep1') - }) - }), - 'rmesymlink': Dir({ - 'package.json': File({ - name: 'remove-behavior', - version: '1.0.0', - dependencies: { - edep1: 'file:../edep1' - } - }), - 'package-lock.json': File({ - name: 'remove-behavior', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - edep1: { - version: 'file:../edep1', - requires: { - edep2: 'file:../edep2' - }, - dependencies: { - edep2: { - version: 'file:../edep2', - bundled: true - } - } - } - } - }), - 'node_modules': Dir({ - edep1: Symlink('../../edep1') - }) - }), - edep1: Dir({ - 'package.json': File({ - name: 'edep1', - version: '1.0.0', - dependencies: { - edep2: 'file:../edep2' - } - }), - 'node_modules': Dir({ - edep2: Symlink('../../edep2') - }) - }), - edep2: Dir({ - 'package.json': File({ - name: 'edep2', - version: '1.0.0' - }) - }) -}) - -test('removal', function (t) { - t.plan(2) - - t.test('should remove the symlink', (t) => { - const rmconf = {cwd: `${rmdir}/rmsymlink`, env: conf.env, stdio: conf.stdio} - return common.npm(['uninstall', 'dep1'], rmconf).spread((code, stdout) => { - t.is(code, 0, 'uninstall ran ok') - t.comment(stdout) - noFileExists(t, `${rmdir}/rmsymlink/node_modules/dep1`, 'removed symlink') - noFileExists(t, `${rmdir}/rmsymlink/dep1/node_modules/dep2`, 'removed transitive dep') - fileExists(t, `${rmdir}/rmsymlink/dep2`, 'original transitive dep still exists') - }) - }) - t.test("should not remove transitive deps if it's outside the package and --preserver-symlinks isn't set", (t) => { - const rmconf = {cwd: `${rmdir}/rmesymlink`, env: conf.env, stdio: conf.stdio} - return common.npm(['uninstall', 'edep1'], rmconf).spread((code, stdout) => { - t.is(code, 0, 'uninstall ran ok') - t.comment(stdout) - noFileExists(t, `${rmdir}/rmsymlink/node_modules/edep1`, 'removed symlink') - fileExists(t, `${rmdir}/edep1/node_modules/edep2`, 'did NOT remove transitive dep') - fileExists(t, `${rmdir}/edep2`, 'original transitive dep still exists') - }) - }) -}) - -test('misc', function (t) { - t.plan(3) - t.test('listing: should look right, not include version') - t.test('outdated: show LOCAL for wanted / latest') - t.test('update: if specifier exists, do nothing. otherwise as if `npm install`.') -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/splat-with-only-prerelease-to-latest.js b/test/tap/splat-with-only-prerelease-to-latest.js deleted file mode 100644 index ac2c58b5b9de9..0000000000000 --- a/test/tap/splat-with-only-prerelease-to-latest.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm') -const test = require('tap').test - -const testdir = common.pkg - -const moduleName = 'xyzzy-wibble' -const testModule = { - name: moduleName, - 'dist-tags': { - latest: '1.3.0-a', - other: '1.2.0-a' - }, - versions: { - '1.0.0-a': { - name: moduleName, - version: '1.0.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.0.0-a.tgz' - } - }, - '1.1.0-a': { - name: moduleName, - version: '1.1.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.1.0-a.tgz' - } - }, - '1.2.0-a': { - name: moduleName, - version: '1.2.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.2.0-a.tgz' - } - }, - '1.3.0-a': { - name: moduleName, - version: '1.3.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz' - } - } - } -} - -let server -test('setup', (t) => { - mr({port: common.port}, (er, s) => { - if (er) throw er - t.ok(true, 'mock registry loaded') - server = s - npm.load({ - loglevel: 'silent', - registry: common.registry, - cache: common.cache - }, (err) => { - if (err) { throw err } - t.ok(true, 'npm loaded') - t.end() - }) - }) -}) - -test('splat', (t) => { - server.get('/xyzzy-wibble').reply(200, testModule) - return npm.commands.cache.add('xyzzy-wibble', '*', testdir).then((pkg) => { - throw new Error(`Was not supposed to succeed on ${pkg}`) - }).catch((err) => { - t.equal(err.code, 'E404', 'got a 404 on the tarball fetch') - t.equal( - err.uri, - testModule.versions['1.3.0-a'].dist.tarball, - 'tried to get tarball for `latest` tag' - ) - npm.config.set('tag', 'other') - return npm.commands.cache.add('xyzzy-wibble', '*', testdir) - }).then((pkg) => { - throw new Error(`Was not supposed to succeed on ${pkg}`) - }).catch((err) => { - t.equal(err.code, 'E404', 'got a 404 on the tarball fetch') - t.equal( - err.uri, - testModule.versions['1.2.0-a'].dist.tarball, - 'tried to get tarball for `other` tag' - ) - server.close() - }) -}) diff --git a/test/tap/startstop.js b/test/tap/startstop.js deleted file mode 100644 index dd07352e0dc81..0000000000000 --- a/test/tap/startstop.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'startstop', - version: '1.2.3', - scripts: { - start: 'node -e "console.log(\'start\')"', - stop: 'node -e "console.log(\'stop\')"' - } -} - -function testOutput (t, command, er, code, stdout, stderr) { - t.notOk(code, 'npm ' + command + ' exited with code 0') - - if (stderr) throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) - - stdout = stdout.trim().split(/\n|\r/) - stdout = stdout[stdout.length - 1] - t.equal(stdout, command) - t.end() -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('npm start', function (t) { - common.npm(['start'], EXEC_OPTS, testOutput.bind(null, t, 'start')) -}) - -test('npm stop', function (t) { - common.npm(['stop'], EXEC_OPTS, testOutput.bind(null, t, 'stop')) -}) - -test('npm restart', function (t) { - common.npm(['restart'], EXEC_OPTS, function (er, c, stdout) { - if (er) throw er - - var output = stdout.split('\n').filter(function (val) { - return val.match(/^s/) - }) - - t.same(output.sort(), ['start', 'stop'].sort()) - t.end() - }) -}) diff --git a/test/tap/symlink-cycle.js b/test/tap/symlink-cycle.js deleted file mode 100644 index de2c8247cd123..0000000000000 --- a/test/tap/symlink-cycle.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var mkdirp = require('mkdirp') -var writeFileSync = require('fs').writeFileSync -var common = require('../common-tap.js') - -var base = common.pkg -var cycle = path.join(base, 'cycle') - -var cycleJSON = { - name: 'cycle', - version: '1.0.0', - description: '', - main: 'index.js', - dependencies: { - 'cycle': '*' - }, - author: '', - license: 'ISC' -} - -test('setup', function (t) { - mkdirp.sync(path.join(cycle, 'node_modules')) - writeFileSync( - path.join(cycle, 'package.json'), - JSON.stringify(cycleJSON, null, 2) - ) - fs.symlinkSync(cycle, path.join(cycle, 'node_modules', 'cycle'), 'junction') - t.end() -}) - -test('ls', function (t) { - process.chdir(cycle) - common.npm(['ls'], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'installed w/o error') - t.is(stderr, '', 'no warnings printed to stderr') - t.end() - }) -}) diff --git a/test/tap/tag-version-prefix.js b/test/tap/tag-version-prefix.js deleted file mode 100644 index 70c968705ab07..0000000000000 --- a/test/tap/tag-version-prefix.js +++ /dev/null @@ -1,73 +0,0 @@ -var common = require('../common-tap.js') -var fs = require('fs') -var path = require('path') - -var test = require('tap').test - -var npm = require('../../lib/npm.js') - -var pkg = common.pkg -var npmrc = path.resolve(pkg, '.npmrc') -var packagePath = path.resolve(pkg, 'package.json') - -var json = { name: 'blah', version: '0.1.2' } - -var configContents = 'sign-git-commit=false\nsign-git-tag=false\nmessage=":bookmark: %s"\n' - -test('npm version with message config', function (t) { - setup() - - npm.load({ prefix: pkg, userconfig: npmrc }, function () { - var git = require('../../lib/utils/git.js') - - common.makeGitRepo({ path: pkg }, function (er) { - t.ifErr(er, 'git bootstrap ran without error') - - common.npm( - [ - '--userconfig', npmrc, - 'config', - 'set', - 'tag-version-prefix', - 'q' - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm config ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - common.npm( - [ - 'version', - 'patch', - '--loglevel', 'silent' - // package config is picked up from env - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm version ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - git.whichAndExec( - ['tag'], - { cwd: pkg, env: process.env }, - function (er, tags, stderr) { - t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) - t.end() - } - ) - } - ) - } - ) - }) - }) -}) - -function setup () { - process.chdir(pkg) - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') - fs.writeFileSync(npmrc, configContents, 'ascii') -} diff --git a/test/tap/tagged-version-matching.js b/test/tap/tagged-version-matching.js deleted file mode 100644 index a939c21c0d749..0000000000000 --- a/test/tap/tagged-version-matching.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var Symlink = Tacks.Symlink -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - example: Dir({ - 'package.json': File({ - dependencies: { - tagdep: 'latest', - gitdep: 'npm/example-gitdep' - }, - name: 'example', - version: '1.0.0' - }) - }), - node_modules: Dir({ - example: Symlink('../example'), - gitdep: Dir({ - 'package.json': File({ - _from: 'npm/example-gitdep', - _id: 'gitdep@1.0.0', - _resolved: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709', - name: 'gitdep', - version: '1.0.0' - }) - }), - tagdep: Dir({ - 'package.json': File({ - _from: 'tagdep@latest', - _id: 'tagdep@1.0.0', - _integrity: 'sha1-0EJSKmsdk39848LlrRg/hZQo2B8=', - _resolved: 'https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz', - name: 'tagdep', - version: '1.0.0' - }) - }) - }), - 'npm-shrinkwrap.json': File({ - name: 'tagged-version-matching', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - tagdep: { - version: '1.0.0', - resolved: 'https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz', - integrity: 'sha1-0EJSKmsdk39848LlrRg/hZQo2B8=' - }, - example: { - version: 'file:example', - requires: { - tagdep: '^1.0.0', - gitdep: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709' - } - }, - gitdep: { - version: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709' - } - } - }), - 'package.json': File({ - name: 'tagged-version-matching', - version: '1.0.0', - dependencies: { - example: 'file:example', - gitdep: 'npm/example-gitdep' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('tagged-version-matching', function (t) { - common.npm(['ls', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stderr.trim()) t.comment(stderr.trim()) - var result = JSON.parse(stdout.trim()) - var expected = { - name: 'tagged-version-matching', - version: '1.0.0', - dependencies: { - example: { - version: '1.0.0', - dependencies: { - gitdep: { - version: '1.0.0', - from: 'npm/example-gitdep' - }, - tagdep: { - version: '1.0.0', - from: 'tagdep@latest' - } - } - }, - gitdep: { - version: '1.0.0', - from: 'npm/example-gitdep' - } - } - } - - t.like(result, expected, 'ls looks ok') - t.is((result.problems || []).length, 0, 'no problems') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/test/tap/team.js b/test/tap/team.js deleted file mode 100644 index 17acf82f4b231..0000000000000 --- a/test/tap/team.js +++ /dev/null @@ -1,189 +0,0 @@ -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var server - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('team create basic', function (t) { - var teamData = { - name: 'test', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: null - } - server.put('/-/org/myorg/team', JSON.stringify({ - name: teamData.name, - description: null - })).reply(200, teamData) - common.npm([ - 'team', 'create', 'myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'error', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), {created: true, team: `myorg:${teamData.name}`}) - t.end() - }) -}) - -test('team create (allow optional @ prefix on scope)', function (t) { - var teamData = { - name: 'test', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: null - } - server.put('/-/org/myorg/team', JSON.stringify({ - name: teamData.name, - description: null - })).reply(200, teamData) - common.npm([ - 'team', 'create', '@myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), {created: true, team: `myorg:${teamData.name}`}) - t.end() - }) -}) - -test('team destroy', function (t) { - var teamData = { - name: 'myteam', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: '2015-07-23T18:27:27.178Z' - } - server.delete('/-/team/myorg/' + teamData.name).reply(200, teamData) - common.npm([ - 'team', 'destroy', 'myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), {deleted: true, team: `myorg:${teamData.name}`}) - t.end() - }) -}) - -test('team destroy is not allowed for the default developers team', (t) => { - const teamData = { - name: 'developers', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: '2015-07-23T18:27:27.178Z' - } - server.delete('/-/team/myorg/' + teamData.name).reply(405, teamData) - common.npm([ - 'team', 'destroy', 'myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 1, 'exited with code 1') - t.equal(stderr, '', 'no error output') - t.match(JSON.parse(stdout), {error: {code: 'E405'}}) - t.end() - }) -}) - -test('team add', function (t) { - var user = 'zkat' - server.put('/-/team/myorg/myteam/user', JSON.stringify({ - user: user - })).reply(200, {}) - common.npm([ - 'team', 'add', 'myorg:myteam', user, - '--registry', common.registry, - '--loglevel', 'error', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - }) -}) - -test('team rm', function (t) { - var user = 'zkat' - server.delete('/-/team/myorg/myteam/user', JSON.stringify({ - user: user - })).reply(200, {}) - common.npm([ - 'team', 'rm', 'myorg:myteam', user, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - }) -}) - -test('team ls (on org)', function (t) { - var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] - server.get('/-/org/myorg/team?format=cli').reply(200, teams) - common.npm([ - 'team', 'ls', 'myorg', - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), teams) - t.end() - }) -}) - -test('team ls (on team)', function (t) { - var users = ['zkat', 'bcoe'] - server.get('/-/team/myorg/myteam/user?format=cli').reply(200, users) - common.npm([ - 'team', 'ls', 'myorg:myteam', - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout).sort(), users.sort()) - t.end() - }) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server.done() - server.close() - t.end() -}) diff --git a/test/tap/test-run-ls.js b/test/tap/test-run-ls.js deleted file mode 100644 index 9475695cb6bd9..0000000000000 --- a/test/tap/test-run-ls.js +++ /dev/null @@ -1,33 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var path = require('path') -var cwd = path.resolve(__dirname, '..', '..') -var testscript = require('../../package.json').scripts.test -var tsregexp = testscript.replace(/([[.*\]])/g, '\\$1') - -test('default', function (t) { - common.npm(['run'], { cwd: cwd }, function (er, code, so) { - if (er) throw er - t.notOk(code) - t.similar(so, new RegExp('\\n test\\n ' + tsregexp + '\\n')) - t.end() - }) -}) - -test('parseable', function (t) { - common.npm(['run', '-p'], { cwd: cwd }, function (er, code, so) { - if (er) throw er - t.notOk(code) - t.similar(so, new RegExp('\\ntest:' + tsregexp + '\\n')) - t.end() - }) -}) - -test('parseable', function (t) { - common.npm(['run', '--json'], { cwd: cwd }, function (er, code, so) { - if (er) throw er - t.notOk(code) - t.equal(JSON.parse(so).test, testscript) - t.end() - }) -}) diff --git a/test/tap/tree-style.js b/test/tap/tree-style.js deleted file mode 100644 index 5d8abef3698b2..0000000000000 --- a/test/tap/tree-style.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var test = require('tap').test -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var fs = require('graceful-fs') -var common = require('../common-tap') - -var base = common.pkg -var modA = path.resolve(base, 'modA') -var modB = path.resolve(base, 'modB') -var modC = path.resolve(base, 'modC') -var testNormal = path.resolve(base, 'testNormal') -var testGlobal = path.resolve(base, 'testGlobal') -var testLegacy = path.resolve(base, 'testLegacy') - -var json = { - 'name': 'test-tree-style', - 'version': '1.0.0', - 'dependencies': { - 'modA': modA + '-1.0.0.tgz' - } -} - -var modAJson = { - 'name': 'modA', - 'version': '1.0.0', - 'dependencies': { - 'modB': modB + '-1.0.0.tgz' - } -} - -var modBJson = { - 'name': 'modB', - 'version': '1.0.0', - 'dependencies': { - 'modC': modC + '-1.0.0.tgz' - } -} - -var modCJson = { - 'name': 'modC', - 'version': '1.0.0' -} - -function modJoin () { - var modules = Array.prototype.slice.call(arguments) - return modules.reduce(function (a, b) { - return path.resolve(a, 'node_modules', b) - }) -} - -function writeJson (mod, data) { - fs.writeFileSync(path.resolve(mod, 'package.json'), JSON.stringify(data)) -} - -function setup () { - cleanup() - ;[modA, modB, modC, testNormal, testGlobal, testLegacy].forEach(function (mod) { - mkdirp.sync(mod) - }) - writeJson(modA, modAJson) - writeJson(modB, modBJson) - writeJson(modC, modCJson) - ;[testNormal, testGlobal, testLegacy].forEach(function (mod) { writeJson(mod, json) }) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - setup() - return Bluebird.try(() => { - return common.npm(['pack', 'file:modC'], {cwd: base}) - }).spread((code) => { - t.is(code, 0, 'pack modC') - return common.npm(['pack', 'file:modB'], {cwd: base}) - }).spread((code) => { - t.is(code, 0, 'pack modB') - return common.npm(['pack', 'file:modA'], {cwd: base}) - }).spread((code) => { - t.is(code, 0, 'pack modA') - }) -}) - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -test('tree-style', function (t) { - t.plan(12) - common.npm(['install'], {cwd: testNormal}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'normal install; result code') - t.is(stderr, '', 'normal install; no errors') - exists(t, modJoin(testNormal, 'modA'), 'normal install; module A') - exists(t, modJoin(testNormal, 'modB'), 'normal install; module B') - exists(t, modJoin(testNormal, 'modC'), 'normal install; module C') - }) - common.npm(['install', '--global-style'], {cwd: testGlobal}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'global-style install; result code') - t.is(stderr, '', 'global-style install; no errors') - exists(t, modJoin(testGlobal, 'modA', 'modB'), 'global-style install; module B') - exists(t, modJoin(testGlobal, 'modA', 'modC'), 'global-style install; module C') - }) - common.npm(['install', '--legacy-bundling'], {cwd: testLegacy}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'legacy-bundling install; result code') - t.is(stderr, '', 'legacy-bundling install; no errors') - exists(t, modJoin(testLegacy, 'modA', 'modB', 'modC'), 'legacy-bundling install; module C') - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/test/tap/umask-lifecycle.js b/test/tap/umask-lifecycle.js deleted file mode 100644 index dc365c94abbd5..0000000000000 --- a/test/tap/umask-lifecycle.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('fs') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var sprintf = require('sprintf-js').sprintf - -var escapeExecPath = require('../../lib/utils/escape-exec-path.js') -var escapeArg = require('../../lib/utils/escape-arg.js') -var common = require('../common-tap.js') -var pkg = common.pkg - -var nodeCmd = escapeExecPath(common.nodeBin) -var npmCmd = nodeCmd + ' ' + escapeArg(common.bin) -var umaskScript = npmCmd + ' config get umask && ' + nodeCmd + ' -pe "[process.env.npm_config_umask, process.umask()]"' - -var pj = JSON.stringify({ - name: 'x', - version: '1.2.3', - scripts: { umask: umaskScript } -}, null, 2) + '\n' - -var umask = process.umask() -var expected = [ - '', - '> x@1.2.3 umask ' + pkg, - '> ' + umaskScript, - '', - sprintf('%04o', umask), - "[ '" + sprintf('%04o', umask) + "', " + - sprintf('%d', umask) + ' ]', - '' -].join('\n') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - fs.writeFileSync(pkg + '/package.json', pj) - t.end() -}) - -test('umask script', function (t) { - common.npm(['run', 'umask', '--scripts-prepend-node-path'], { - cwd: pkg, - env: { - PATH: process.env.PATH, - Path: process.env.Path, - 'npm_config_loglevel': 'warn', - nodeExecPath: process.execPath - } - }, function (er, code, sout, serr) { - t.equal(sout, expected) - t.equal(serr, '') - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/test/tap/uninstall-link-clean.js b/test/tap/uninstall-link-clean.js deleted file mode 100644 index e21c370f603b7..0000000000000 --- a/test/tap/uninstall-link-clean.js +++ /dev/null @@ -1,113 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var testdir = common.pkg -var pkg = path.join(testdir, 'pkg') -var dep = path.join(testdir, 'dep') -var work = path.join(testdir, 'uninstall-link-clean-TEST') -var modules = path.join(work, 'node_modules') - -var EXEC_OPTS = { cwd: work, stdio: [0, 'ignore', 2] } - -var world = 'console.log("hello blrbld")\n' - -var json = { - name: 'package', - version: '0.0.0', - bin: { - hello: './world.js' - }, - dependencies: { - 'dep': 'file:../dep' - } -} - -var pjDep = { - name: 'dep', - version: '0.0.0', - bin: { - hello: './world.js' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'world.js'), world) - - mkdirp.sync(dep) - fs.writeFileSync( - path.join(dep, 'package.json'), - JSON.stringify(pjDep, null, 2) - ) - fs.writeFileSync(path.join(dep, 'world.js'), world) - - mkdirp.sync(modules) - - t.end() -}) - -test('installing package with links', function (t) { - common.npm( - [ - '--loglevel', 'error', - 'install', pkg - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') - - t.ok( - existsSync(path.join(modules, 'package', 'package.json')), - 'package installed' - ) - t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists') - t.ok(existsSync(path.join(modules, 'package', 'node_modules', '.bin')), - 'nested binary link directory exists') - - t.end() - } - ) -}) - -test('uninstalling package with links', function (t) { - common.npm( - [ - '--loglevel', 'error', - 'uninstall', 'package' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'uninstall ran to completion without error') - t.notOk(code, 'npm uninstall exited with code 0') - - t.notOk(existsSync(path.join(modules, 'package')), - 'package directory no longer exists') - t.notOk(existsSync(path.join(modules, 'package', 'node_modules', '.bin')), - 'nested binary link directory no longer exists') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(testdir) -} diff --git a/test/tap/uninstall-package.js b/test/tap/uninstall-package.js deleted file mode 100644 index 3e0b404b6c457..0000000000000 --- a/test/tap/uninstall-package.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 'pipe', 2] } - -var json = { - name: 'uninstall-package', - version: '0.0.0', - dependencies: { - underscore: '~1.3.1', - request: '~0.9.0', - '@isaacs/namespace-test': '1.x' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('returns a list of removed items', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'error', - 'install', '.' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'install ran without raising error code') - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'error', - '--parseable', - 'uninstall', 'underscore', 'request', 'lala' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'uninstall ran without raising error code') - t.has(stdout, /^remove\tunderscore\t1.3.3\t/m, 'underscore uninstalled') - t.has(stdout, /^remove\trequest\t0.9.5\t/m, 'request uninstalled') - - s.close() - t.end() - } - ) - } - ) - }) -}) - -test('does not fail if installed package lacks a name somehow', function (t) { - const scope = path.resolve(pkg, 'node_modules/@isaacs') - const scopePkg = path.resolve(scope, 'namespace-test') - const pj = path.resolve(scopePkg, 'package.json') - fs.writeFileSync(pj, JSON.stringify({ - lol: 'yolo', - name: 99 - })) - common.npm( - ['uninstall', '@isaacs/namespace-test'], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'should exit successfully') - t.has(stdout, /removed 1 package in/) - t.notOk(fs.existsSync(scope), 'scoped package removed') - t.end() - } - ) -}) diff --git a/test/tap/uninstall-save.js b/test/tap/uninstall-save.js deleted file mode 100644 index bf1683edcab2c..0000000000000 --- a/test/tap/uninstall-save.js +++ /dev/null @@ -1,72 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 'ignore', 2] } - -var json = { - name: 'uninstall-save', - version: '0.0.1' -} - -test('setup', function (t) { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('uninstall --save removes rm-ed package from package.json', function (t) { - var config = [ - '--registry', common.registry, - '--save-prefix', '^', - '--save', - '--loglevel=error' - ] - return common.npm(config.concat(['install', 'underscore@latest']), EXEC_OPTS).spread((code) => { - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.dependencies, - { 'underscore': '^1.5.1' }, - 'got expected save prefix and version of 1.5.1' - ) - - var installed = path.join(pkg, 'node_modules', 'underscore') - rimraf.sync(installed) - - return common.npm(config.concat(['uninstall', 'underscore']), EXEC_OPTS) - }).spread((code) => { - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - - t.deepEqual( - pkgJson.dependencies, - { }, - 'dependency removed as expected' - ) - }) -}) diff --git a/test/tap/unit-child-path.js b/test/tap/unit-child-path.js deleted file mode 100644 index 902e8f5ec7483..0000000000000 --- a/test/tap/unit-child-path.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' -var test = require('tap').test -var childPath = require('../../lib/utils/child-path.js') -var path = require('path') - -test('childPath', function (t) { - t.is( - path.resolve(childPath('/path/to', {name: 'abc'})), - path.resolve('/path/to/node_modules/abc'), - 'basic use') - t.is( - path.resolve(childPath('/path/to', {package: {name: '@zed/abc'}})), - path.resolve('/path/to/node_modules/@zed/abc'), - 'scoped use') - t.end() -}) diff --git a/test/tap/unit-deps-earliestInstallable.js b/test/tap/unit-deps-earliestInstallable.js deleted file mode 100644 index 47d1ab4119b1e..0000000000000 --- a/test/tap/unit-deps-earliestInstallable.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var npa = require('npm-package-arg') -var log = require('npmlog') - -// we're just mocking to avoid having to call `npm.load` -var deps = requireInject('../../lib/install/deps.js', { - '../../lib/npm.js': { - config: { - get: function (val) { return (val === 'global-style' || val === 'legacy-bundling') ? false : 'mock' } - }, - limit: { - fetch: 10 - } - } -}) - -var earliestInstallable = deps.earliestInstallable - -test('earliestInstallable should consider devDependencies', function (t) { - var dep1 = { - children: [], - package: { - name: 'dep1', - dependencies: { dep2: '2.0.0' } - }, - path: '/dep1', - realpath: '/dep1' - } - - // a library required by the base package - var dep2 = { - package: { - name: 'dep2', - version: '1.0.0' - }, - path: '/dep2', - realpath: '/dep2' - } - - // an incompatible version of dep2. required by dep1 - var dep2a = { - package: { - name: 'dep2', - version: '2.0.0', - _requested: npa('dep2@2.0.0') - }, - parent: dep1, - path: '/dep1/node_modules/dep2a', - realpath: '/dep1/node_modules/dep2a' - } - - var pkg = { - isTop: true, - children: [dep1, dep2], - package: { - name: 'pkg', - dependencies: { dep1: '1.0.0' }, - devDependencies: { dep2: '1.0.0' } - }, - path: '/', - realpath: '/' - } - - dep1.parent = pkg - dep2a.parent = dep1 - dep2.parent = pkg - - var earliest = earliestInstallable(dep1, dep1, dep2a.package, log) - t.isDeeply(earliest, dep1, 'should hoist package when an incompatible devDependency is present') - t.end() -}) - -test('earliestInstallable should reuse shared prod/dev deps when they are identical', function (t) { - var dep1 = { - children: [], - package: { - name: 'dep1', - dependencies: { dep2: '1.0.0' } - }, - path: '/dep1', - realpath: '/dep1' - } - - var dep2 = { - package: { - name: 'dep2', - version: '1.0.0', - _requested: npa('dep2@^1.0.0') - }, - path: '/dep2', - realpath: '/dep2' - } - - var pkg = { - isTop: true, - children: [dep1], - package: { - name: 'pkg', - dependencies: { dep1: '1.0.0' }, - devDependencies: { dep2: '^1.0.0' } - }, - path: '/', - realpath: '/' - } - - dep1.parent = pkg - dep2.parent = pkg - - var earliest = earliestInstallable(dep1, dep1, dep2.package, log) - t.isDeeply(earliest, pkg, 'should reuse identical shared dev/prod deps when installing both') - t.end() -}) diff --git a/test/tap/unit-deps-removeObsoleteDep.js b/test/tap/unit-deps-removeObsoleteDep.js deleted file mode 100644 index 71ae60863771a..0000000000000 --- a/test/tap/unit-deps-removeObsoleteDep.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') - -// we're just mocking to avoid having to call `npm.load` -var deps = requireInject('../../lib/install/deps.js', { - '../../lib/npm.js': { - config: { - get: function () { return 'mock' } - }, - limit: { - fetch: 10 - } - } -}) - -var removeObsoleteDep = deps.removeObsoleteDep - -test('removeObsoleteDep', function (t) { - var child1 = {requiredBy: []} - var test1 = { - removed: true, - requires: [ child1 ] - } - removeObsoleteDep(test1) - t.is(child1.removed, undefined, 'no recursion on deps flagged as removed already') - - var child2 = {requiredBy: []} - var test2 = { - requires: [ child2 ] - } - child2.requiredBy.push(test2) - removeObsoleteDep(test2) - t.is(child2.removed, true, 'required by no other modules, removing') - - var child3 = {requiredBy: [{isTop: true}]} - var test3 = { - requires: [ child3 ] - } - child3.requiredBy.push(test3) - removeObsoleteDep(test3) - t.is(child3.removed, undefined, 'required by other modules, keeping') - t.done() -}) diff --git a/test/tap/unit-deps-replaceModule.js b/test/tap/unit-deps-replaceModule.js deleted file mode 100644 index 15cce005d5dcf..0000000000000 --- a/test/tap/unit-deps-replaceModule.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var test = require('tap').test -var npm = require('../../lib/npm') - -test('setup', function (t) { - npm.load({}, t.done) -}) - -test('replaceModuleByName', function (t) { - var replaceModuleByName = require('../../lib/install/deps')._replaceModuleByName - var mods = [] - for (var ii = 0; ii < 10; ++ii) { - mods.push({package: {name: String(ii)}, path: '/path/to/' + ii}) - } - - var test = {} - test.A = mods.slice(0, 4) - replaceModuleByName(test, 'A', mods[2]) - t.isDeeply(test.A, mods.slice(0, 4), 'replacing an existing module leaves the order alone') - replaceModuleByName(test, 'A', mods[7]) - t.isDeeply(test.A, mods.slice(0, 4).concat(mods[7]), 'replacing a new module appends') - - test.B = mods.slice(0, 4) - var replacement = {package: {name: '1'}, isReplacement: true} - replaceModuleByName(test, 'B', replacement) - t.isDeeply(test.B, [mods[0], replacement, mods[2], mods[3]], 'replacing existing module swaps out for the new version') - - replaceModuleByName(test, 'C', mods[7]) - t.isDeeply(test.C, [mods[7]], 'replacing when the key does not exist yet, causes its creation') - - test.D = mods.slice(0, 4) - var duplicateByPath = {package: {name: 'dup'}, path: test.D[0].path} - replaceModuleByName(test, 'D', duplicateByPath) - t.isDeeply(test.D, mods.slice(0, 4).concat(duplicateByPath), 'replacing with a duplicate path but diff names appends') - t.end() -}) - -test('replaceModuleByPath', function (t) { - var replaceModuleByPath = require('../../lib/install/deps')._replaceModuleByPath - var mods = [] - for (var ii = 0; ii < 10; ++ii) { - mods.push({package: {name: String(ii)}, path: '/path/to/' + ii}) - } - - var test = {} - test.A = mods.slice(0, 4) - replaceModuleByPath(test, 'A', mods[2]) - t.isDeeply(test.A, mods.slice(0, 4), 'replacing an existing module leaves the order alone') - replaceModuleByPath(test, 'A', mods[7]) - t.isDeeply(test.A, mods.slice(0, 4).concat(mods[7]), 'replacing a new module appends') - - test.B = mods.slice(0, 4) - var replacement = {package: {name: '1'}, isReplacement: true, path: '/path/to/1'} - replaceModuleByPath(test, 'B', replacement) - t.isDeeply(test.B, [mods[0], replacement, mods[2], mods[3]], 'replacing existing module swaps out for the new version') - - replaceModuleByPath(test, 'C', mods[7]) - t.isDeeply(test.C, [mods[7]], 'replacing when the key does not exist yet, causes its creation') - - test.D = mods.slice(0, 4) - var duplicateByPath = {package: {name: 'dup'}, path: test.D[0].path} - replaceModuleByPath(test, 'D', duplicateByPath) - t.isDeeply(test.D, [duplicateByPath].concat(mods.slice(1, 4)), 'replacing with a duplicate path but diff names replaces') - t.end() -}) diff --git a/test/tap/unit-module-name.js b/test/tap/unit-module-name.js deleted file mode 100644 index 59d4b44f0b36c..0000000000000 --- a/test/tap/unit-module-name.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict' -var test = require('tap').test -var moduleName = require('../../lib/utils/module-name.js') - -test('pathToPackageName', function (t) { - var pathToPackageName = moduleName.test.pathToPackageName - t.is(pathToPackageName('/foo/bar/baz/bark'), 'bark', 'simple module name') - t.is(pathToPackageName('/foo/bar/@baz/bark'), '@baz/bark', 'scoped module name') - t.is(pathToPackageName('/foo'), 'foo', 'module at top') - t.is(pathToPackageName('/@foo'), '@foo', 'invalid module at top') - t.is(pathToPackageName('/'), '', 'root, empty result') - t.is(pathToPackageName(''), '', 'empty, empty') - t.is(pathToPackageName(undefined), '', 'undefined is empty') - t.is(pathToPackageName(null), '', 'null is empty') - t.done() -}) - -test('isNotEmpty', function (t) { - var isNotEmpty = moduleName.test.isNotEmpty - t.is(isNotEmpty('abc'), true, 'string is not empty') - t.is(isNotEmpty(''), false, 'empty string is empty') - t.is(isNotEmpty(null), false, 'null is empty') - t.is(isNotEmpty(undefined), false, 'undefined is empty') - t.is(isNotEmpty(0), true, 'zero is not empty') - t.is(isNotEmpty(true), true, 'true is not empty') - t.is(isNotEmpty([]), true, 'empty array is not empty') - t.is(isNotEmpty({}), true, 'object is not empty') - t.done() -}) - -test('moduleName', function (t) { - t.is(moduleName({package: {name: 'foo'}}), 'foo', 'package named') - t.is(moduleName({name: 'foo'}), 'foo', 'package named, no tree') - t.is(moduleName({path: '/foo/bar'}), 'bar', 'path named') - t.is(moduleName({}), '!invalid#1', 'no named') - t.is(moduleName({path: '/'}), '!invalid#2', 'invalid named') - var obj = {} - t.is(moduleName(obj), moduleName(obj), 'once computed, an invalid module name will not change') - t.done() -}) diff --git a/test/tap/unit-package-id.js b/test/tap/unit-package-id.js deleted file mode 100644 index 19590d82efee7..0000000000000 --- a/test/tap/unit-package-id.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' -var test = require('tap').test -var packageId = require('../../lib/utils/package-id.js') - -test('packageId', function (t) { - t.is(packageId({package: {_id: 'abc@123'}}), 'abc@123', 'basic') - t.is(packageId({_id: 'abc@123'}), 'abc@123', 'basic no tree') - t.is(packageId({package: {name: 'abc', version: '123'}}), 'abc@123', 'computed') - t.is(packageId({package: {_id: '@', name: 'abc', version: '123'}}), 'abc@123', 'computed, ignore invalid id') - t.is(packageId({package: {name: 'abc'}}), 'abc', 'no version') - t.is(packageId({package: {version: '123'}}), '!invalid#1@123', 'version, no name') - t.is(packageId({package: {version: '123'}, path: '/path/to/abc'}), 'abc@123', 'version path-name') - t.is(packageId({package: {version: '123'}, path: '/path/@to/abc'}), '@to/abc@123', 'version scoped-path-name') - t.is(packageId({path: '/path/to/abc'}), 'abc', 'path name, no version') - t.is(packageId({}), '!invalid#2', 'nothing') - t.done() -}) diff --git a/test/tap/unit-token-validate-cidr.js b/test/tap/unit-token-validate-cidr.js deleted file mode 100644 index cda91b8f1e0da..0000000000000 --- a/test/tap/unit-token-validate-cidr.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' -const test = require('tap').test -const validateCIDRList = require('../../lib/token.js')._validateCIDRList - -test('validateCIDRList', (t) => { - t.plan(10) - const single = ['127.0.0.0/24'] - const double = ['127.0.0.0/24', '192.168.0.0/16'] - const ipv6 = '2620:0:2d0:200::7/32' - const ipv6Mixed = ['127.0.0/24', '2620:0:2d0:200::7/32', '192.168.0.0/16'] - t.doesNotThrow(() => t.isDeeply(validateCIDRList(single.join(',')), single), 'single string ipv4') - t.doesNotThrow(() => t.isDeeply(validateCIDRList(single), single), 'single array ipv4') - t.doesNotThrow(() => t.isDeeply(validateCIDRList(double.join(',')), double), 'double string ipv4') - t.doesNotThrow(() => t.isDeeply(validateCIDRList(double), double), 'double array ipv4') - t.throws(() => validateCIDRList(ipv6)) - t.throws(() => validateCIDRList(ipv6Mixed)) - t.done() -}) diff --git a/test/tap/unpack-foreign-tarball.js b/test/tap/unpack-foreign-tarball.js deleted file mode 100644 index b3a9026f84ab2..0000000000000 --- a/test/tap/unpack-foreign-tarball.js +++ /dev/null @@ -1,84 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var t = require('tap') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap.js') - -var fixtures = path.resolve(__dirname, '..', 'fixtures') - -var pkg = common.pkg -var nm = path.resolve(pkg, 'node_modules') -var target = path.resolve(nm, 'npm-test-gitignore') -var cache = common.cache -var tmp = path.resolve(pkg, 'tmp') - -var EXEC_OPTS = { - env: { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp - }, - cwd: pkg -} - -function verify (t, files, code) { - if (code) { - return t.fail('exited with failure: ' + code) - } - var actual = fs.readdirSync(target).sort() - var expect = files.concat(['.npmignore', 'package.json']).sort() - t.same(actual, expect) -} - -t.comment('test for https://github.com/npm/npm/issues/5658') - -t.test('npmignore only', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'npmignore.tgz') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo'], code))) -}) - -t.test('gitignore only', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore.tgz') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo'], code))) -}) - -t.test('gitignore and npmignore', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore-and-npmignore.tgz') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo', 'bar'], code))) -}) - -t.test('gitignore and npmignore, not gzipped 1/2', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore-and-npmignore.tar') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo', 'bar'], code))) -}) - -t.test('gitignore and npmignore, not gzipped 2/2', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore-and-npmignore-2.tar') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo', 'bar'], code))) -}) - -function setup (t) { - t.test('destroy', t => { - t.plan(2) - t.test('node_modules', t => rimraf(nm, t.end)) - t.test('tmp', t => rimraf(tmp, t.end)) - }) - t.test('create', t => { - mkdirp.sync(nm) - mkdirp.sync(tmp) - t.end() - }) - t.end() -} diff --git a/test/tap/unpublish-config.js b/test/tap/unpublish-config.js deleted file mode 100644 index 6d5c981d08d95..0000000000000 --- a/test/tap/unpublish-config.js +++ /dev/null @@ -1,70 +0,0 @@ -var fs = require('graceful-fs') -var http = require('http') -var path = require('path') - -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var fixturePath = path.join(pkg, 'fixture_npmrc') - -var json = { - name: 'npm-test-unpublish-config', - version: '1.2.3', - publishConfig: { registry: common.registry } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json), 'utf8' - ) - fs.writeFileSync( - fixturePath, - '//localhost:' + common.port + '/:_authToken = beeeeeeeeeeeeef\n' + - 'registry = http://lvh.me:4321/registry/path\n' - ) - - t.end() -}) - -test('cursory test of unpublishing with config', function (t) { - var child - t.plan(4) - http.createServer(function (req, res) { - t.pass('got request on the fakey fake registry') - this.close() - res.statusCode = 500 - res.end(JSON.stringify({ - error: 'shh no tears, only dreams now' - })) - child.kill('SIGINT') - }).listen(common.port, function () { - t.pass('server is listening') - - child = common.npm( - [ - '--userconfig', fixturePath, - '--loglevel', 'error', - '--force', - 'unpublish' - ], - { - cwd: pkg, - stdio: 'inherit', - env: { - 'npm_config_cache_lock_stale': 1000, - 'npm_config_cache_lock_wait': 1000, - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH, - USERPROFILE: process.env.USERPROFILE - } - }, - function (err, code) { - t.ifError(err, 'publish command finished successfully') - t.notOk(code, 'npm install exited with code 0') - } - ) - }) -}) diff --git a/test/tap/update-examples.js b/test/tap/update-examples.js deleted file mode 100644 index 2217386de8d23..0000000000000 --- a/test/tap/update-examples.js +++ /dev/null @@ -1,221 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var requireInject = require('require-inject') - -var PKG_DIR = common.pkg -var CACHE_DIR = common.cache - -// ** constant templates for mocks ** -var DEFAULT_PKG = { - 'name': 'update-examples', - 'version': '1.2.3', - 'dependencies': { - 'dep1': '*' - } -} - -var DEP_PKG = { - name: 'dep1', - version: '1.1.1', - _from: '^1.1.1' -} - -var INSTALLED = { - path: '/mock/root', - realpath: '/mock/root', - isLink: false, - package: DEFAULT_PKG, - children: [ - { - path: '/mock/root/node_modules/dep1', - realpath: '/mock/root/node_modules/dep1', - isLink: false, - package: DEP_PKG, - children: [] - } - ] -} - -var DEP1_REGISTRY = { name: 'dep1', - 'dist-tags': { latest: '1.2.2' }, - versions: { - '1.2.2': { version: '1.2.2' }, - '1.2.1': { version: '1.2.1' }, - '1.2.0': { version: '1.2.0' }, - '1.1.2': { version: '1.1.2' }, - '1.1.1': { version: '1.1.1' }, - '1.0.0': { version: '1.0.0' }, - '0.4.1': { version: '0.4.1' }, - '0.4.0': { version: '0.4.0' }, - '0.2.0': { version: '0.2.0' } - } -} - -var registryMocks = { - 'get': { - '/dep1': [200, DEP1_REGISTRY] - } -} - -// ** dynamic mocks, cloned from templates and modified ** -var mockDepJson = clone(DEP_PKG) -var mockInstalled = clone(INSTALLED) -var mockParentJson = clone(DEFAULT_PKG) - -// target -var installAskedFor - -function clone (a) { - return extend({}, a) -} - -function extend (a, b) { - for (var key in b) { - a[key] = b[key] - } - return a -} - -const path = require('path') -let cacheIteration = 0 -const isRoot = process.getuid && process.getuid() === 0 -const sudoUID = isRoot ? +process.env.SUDO_UID : null -const sudoGID = isRoot ? +process.env.SUDO_GID : null -const { chownSync } = require('fs') -function resetPackage (options) { - CACHE_DIR = path.resolve(common.cache, '' + cacheIteration++) - npm.config.set('cache', CACHE_DIR) - mkdirp.sync(CACHE_DIR) - - if (isRoot && sudoUID && sudoGID) { - chownSync(CACHE_DIR, sudoUID, sudoGID) - } - - installAskedFor = undefined - - mockParentJson = clone(DEFAULT_PKG) - mockInstalled = clone(INSTALLED) - mockDepJson = clone(DEP_PKG) - - if (options.wanted) { - mockParentJson.dependencies.dep1 = options.wanted - mockInstalled.package.dependencies.dep1 = options.wanted - mockDepJson._from = options.wanted - } - - if (options.installed) { - mockInstalled.package.dependencies.dep1 = options.installed - mockInstalled.children[0].package.version = options.installed - mockDepJson.version = options.installed - } -} - -function mockReadPackageTree (dir, cb) { - cb(null, mockInstalled) -} - -function mockReadJson (file, cb) { - cb(null, file.match(/dep1/) ? mockDepJson : mockParentJson) -} - -function mockCommand (npm, name, fn) { - delete npm.commands[name] - npm.commands[name] = fn -} - -function mockInstaller (where, dryrun, what) { - installAskedFor = what[0] -} -mockInstaller.prototype = {} -mockInstaller.prototype.run = function (cb) { - return cb ? cb() : Promise.resolve() -} - -var npm = requireInject.installGlobally('../../lib/npm.js', { - 'read-package-tree': mockReadPackageTree, - 'read-package-json': mockReadJson, - '../../lib/install': { - Installer: mockInstaller - } -}) - -test('setup', function (t) { - t.plan(5) - process.chdir(PKG_DIR) - t.pass('made ' + PKG_DIR) - - mr({ port: common.port, mocks: registryMocks }, function (er, server) { - t.pass('mock registry active') - npm.load({ - cache: CACHE_DIR, - registry: common.registry, - cwd: PKG_DIR - }, function (err) { - t.ifError(err, 'started server') - t.parent.teardown(() => server.close()) - - t.pass('npm.load complete') - - mockCommand(npm, 'install', function mockInstall (where, what, cb) { - installAskedFor = what - cb(null) - }) - - t.pass('mocks configured') - t.end() - }) - }) -}) - -test('update caret dependency to latest', function (t) { - resetPackage({ wanted: '^1.1.1' }) - - npm.config.set('loglevel', 'silly') - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@1.2.2', 'should want to install dep@1.2.2') - t.end() - }) -}) - -test('update tilde dependency to latest', function (t) { - resetPackage({ wanted: '~1.1.1' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@1.1.2', 'should want to install dep@1.1.2') - t.end() - }) -}) - -test('hold tilde dependency at wanted (#6441)', function (t) { - resetPackage({ wanted: '~1.1.2', installed: '1.1.2' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.notOk(installAskedFor, 'should not want to install anything') - t.end() - }) -}) - -test('update old caret dependency with no newer', function (t) { - resetPackage({ wanted: '^0.2.0', installed: '^0.2.0' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@0.2.0', 'should want to install dep@0.2.0') - t.end() - }) -}) - -test('update old caret dependency with newer', function (t) { - resetPackage({ wanted: '^0.4.0', installed: '^0.4.0' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@0.4.1', 'should want to install dep@0.4.1') - t.end() - }) -}) diff --git a/test/tap/update-path.js b/test/tap/update-path.js deleted file mode 100644 index 1578669a253fb..0000000000000 --- a/test/tap/update-path.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') - -var mockNpm = { - config: { - get: function (key) { - return false - } - }, - commands: { - outdated: function (args, silent, cb) { - cb(null, [ - [{path: '/incorrect', parent: {path: '/correct'}}, 'abc', '1.0.0', '1.1.0', '1.1.0', '^1.1.0'] - ]) - } - } -} - -// What we're testing here is that updates use the parent module's path to -// install from. -test('update', function (t) { - var update = requireInject('../../lib/update.js', { - '../../lib/npm.js': mockNpm, - '../../lib/install.js': { - 'Installer': function (where, dryrun, args) { - t.is(where, '/correct', 'We should be installing to the parent of the modules being updated') - this.run = function (cb) { cb() } - } - } - }) - update(['abc'], function () { - t.end() - }) -}) diff --git a/test/tap/update-symlink.js b/test/tap/update-symlink.js deleted file mode 100644 index eda07c56e1f69..0000000000000 --- a/test/tap/update-symlink.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Symlink = Tacks.Symlink -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: path.join(testdir, 'main'), - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - broken: Dir({ - 'package.json': File({ - name: 'broken', - version: '1.0.0' - }) - }), - main: Dir({ - node_modules: Dir({ - unbroken: Symlink('/testdir/unbroken') - }), - 'package-lock.json': File({ - name: 'main', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - broken: { - version: 'file:../broken' - }, - unbroken: { - version: 'file:../unbroken' - } - } - }), - 'package.json': File({ - name: 'main', - version: '1.0.0', - dependencies: { - broken: 'file:../broken', - unbroken: 'file:../unbroken' - } - }) - }), - unbroken: Dir({ - 'package.json': File({ - name: 'unbroken', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('update fixes broken links', function (t) { - common.npm(['update'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout, '+ broken@1.0.0') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/test/tap/upgrade-lifecycles.js b/test/tap/upgrade-lifecycles.js deleted file mode 100644 index 0821cacba60cd..0000000000000 --- a/test/tap/upgrade-lifecycles.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var cycler = { - name: 'cycler', - version: '1.0.0', - scripts: { - uninstall: 'echo #UNINSTALL#', - install: 'echo #INSTALL#' - } -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'cycler': Dir({ - 'package.json': File(cycler) - }), - node_modules: Dir({ - 'cycler': Dir({ - 'package.json': File(cycler) - }) - }), - 'package.json': File({ - name: 'upgrade-lifecycles', - version: '1.0.0', - dependencies: { - 'cycler': 'file:cycler' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('upgrade-lifecycles', function (t) { - common.npm(['install', 'file:cycler'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout, /#INSTALL#/, 'ran install lifecycle') - t.match(stdout, /#UNINSTALL#/, 'ran uninstall lifecycle') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/test/tap/url-dependencies.js b/test/tap/url-dependencies.js deleted file mode 100644 index 14da5d1fc4fc7..0000000000000 --- a/test/tap/url-dependencies.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var json = { - author: 'Steve Mason', - name: 'url-dependencies', - version: '0.0.0', - dependencies: { - underscore: common.registry + '/underscore/-/underscore-1.3.1.tgz' - } -} - -var mockRoutes = { - 'get': { - '/underscore/-/underscore-1.3.1.tgz': [200] - } -} - -const tarballWasFetched = output => output.includes( - `GET 200 ${common.registry}/underscore/-/underscore-1.3.1.tgz`) - -const performInstall = () => common.npm(['install'], { - cwd: pkg, - env: { - npm_config_registry: common.registry, - npm_config_cache_lock_stale: 1000, - npm_config_cache_lock_wait: 1000, - npm_config_loglevel: 'http', - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH - } -}) - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port, mocks: mockRoutes }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('url-dependencies: download first time', t => - performInstall().then(([code, _, output]) => { - t.equal(code, 0, 'exited successfully') - t.ok(tarballWasFetched(output), 'download first time') - }) - .then(() => performInstall()).then(([code, _, output]) => { - t.equal(code, 0, 'exited successfully') - t.notOk(tarballWasFetched(output), 'do not download second time') - })) diff --git a/test/tap/version.js b/test/tap/version.js deleted file mode 100644 index b89b839311fd5..0000000000000 --- a/test/tap/version.js +++ /dev/null @@ -1,96 +0,0 @@ -const requireInject = require('require-inject') -const outputLog = [] - -const flatOptions = { - json: false -} - -const npmMock = { flatOptions, version: '7.8.9-bogus', prefix: '/boop' } - -const version = requireInject('../../lib/version.js', { - libnpmversion: async (newv, opts) => { - if (newv === 'throw') { - throw new Error('synthetic') - } - return newv - }, - '../../lib/utils/output.js': (...msg) => outputLog.push(msg), - '../../lib/npm.js': npmMock -}) - -const t = require('tap') -t.test('no args dumps pkg, npm, and node versions', t => { - t.test('version with no args, in pkg dir', t => { - const pkgDir = t.testdir({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }) - }) - npmMock.prefix = pkgDir - t.teardown(() => npmMock.prefix = '/boop') - version([], er => { - if (er) { - throw er - } - t.strictSame(outputLog, [ - [ { foo: '1.2.3', npm: '7.8.9-bogus', ...process.versions } ] - ]) - outputLog.length = 0 - t.end() - }) - }) - - t.test('version with no args, no pkg dir', t => { - version([], er => { - if (er) { - throw er - } - t.strictSame(outputLog, [ - [ { ...process.versions, npm: '7.8.9-bogus' } ] - ]) - outputLog.length = 0 - t.end() - }) - }) - - t.test('version with no args, no pkg dir, json', t => { - npmMock.flatOptions.json = true - version([], er => { - if (er) { - throw er - } - t.strictSame(outputLog, [ - [ JSON.stringify({ npm: '7.8.9-bogus', ...process.versions }, null, 2) ] - ]) - outputLog.length = 0 - t.end() - }) - }) - t.end() -}) - -t.test('calls libnpmversion if there is one arg', t => { - version(['argument'], er => { - if (er) { - throw er - } - t.strictSame(outputLog[0], ['argument']) - outputLog.length = 0 - t.end() - }) -}) - -t.test('fails if libnpmversion fails', t => { - version(['throw'], er => { - t.match(er, { message: 'synthetic' }) - t.end() - }) -}) - -t.test('usage if too many args', t => { - version(['a', 'b', 'c'], er => { - t.equal(er, version.usage) - t.end() - }) -}) diff --git a/test/tap/whoami.js b/test/tap/whoami.js deleted file mode 100644 index 9f4bf4266b74c..0000000000000 --- a/test/tap/whoami.js +++ /dev/null @@ -1,76 +0,0 @@ -var common = require('../common-tap.js') - -var fs = require('fs') -var path = require('path') -var createServer = require('http').createServer - -var test = require('tap').test -var rimraf = require('rimraf') - -var opts = { cwd: __dirname } - -var FIXTURE_PATH = path.resolve(common.pkg, 'fixture_npmrc') - -test('npm whoami with basic auth', function (t) { - var s = '//registry.lvh.me/:username = wombat\n' + - '//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n' + - '//registry.lvh.me/:email = lindsay@wdu.org.au\n' - fs.writeFileSync(FIXTURE_PATH, s, 'ascii') - fs.chmodSync(FIXTURE_PATH, 0o644) - - common.npm( - [ - 'whoami', - '--userconfig=' + FIXTURE_PATH, - '--registry=http://registry.lvh.me/' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.equal(stderr, '', 'got nothing on stderr') - t.equal(code, 0, 'exit ok') - t.equal(stdout, 'wombat\n', 'got username') - t.end() - } - ) -}) - -test('npm whoami with bearer auth', { timeout: 6000 }, function (t) { - var s = '//localhost:' + common.port + - '/:_authToken = wombat-developers-union\n' - fs.writeFileSync(FIXTURE_PATH, s, 'ascii') - fs.chmodSync(FIXTURE_PATH, 0o644) - - function verify (req, res) { - t.equal(req.method, 'GET') - t.equal(req.url, '/-/whoami') - - res.setHeader('content-type', 'application/json') - res.writeHead(200) - res.end(JSON.stringify({ username: 'wombat' }), 'utf8') - } - - var server = createServer(verify) - - server.listen(common.port, function () { - common.npm( - [ - 'whoami', - '--userconfig=' + FIXTURE_PATH, - '--registry=http://localhost:' + common.port + '/' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.equal(stderr, '', 'got nothing on stderr') - t.equal(code, 0, 'exit ok') - t.equal(stdout, 'wombat\n', 'got username') - rimraf.sync(FIXTURE_PATH) - server.close() - t.end() - } - ) - }) -}) From c394937ec1911cd17ec42c8fc74773047d47322c Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 30 Sep 2020 17:03:23 -0700 Subject: [PATCH 34/39] @npmcli/run-script@1.7.0 --- .../@npmcli/arborist/lib/add-rm-pkg-deps.js | 19 +++-- .../@npmcli/arborist/lib/arborist/rebuild.js | 25 ++++++- .../@npmcli/arborist/lib/arborist/reify.js | 3 + node_modules/@npmcli/arborist/package.json | 7 +- node_modules/@npmcli/map-workspaces/index.js | 6 +- .../@npmcli/map-workspaces/package.json | 12 ++-- .../@npmcli/run-script/lib/run-script-pkg.js | 21 ++++-- node_modules/@npmcli/run-script/package.json | 3 +- package-lock.json | 70 ++++++++++++------- package.json | 4 +- 10 files changed, 117 insertions(+), 53 deletions(-) diff --git a/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js b/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js index 175ec55f0b9e0..c050bde53a345 100644 --- a/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js +++ b/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js @@ -21,6 +21,7 @@ const removeFromOthers = (name, type, pkg) => { break case 'peer': case 'peerOptional': + others.delete('devDependencies') others.delete('peerDependencies') others.delete('peerDependenciesMeta') break @@ -44,9 +45,9 @@ const addSingle = ({pkg, spec, saveBundle, saveType}) => { const { name, rawSpec } = spec removeFromOthers(name, saveType, pkg) const type = saveType === 'prod' ? 'dependencies' - : saveType === 'dev' ? 'devDependencies' : saveType === 'optional' ? 'optionalDependencies' : saveType === 'peer' || saveType === 'peerOptional' ? 'peerDependencies' + : saveType === 'dev' ? 'devDependencies' : /* istanbul ignore next */ null pkg[type] = pkg[type] || {} @@ -62,6 +63,10 @@ const addSingle = ({pkg, spec, saveBundle, saveType}) => { pdm[name].optional = true pkg.peerDependenciesMeta = pdm } + // peerDeps are often also a devDep, so that they can be tested when + // using package managers that don't auto-install peer deps + if (pkg.devDependencies && pkg.devDependencies[name] !== undefined) + pkg.devDependencies[name] = pkg.peerDependencies[name] } if (saveBundle) { @@ -82,16 +87,16 @@ const getSaveType = (pkg, spec) => { peerDependenciesMeta: peerDepsMeta, } = pkg - if (devDeps && devDeps[name] !== undefined) - return 'dev' - else if (optDeps && optDeps[name] !== undefined) - return 'optional' - else if (peerDeps && peerDeps[name] !== undefined) { + if (peerDeps && peerDeps[name] !== undefined) { if (peerDepsMeta && peerDepsMeta[name] && peerDepsMeta[name].optional) return 'peerOptional' else return 'peer' - } else + } else if (devDeps && devDeps[name] !== undefined) + return 'dev' + else if (optDeps && optDeps[name] !== undefined) + return 'optional' + else return 'prod' } diff --git a/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/node_modules/@npmcli/arborist/lib/arborist/rebuild.js index 24d437bc3a9cf..fd7be340bb719 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +++ b/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -8,6 +8,7 @@ const binLinks = require('bin-links') const runScript = require('@npmcli/run-script') const promiseCallLimit = require('promise-call-limit') const {resolve} = require('path') +const { isNodeGypPackage } = require('@npmcli/node-gyp') const boolEnv = b => b ? '1' : '' const sortNodes = (a, b) => (a.depth - b.depth) || a.path.localeCompare(b.path) @@ -22,6 +23,7 @@ const _linkAllBins = Symbol('linkAllBins') const _runScripts = Symbol('runScripts') const _buildQueues = Symbol('buildQueues') const _addToBuildSet = Symbol('addToBuildSet') +const _checkBins = Symbol.for('checkBins') const _queues = Symbol('queues') const _scriptShell = Symbol('scriptShell') @@ -126,6 +128,18 @@ module.exports = cls => class Builder extends cls { process.emit('timeEnd', 'build:queue') } + async [_checkBins] (node) { + // if the node is a global top, and we're not in force mode, then + // any existing bins need to either be missing, or a symlink into + // the node path. Otherwise a package can have a preinstall script + // that unlinks something, to allow them to silently overwrite system + // binaries, which is unsafe and insecure. + if (!node.globalTop || this[_force]) + return + const { path, package: pkg } = node + await binLinks.checkBins({ pkg, path, top: true, global: true }) + } + async [_addToBuildSet] (node, set) { if (set.has(node)) return @@ -161,8 +175,17 @@ module.exports = cls => class Builder extends cls { } } - if (bin || preinstall || install || postinstall) + if (bin || preinstall || install || postinstall) { + if (bin) + await this[_checkBins](node) set.add(node) + } else if (!install && !preinstall && await isNodeGypPackage(node.path)) { + // Rebuild node-gyp dependencies lacking an install or preinstall script + // note that 'scripts' might be missing entirely. + scripts.install = 'node-gyp rebuild' + node.package.scripts = scripts + set.add(node) + } } async [_runScripts] (event) { diff --git a/node_modules/@npmcli/arborist/lib/arborist/reify.js b/node_modules/@npmcli/arborist/lib/arborist/reify.js index 480da9cbb99fc..8fe88edb8f722 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -42,6 +42,8 @@ const _createSparseTree = Symbol.for('createSparseTree') const _loadShrinkwrapsAndUpdateTrees = Symbol.for('loadShrinkwrapsAndUpdateTrees') const _reifyNode = Symbol.for('reifyNode') const _extractOrLink = Symbol('extractOrLink') +// defined by rebuild mixin +const _checkBins = Symbol.for('checkBins') const _symlink = Symbol('symlink') const _warnDeprecated = Symbol('warnDeprecated') const _loadAncientPackageDetails = Symbol('loadAncientPackageDetails') @@ -377,6 +379,7 @@ module.exports = cls => class Reifier extends cls { this.addTracker('reify', node.name, node.location) const p = Promise.resolve() + .then(() => this[_checkBins](node)) .then(() => this[_extractOrLink](node)) .then(() => this[_warnDeprecated](node)) .then(() => this[_loadAncientPackageDetails](node)) diff --git a/node_modules/@npmcli/arborist/package.json b/node_modules/@npmcli/arborist/package.json index 8f38d96e7a3a7..24b0b99fe96d7 100644 --- a/node_modules/@npmcli/arborist/package.json +++ b/node_modules/@npmcli/arborist/package.json @@ -1,14 +1,15 @@ { "name": "@npmcli/arborist", - "version": "0.0.28", + "version": "0.0.29", "description": "Manage node_modules trees", "dependencies": { "@npmcli/installed-package-contents": "^1.0.5", - "@npmcli/map-workspaces": "0.0.0-pre.1", + "@npmcli/map-workspaces": "^1.0.1", "@npmcli/metavuln-calculator": "^1.0.0", "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/node-gyp": "^1.0.0", "@npmcli/run-script": "^1.3.1", - "bin-links": "^2.1.4", + "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", diff --git a/node_modules/@npmcli/map-workspaces/index.js b/node_modules/@npmcli/map-workspaces/index.js index 0a789d2445e05..b06662154a83a 100644 --- a/node_modules/@npmcli/map-workspaces/index.js +++ b/node_modules/@npmcli/map-workspaces/index.js @@ -87,7 +87,7 @@ async function mapWorkspaces (opts = {}) { const { workspaces = [] } = opts.pkg const patterns = getPatterns(workspaces) const results = new Map() - const seen = new Set() + const seen = new Map() if (isEmpty(patterns)) { return results @@ -126,7 +126,7 @@ async function mapWorkspaces (opts = {}) { if (item.negate) { results.delete(packagePathname, name) } else { - if (seen.has(name)) { + if (seen.has(name) && seen.get(name) !== packagePathname) { throw getError({ Type: Error, message: 'must not have multiple workspaces with the same name', @@ -134,7 +134,7 @@ async function mapWorkspaces (opts = {}) { }) } - seen.add(name) + seen.set(name, packagePathname) results.set(packagePathname, name) } } diff --git a/node_modules/@npmcli/map-workspaces/package.json b/node_modules/@npmcli/map-workspaces/package.json index 7f959d070eb3c..2a66a74240d6d 100644 --- a/node_modules/@npmcli/map-workspaces/package.json +++ b/node_modules/@npmcli/map-workspaces/package.json @@ -1,9 +1,12 @@ { "name": "@npmcli/map-workspaces", - "version": "0.0.0-pre.1", + "version": "1.0.1", "files": [ "index.js" ], + "engines": { + "node": ">=10" + }, "description": "Retrieves a name:pathname Map for a given workspaces config", "repository": "https://github.com/npm/map-workspaces", "keywords": [ @@ -25,6 +28,7 @@ "license": "ISC", "scripts": { "lint": "standard", + "pretest": "npm run lint", "test": "tap test*.js", "snap": "tap test*.js", "preversion": "npm test", @@ -41,13 +45,13 @@ }, "devDependencies": { "require-inject": "^1.4.4", - "standard": "^14.3.1", - "tap": "^14.10.7" + "standard": "^14.3.4", + "tap": "^14.10.8" }, "dependencies": { "@npmcli/name-from-folder": "^1.0.1", "glob": "^7.1.6", "minimatch": "^3.0.4", - "read-package-json-fast": "^1.1.3" + "read-package-json-fast": "^1.2.1" } } diff --git a/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/node_modules/@npmcli/run-script/lib/run-script-pkg.js index 1a3a76d6858a9..bf273e590d003 100644 --- a/node_modules/@npmcli/run-script/lib/run-script-pkg.js +++ b/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -1,11 +1,12 @@ const makeSpawnArgs = require('./make-spawn-args.js') const promiseSpawn = require('@npmcli/promise-spawn') const packageEnvs = require('./package-envs.js') +const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') // you wouldn't like me when I'm angry... const bruce = (id, event, cmd) =>`\n> ${id ? id + ' ' : ''}${event}\n> ${cmd}\n` -const runScriptPkg = options => { +const runScriptPkg = async options => { const { event, path, @@ -19,11 +20,19 @@ const runScriptPkg = options => { banner = true, } = options - const cmd = options.cmd ? options.cmd - : pkg.scripts && pkg.scripts[event] - ? pkg.scripts[event] + - args.map(a => ` ${JSON.stringify(a)}`).join('') - : null + let cmd = null + if (options.cmd) { + cmd = options.cmd + } else if (pkg.scripts && pkg.scripts[event]) { + cmd = pkg.scripts[event] + args.map(a => ` ${JSON.stringify(a)}`).join('') + } else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages. + event === 'install' && + ! pkg.scripts.install && + ! pkg.scripts.preinstall && + await isNodeGypPackage(path) + ) { + cmd = defaultGypInstallScript + } if (!cmd) return Promise.resolve({ code: 0, signal: null }) diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index 0328cf451c893..1fe8e82c50356 100644 --- a/node_modules/@npmcli/run-script/package.json +++ b/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "1.6.0", + "version": "1.7.0", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", @@ -20,6 +20,7 @@ "tap": "^14.10.6" }, "dependencies": { + "@npmcli/node-gyp": "^1.0.0", "@npmcli/promise-spawn": "^1.2.0", "infer-owner": "^1.0.4", "node-gyp": "^7.1.0", diff --git a/package-lock.json b/package-lock.json index 66b467c2c3f12..3fdd5efa81cd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,10 +76,10 @@ ], "license": "Artistic-2.0", "dependencies": { - "@npmcli/arborist": "^0.0.28", + "@npmcli/arborist": "^0.0.29", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.1.8", - "@npmcli/run-script": "^1.6.0", + "@npmcli/run-script": "^1.7.0", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", @@ -379,17 +379,18 @@ } }, "node_modules/@npmcli/arborist": { - "version": "0.0.28", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.28.tgz", - "integrity": "sha512-E0yscLZ8yOPbbFnODRIRMsG+Lz7ffP/FWu4tq2mz0Omk3DQN+pllBbDHiOIjekrfJsLFBpmvGTltH71bKAMeCw==", + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.29.tgz", + "integrity": "sha512-QbLzHlfJoExnrLpZYAdf14pYQfk+KpMkpQabjeusrJabrNsfHtfY+rr5HIcG4AAmb0VaiubcUdadqzpBVXgkcQ==", "inBundle": true, "dependencies": { "@npmcli/installed-package-contents": "^1.0.5", - "@npmcli/map-workspaces": "0.0.0-pre.1", + "@npmcli/map-workspaces": "^1.0.1", "@npmcli/metavuln-calculator": "^1.0.0", "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/node-gyp": "^1.0.0", "@npmcli/run-script": "^1.3.1", - "bin-links": "^2.1.4", + "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", @@ -466,15 +467,18 @@ } }, "node_modules/@npmcli/map-workspaces": { - "version": "0.0.0-pre.1", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-0.0.0-pre.1.tgz", - "integrity": "sha512-IovEVdr17hW/Stt0kpPjz1r0ZxRX3RGah7ww3tQpi5NtyOapJwbUffWuWETyQkOjud5soC45mnjOOBtfTggtng==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-1.0.1.tgz", + "integrity": "sha512-w6mVyJ2ngWV7O7f9zPjLrQzRDv7leFmNLVnewNuhouV1MYxXz61DXn2ja3AQj6xlnIp9Z/0GdV0/Ut14eVT8Vw==", "inBundle": true, "dependencies": { "@npmcli/name-from-folder": "^1.0.1", "glob": "^7.1.6", "minimatch": "^3.0.4", - "read-package-json-fast": "^1.1.3" + "read-package-json-fast": "^1.2.1" + }, + "engines": { + "node": ">=10" } }, "node_modules/@npmcli/metavuln-calculator": { @@ -506,6 +510,12 @@ "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==", "inBundle": true }, + "node_modules/@npmcli/node-gyp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.0.tgz", + "integrity": "sha512-BBlx5ZCPCmTrPI2BpynmWpL1hQTRVXSIZ0zI/a9AQsIDXUReA8V/WRJo85TF6Wf0YVBtLibKH3OHrxnbxilthw==", + "inBundle": true + }, "node_modules/@npmcli/promise-spawn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.2.0.tgz", @@ -516,11 +526,12 @@ } }, "node_modules/@npmcli/run-script": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.6.0.tgz", - "integrity": "sha512-2BHum2b8MBXkiWGR6c1JOQ+2eAnE8kygwtT8F5bRam7ErDJqxxcHZSksIU6/qxqnA3WuiuyvxNdnptIJr8YQ8Q==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.0.tgz", + "integrity": "sha512-GaWLYT88H6NzOVGyXeCigijJ+eo2sdBfI67VqgkBDcR/5vElpXQH3crdfLYySPuOMZQSQXh0EsW+gC5LciFsMQ==", "inBundle": true, "dependencies": { + "@npmcli/node-gyp": "^1.0.0", "@npmcli/promise-spawn": "^1.2.0", "infer-owner": "^1.0.4", "node-gyp": "^7.1.0", @@ -8500,16 +8511,17 @@ } }, "@npmcli/arborist": { - "version": "0.0.28", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.28.tgz", - "integrity": "sha512-E0yscLZ8yOPbbFnODRIRMsG+Lz7ffP/FWu4tq2mz0Omk3DQN+pllBbDHiOIjekrfJsLFBpmvGTltH71bKAMeCw==", + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.29.tgz", + "integrity": "sha512-QbLzHlfJoExnrLpZYAdf14pYQfk+KpMkpQabjeusrJabrNsfHtfY+rr5HIcG4AAmb0VaiubcUdadqzpBVXgkcQ==", "requires": { "@npmcli/installed-package-contents": "^1.0.5", - "@npmcli/map-workspaces": "0.0.0-pre.1", + "@npmcli/map-workspaces": "^1.0.1", "@npmcli/metavuln-calculator": "^1.0.0", "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/node-gyp": "^1.0.0", "@npmcli/run-script": "^1.3.1", - "bin-links": "^2.1.4", + "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", @@ -8573,14 +8585,14 @@ } }, "@npmcli/map-workspaces": { - "version": "0.0.0-pre.1", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-0.0.0-pre.1.tgz", - "integrity": "sha512-IovEVdr17hW/Stt0kpPjz1r0ZxRX3RGah7ww3tQpi5NtyOapJwbUffWuWETyQkOjud5soC45mnjOOBtfTggtng==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-1.0.1.tgz", + "integrity": "sha512-w6mVyJ2ngWV7O7f9zPjLrQzRDv7leFmNLVnewNuhouV1MYxXz61DXn2ja3AQj6xlnIp9Z/0GdV0/Ut14eVT8Vw==", "requires": { "@npmcli/name-from-folder": "^1.0.1", "glob": "^7.1.6", "minimatch": "^3.0.4", - "read-package-json-fast": "^1.1.3" + "read-package-json-fast": "^1.2.1" } }, "@npmcli/metavuln-calculator": { @@ -8606,6 +8618,11 @@ "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==" }, + "@npmcli/node-gyp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.0.tgz", + "integrity": "sha512-BBlx5ZCPCmTrPI2BpynmWpL1hQTRVXSIZ0zI/a9AQsIDXUReA8V/WRJo85TF6Wf0YVBtLibKH3OHrxnbxilthw==" + }, "@npmcli/promise-spawn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.2.0.tgz", @@ -8615,10 +8632,11 @@ } }, "@npmcli/run-script": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.6.0.tgz", - "integrity": "sha512-2BHum2b8MBXkiWGR6c1JOQ+2eAnE8kygwtT8F5bRam7ErDJqxxcHZSksIU6/qxqnA3WuiuyvxNdnptIJr8YQ8Q==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.0.tgz", + "integrity": "sha512-GaWLYT88H6NzOVGyXeCigijJ+eo2sdBfI67VqgkBDcR/5vElpXQH3crdfLYySPuOMZQSQXh0EsW+gC5LciFsMQ==", "requires": { + "@npmcli/node-gyp": "^1.0.0", "@npmcli/promise-spawn": "^1.2.0", "infer-owner": "^1.0.4", "node-gyp": "^7.1.0", diff --git a/package.json b/package.json index 9569cb24d409d..b8bfd16cedeb9 100644 --- a/package.json +++ b/package.json @@ -42,10 +42,10 @@ "./package.json": "./package.json" }, "dependencies": { - "@npmcli/arborist": "^0.0.28", + "@npmcli/arborist": "^0.0.29", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.1.8", - "@npmcli/run-script": "^1.6.0", + "@npmcli/run-script": "^1.7.0", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", From dd7d7a284d5150d1804d0cd5a85519c86adf3bc2 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 30 Sep 2020 17:03:59 -0700 Subject: [PATCH 35/39] @npmcli/arborist@0.0.30 --- node_modules/@npmcli/arborist/package.json | 4 ++-- package-lock.json | 18 +++++++++--------- package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/node_modules/@npmcli/arborist/package.json b/node_modules/@npmcli/arborist/package.json index 24b0b99fe96d7..055e9620695e8 100644 --- a/node_modules/@npmcli/arborist/package.json +++ b/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "0.0.29", + "version": "0.0.30", "description": "Manage node_modules trees", "dependencies": { "@npmcli/installed-package-contents": "^1.0.5", @@ -8,7 +8,7 @@ "@npmcli/metavuln-calculator": "^1.0.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.0", - "@npmcli/run-script": "^1.3.1", + "@npmcli/run-script": "^1.7.0", "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", diff --git a/package-lock.json b/package-lock.json index 3fdd5efa81cd0..4087a87964994 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,7 +76,7 @@ ], "license": "Artistic-2.0", "dependencies": { - "@npmcli/arborist": "^0.0.29", + "@npmcli/arborist": "^0.0.30", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.1.8", "@npmcli/run-script": "^1.7.0", @@ -379,9 +379,9 @@ } }, "node_modules/@npmcli/arborist": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.29.tgz", - "integrity": "sha512-QbLzHlfJoExnrLpZYAdf14pYQfk+KpMkpQabjeusrJabrNsfHtfY+rr5HIcG4AAmb0VaiubcUdadqzpBVXgkcQ==", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.30.tgz", + "integrity": "sha512-L2xeTh6ca0RU/J57YZb/etKDsaRdUl+O7NrObIhgg5KaqF+IxOc6+QcDznnmN6swdZcxR0wX7o/VJqEyTv657w==", "inBundle": true, "dependencies": { "@npmcli/installed-package-contents": "^1.0.5", @@ -389,7 +389,7 @@ "@npmcli/metavuln-calculator": "^1.0.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.0", - "@npmcli/run-script": "^1.3.1", + "@npmcli/run-script": "^1.7.0", "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", @@ -8511,16 +8511,16 @@ } }, "@npmcli/arborist": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.29.tgz", - "integrity": "sha512-QbLzHlfJoExnrLpZYAdf14pYQfk+KpMkpQabjeusrJabrNsfHtfY+rr5HIcG4AAmb0VaiubcUdadqzpBVXgkcQ==", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.30.tgz", + "integrity": "sha512-L2xeTh6ca0RU/J57YZb/etKDsaRdUl+O7NrObIhgg5KaqF+IxOc6+QcDznnmN6swdZcxR0wX7o/VJqEyTv657w==", "requires": { "@npmcli/installed-package-contents": "^1.0.5", "@npmcli/map-workspaces": "^1.0.1", "@npmcli/metavuln-calculator": "^1.0.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.0", - "@npmcli/run-script": "^1.3.1", + "@npmcli/run-script": "^1.7.0", "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", diff --git a/package.json b/package.json index b8bfd16cedeb9..434657c5a5496 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@npmcli/arborist": "^0.0.29", + "@npmcli/arborist": "^0.0.30", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.1.8", "@npmcli/run-script": "^1.7.0", From fc3fc3a1e8c0c6f48ba703147b28b4b489fcb6bc Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 30 Sep 2020 17:35:04 -0700 Subject: [PATCH 36/39] add new @npmcli/node-gyp module to git --- node_modules/@npmcli/node-gyp/lib/index.js | 13 ++++++++++ node_modules/@npmcli/node-gyp/package.json | 30 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 node_modules/@npmcli/node-gyp/lib/index.js create mode 100644 node_modules/@npmcli/node-gyp/package.json diff --git a/node_modules/@npmcli/node-gyp/lib/index.js b/node_modules/@npmcli/node-gyp/lib/index.js new file mode 100644 index 0000000000000..747ec8eb9d44a --- /dev/null +++ b/node_modules/@npmcli/node-gyp/lib/index.js @@ -0,0 +1,13 @@ +const util = require('util') +const fs = require('fs') +const readdir = util.promisify(fs.readdir) + +async function isNodeGypPackage(path) { + const files = await readdir(path) + return files.some(f => /.*\.gyp$/.test(f)) +} + +module.exports = { + isNodeGypPackage, + defaultGypInstallScript: 'node-gyp rebuild' +} diff --git a/node_modules/@npmcli/node-gyp/package.json b/node_modules/@npmcli/node-gyp/package.json new file mode 100644 index 0000000000000..1a739b984a8c4 --- /dev/null +++ b/node_modules/@npmcli/node-gyp/package.json @@ -0,0 +1,30 @@ +{ + "name": "@npmcli/node-gyp", + "version": "1.0.0", + "description": "Tools for dealing with node-gyp packages", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "keywords": [ + "npm", + "cli", + "node-gyp" + ], + "files": [ + "lib/**/*.js" + ], + "main": "lib/index.js", + "author": "Brian Jenkins ", + "license": "ISC", + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "tap": "^14.10.6", + "tmp": "^0.2.1" + } +} From 07288326ec97c4f834ea36f176862476dc59b1ad Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 30 Sep 2020 17:25:03 -0700 Subject: [PATCH 37/39] docs: changelog for v7.0.0-rc.0 --- CHANGELOG.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7442cb776bbac..945c9140115c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,79 @@ +## v7.0.0-rc.0 (2020-10-01) + +* [`3b417055c`](https://github.com/npm/cli/commit/3b417055cf07c4ef8e4c5063f00d3c24b5f5cbd2) + [#1859](https://github.com/npm/cli/pull/1859) + fix `proxy` and `https-proxy` config support + ([@badeggg](https://github.com/badeggg)) +* [`dd7d7a284`](https://github.com/npm/cli/commit/dd7d7a284d5150d1804d0cd5a85519c86adf3bc2) + `@npmcli/arborist@0.0.30` + * [#1849](https://github.com/npm/cli/issues/1849) Do not drop peer/dev + dep while saving if both set + * Do not install or build if there is a global top bin conflict + * Default to building node-gyp dependencies +* [`40c17e12c`](https://github.com/npm/cli/commit/40c17e12c5a734c37b88692e36221ac974c0c63d) + `cli-table3@0.6.0` +* [`47a8ca1d7`](https://github.com/npm/cli/commit/47a8ca1d72f0f0835b45cfb2c4fb8ab1218dc14a) + `byte-size@7.0.0` +* [`81073f99a`](https://github.com/npm/cli/commit/81073f99a93b680e3ca08b8f099e9aca2aaf50be) + `eslint@7.10.0` +* [`67793abd4`](https://github.com/npm/cli/commit/67793abd4abdf315816b6266ddb045289f607b03) + `eslint-plugin-import@2.22.1` +* [`a27e8d006`](https://github.com/npm/cli/commit/a27e8d00664e5d4c3e81d664253a10176adb39c8) + `is-cidr@4.0.2` +* [`893fed45e`](https://github.com/npm/cli/commit/893fed45e2272ef764ebf927c659fcf5e7b355b3) + `marked-man@0.7.0` +* [`bc20e0c8a`](https://github.com/npm/cli/commit/bc20e0c8ae30a202c72af88586ab9c167dff980a) + `rimraf@3.0.2` +* [`a2b8fd3c1`](https://github.com/npm/cli/commit/a2b8fd3c153ecca55cb2d60654fff207688532ab) + `uuid@8.3.0` +* [`ee4c85b87`](https://github.com/npm/cli/commit/ee4c85b878410143644460c3860ab706a8c925e0) + `write-file-atomic@3.0.3` +* [`4bdad5fdf`](https://github.com/npm/cli/commit/4bdad5fdf6ef387e2159b529ba4652f0221433b5) + `bin-links@2.2.1` +* [`c394937ec`](https://github.com/npm/cli/commit/c394937ec1911cd17ec42c8fc74773047d47322c) + `@npmcli/run-script@1.7.0` + * Default to building node-gyp dependencies and projects +* remove many unused dependencies + ([@ruyadorno](https://github.com/ruyadorno)) + * [`558e9781a`](https://github.com/npm/cli/commit/558e9781ada06b66be4d2d5d0f7e763f645eda25) + deep-equal + * [`2aa9a1f8a`](https://github.com/npm/cli/commit/2aa9a1f8a5773b9a960b14b51c8111fb964bc9ae) + request + * [`d77594e52`](https://github.com/npm/cli/commit/d77594e52f2f7d65d45347f542f48e4dbb6d2f26) + npm-registry-couchapp + * [`8ec84d9f6`](https://github.com/npm/cli/commit/8ec84d9f691686da67bd14c2728472c94ab3b955) + tacks + * [`a07b421f7`](https://github.com/npm/cli/commit/a07b421f708c13d8239e7283ad89611b24b23d0a) + lincesee + * [`41126e165`](https://github.com/npm/cli/commit/41126e165d3d5625a55e140b84fdd02052520146) + npm-cache-filename + * [`130da51b5`](https://github.com/npm/cli/commit/130da51b553e550584f31e2a8a961f4338f2a0cd) + npm-registry-mock + * [`b355af486`](https://github.com/npm/cli/commit/b355af48696bb5001c6d2b938974d9ab9f5e2360) + sprintf-js + * [`721c0a873`](https://github.com/npm/cli/commit/721c0a8736f3cd0a0e75e0b89518a431553843c6) + uid-number + * [`9c920e5f5`](https://github.com/npm/cli/commit/9c920e5f584e4d912aabc6e412693f7142242a89) + umask + * [`aae1c38bb`](https://github.com/npm/cli/commit/aae1c38bbb983cf40e9b3df012b18bebba5e5400) + config-chain + * [`450845eac`](https://github.com/npm/cli/commit/450845eaceb7e178c8ec7867a67e5cc948986904) + find-npm-prefix + * [`963d542d3`](https://github.com/npm/cli/commit/963d542d385c7fe26830a885fe40d96010d01862) + has-unicode + * [`cad9cbc70`](https://github.com/npm/cli/commit/cad9cbc70561c8638ed6e56286f753693f411000) + infer-owner + * [`3ae02914d`](https://github.com/npm/cli/commit/3ae02914d49f3302d25c85d2242096bb2291f9f4) + lockfile + * [`7bc474d7c`](https://github.com/npm/cli/commit/7bc474d7cb2e2e083fd8358d0648d7c5fb43707f) + once + * [`5c5e0099a`](https://github.com/npm/cli/commit/5c5e0099a4708ec84da3d2e427e16c4a9cfe3c8a) + retry + * [`cfaddd334`](https://github.com/npm/cli/commit/cfaddd334b8b1eddcefa3cd2a9b823ec140271a4) + sha + * [`3a978ffc7`](https://github.com/npm/cli/commit/3a978ffc7fddd6802c81996a5710b2efd15edc11) + slide + ## v7.0.0-beta.13 (2020-09-29) * [`405e051f7`](https://github.com/npm/cli/commit/405e051f724a2e79844f78f8ea9ba019fdc513aa) From b5a1a219de1ffba07683ee56c8d6dea43b0b2385 Mon Sep 17 00:00:00 2001 From: Darcy Clarke Date: Thu, 1 Oct 2020 09:42:42 -0400 Subject: [PATCH 38/39] update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index f845e7c827f70..dd8474b2d0ea2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -706,3 +706,4 @@ Nathan LaFreniere Lucio Martinez Brian Jenkins nlf +zhaoxuxu From 7d21d08de18ea3eb40825ab7ee02272592dadce8 Mon Sep 17 00:00:00 2001 From: Darcy Clarke Date: Thu, 1 Oct 2020 09:42:43 -0400 Subject: [PATCH 39/39] 7.0.0-rc.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4087a87964994..61bd3adec4114 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "7.0.0-beta.13", + "version": "7.0.0-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "npm", - "version": "7.0.0-beta.13", + "version": "7.0.0-rc.0", "bundleDependencies": [ "@npmcli/arborist", "@npmcli/ci-detect", diff --git a/package.json b/package.json index 434657c5a5496..28b0f65cad7ee 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "7.0.0-beta.13", + "version": "7.0.0-rc.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [