diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index bda59af7eebcd8..4209517f2a0ff8 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -727,3 +727,6 @@ Jake Champion takenspc iraj Michele Azzolari +foxxyz +Dr +Jan Tojnar diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 737562a876909a..49d44ab10a09e0 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,59 @@ +## 7.0.8 (2020-11-03) + +### DOCUMENTATION + +* [`052e977b9`](https://github.com/npm/cli/commit/052e977b9d071e1b3654976881d10cd3ddcba788) + [#1822](https://github.com/npm/cli/issues/1822) + [#1247](https://github.com/npm/cli/issues/1247) + add section on peerDependenciesMeta field in package.json + ([@foxxyz](https://github.com/foxxyz)) +* [`52d32d175`](https://github.com/npm/cli/commit/52d32d1758c5ebc58944a1e8d98d57e30048e527) + [#1970](https://github.com/npm/cli/issues/1970) + match npm-exec.md -p usage with lib/exec.js + ([@dr-js](https://github.com/dr-js)) +* [`48ee8d01e`](https://github.com/npm/cli/commit/48ee8d01edd11ed6186c483e1169ff4d2070b963) + [#2096](https://github.com/npm/cli/issues/2096) + Fix RFC links in changelog + ([@jtojnar](https://github.com/jtojnar)) + + +### BUG FIXES + +* [`6cd3cd08a`](https://github.com/npm/cli/commit/6cd3cd08af56445e13757cac3af87f3e7d54ed27) + Support *all* conf keys in publishConfig +* [`a1f9be8a7`](https://github.com/npm/cli/commit/a1f9be8a7f9b7a3a813fc3e5e705bc982470b0e2) + [#2074](https://github.com/npm/cli/issues/2074) + Support publishing any kind of spec, not just directories + +### DEPENDENCIES + +* [`545382df6`](https://github.com/npm/cli/commit/545382df62e3014f3e51d7034e52498fb2b01a37) + `libnpmpublish@4.0.0`: + * Support publishing things other than folders +* [`7d88f1719`](https://github.com/npm/cli/commit/7d88f17197e3c8cca9b277378d6f9b054b1b7886) + `npm-registry-fetch@9.0.0` +* [`823b40a4e`](https://github.com/npm/cli/commit/823b40a4e9c6ef76388af6fe01a3624f6f7675be) + `pacote@11.1.12` +* [`90bf57826`](https://github.com/npm/cli/commit/90bf57826edf2f78ddf8deb0793115ead8a8b556) + `npm-profile@5.0.2` +* [`e5a413577`](https://github.com/npm/cli/commit/e5a4135770d13cf114fac439167637181f87d824) + `libnpmteam@2.0.2` +* [`fc5aa7b4a`](https://github.com/npm/cli/commit/fc5aa7b4ad45cb65893f734e1229a6720f7966e5) + `libnpmsearch@3.0.1` +* [`9fc1dee13`](https://github.com/npm/cli/commit/9fc1dee138ca33ecdbd57e63142b27c60cf88f9b) + `libnpmorg@2.0.1` +* [`0ea870ec5`](https://github.com/npm/cli/commit/0ea870ec5d2be1d44f050ad8bc24ed936cc45fde) + `libnpmhook@6.0.1` +* [`32fd744ea`](https://github.com/npm/cli/commit/32fd744ea745f297f0be79a80955f077a57c4ac7) + `libnpmaccess@4.0.1` +* [`fc76f3d9f`](https://github.com/npm/cli/commit/fc76f3d9fcf19e65a9373ab3d9068c4326d2f782) + `@npmcli/arborist@1.0.8` + * Fix `cannot read property 'description' of undefined` in `npm ls` + when `package-lock.json` is corrupted + * Do not allow peerDependencies to be nested under dependents in any + circumstances + * Always resolve peerDependencies in `--prefer-dedupe` mode + ## 7.0.7 (2020-10-30) ### BUG FIXES @@ -602,7 +658,7 @@ sources ([@ruyadorno](https://github.com/ruyadorno)) * [`3a63ecb6f`](https://github.com/npm/cli/commit/3a63ecb6f6a0b235660f73a3ffa329b1f131b0c3) [#1718](https://github.com/npm/cli/pull/1718) - [RFC-0029](https://github.com/npm/rfcs/blob/latest/accepted/0029-add-ability-to-skip-hooks.md) + [RFC-0029](https://github.com/npm/rfcs/blob/latest/implemented/0029-add-ability-to-skip-hooks.md) add ability to skip pre/post hooks to `npm run-script` by using `--ignore-scripts` ([@ruyadorno](https://github.com/ruyadorno)) @@ -829,7 +885,7 @@ Now on to the list of **BREAKING CHANGES**! ### Programmatic Usage - [RFC - 20](https://github.com/npm/rfcs/blob/latest/accepted/0020-npm-option-handling.md) + 20](https://github.com/npm/rfcs/blob/latest/implemented/0020-npm-option-handling.md) The CLI and its dependencies no longer use the `figgy-pudding` library for configs. Configuration is done using a flat plain old JavaScript object. @@ -859,7 +915,7 @@ The environment for lifecycle scripts (eg, build scripts, `npm test`, etc.) has changed. - [RFC - 21](https://github.com/npm/rfcs/blob/latest/accepted/0021-reduce-lifecycle-script-environment.md) + 21](https://github.com/npm/rfcs/blob/latest/implemented/0021-reduce-lifecycle-script-environment.md) Environment no longer includes `npm_package_*` fields, or `npm_config_*` fields for default configs. `npm_package_json`, `npm_package_integrity`, `npm_package_resolved`, and `npm_command` environment variables added. @@ -868,13 +924,13 @@ has changed. release](https://github.com/npm/rfcs/pull/183)) - [RFC - 22](https://github.com/npm/rfcs/blob/latest/accepted/0022-quieter-install-scripts.md) + 22](https://github.com/npm/rfcs/blob/latest/implemented/0022-quieter-install-scripts.md) Scripts run during the normal course of installation are silenced unless they exit in error (ie, with a signal or non-zero exit status code), and are for a non-optional dependency. - [RFC - 24](https://github.com/npm/rfcs/blob/latest/accepted/0024-npm-run-traverse-directory-tree.md) + 24](https://github.com/npm/rfcs/blob/latest/implemented/0024-npm-run-traverse-directory-tree.md) `PATH` environment variable includes all `node_modules/.bin` folders, even if found outside of an existing `node_modules` folder hierarchy. @@ -924,7 +980,7 @@ We do intend to continue supporting the `npx` that npm ships; just not the ### Files On Disk - [RFC - 13](https://github.com/npm/rfcs/blob/latest/accepted/0013-no-package-json-_fields.md) + 13](https://github.com/npm/rfcs/blob/latest/implemented/0013-no-package-json-_fields.md) Installed `package.json` files no longer are mutated to include extra metadata. (This extra metadata is stored in the lockfile.) - `package-lock.json` is updated to a newer format, using @@ -940,7 +996,7 @@ These changes affect `install`, `ci`, `install-test`, `install-ci-test`, `update`, `prune`, `dedupe`, `uninstall`, `link`, and `audit fix`. - [RFC - 25](https://github.com/npm/rfcs/blob/latest/accepted/0025-install-peer-deps.md) + 25](https://github.com/npm/rfcs/blob/latest/implemented/0025-install-peer-deps.md) `peerDependencies` are installed by default. This behavior can be disabled by setting the `legacy-peer-deps` configuration flag. @@ -951,7 +1007,7 @@ These changes affect `install`, `ci`, `install-test`, `install-ci-test`, of correctness. Use the `--legacy-peer-deps` config flag if impacted. - [RFC - 23](https://github.com/npm/rfcs/blob/latest/accepted/0023-acceptDependencies.md) + 23](https://github.com/npm/rfcs/blob/latest/implemented/0023-acceptDependencies.md) Support for `acceptDependencies` is added. This can result in dependency resolutions that previous versions of npm will incorrectly flag as invalid. @@ -973,7 +1029,7 @@ These changes affect `install`, `ci`, `install-test`, `install-ci-test`, ### Workspaces - [RFC - 26](https://github.com/npm/rfcs/blob/latest/accepted/0026-workspaces.md) + 26](https://github.com/npm/rfcs/blob/latest/implemented/0026-workspaces.md) First phase of `workspaces` support is added. This changes npm's behavior when a root project's `package.json` file contains a `workspaces` field. @@ -981,7 +1037,7 @@ These changes affect `install`, `ci`, `install-test`, `install-ci-test`, ### `npm update` - [RFC - 19](https://github.com/npm/rfcs/blob/latest/accepted/0019-remove-update-depth-option.md) + 19](https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md) Update all dependencies when `npm update` is run without any arguments. As it is no longer relevant, `--depth` config flag removed from `npm update`. @@ -989,7 +1045,7 @@ These changes affect `install`, `ci`, `install-test`, `install-ci-test`, ### `npm outdated` - [RFC - 27](https://github.com/npm/rfcs/blob/latest/accepted/0027-remove-depth-outdated.md) + 27](https://github.com/npm/rfcs/blob/latest/implemented/0027-remove-depth-outdated.md) Remove `--depth` config from `npm outdated`. Only top-level dependencies are shown, unless `--all` config option is set. diff --git a/deps/npm/bin/node-gyp-bin/node-gyp.cmd b/deps/npm/bin/node-gyp-bin/node-gyp.cmd index 083c9c58a502a1..1ef2ae0c68fc4b 100755 --- a/deps/npm/bin/node-gyp-bin/node-gyp.cmd +++ b/deps/npm/bin/node-gyp-bin/node-gyp.cmd @@ -1,5 +1,5 @@ -if not defined npm_config_node_gyp ( - node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* -) else ( +if not defined npm_config_node_gyp ( + node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* +) else ( node "%npm_config_node_gyp%" %* -) +) diff --git a/deps/npm/bin/npm.cmd b/deps/npm/bin/npm.cmd index 880554dcdd686e..f111c59d1efb6e 100755 --- a/deps/npm/bin/npm.cmd +++ b/deps/npm/bin/npm.cmd @@ -1,19 +1,19 @@ -:: Created by npm, please don't edit manually. -@ECHO OFF - -SETLOCAL - -SET "NODE_EXE=%~dp0\node.exe" -IF NOT EXIST "%NODE_EXE%" ( - SET "NODE_EXE=node" -) - -SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" -FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( - SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" -) -IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" ( - SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%" -) - -"%NODE_EXE%" "%NPM_CLI_JS%" %* +:: Created by npm, please don't edit manually. +@ECHO OFF + +SETLOCAL + +SET "NODE_EXE=%~dp0\node.exe" +IF NOT EXIST "%NODE_EXE%" ( + SET "NODE_EXE=node" +) + +SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" +FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( + SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" +) +IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" ( + SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%" +) + +"%NODE_EXE%" "%NPM_CLI_JS%" %* diff --git a/deps/npm/bin/npx.cmd b/deps/npm/bin/npx.cmd index 9339ebd0652820..b79518ec505409 100755 --- a/deps/npm/bin/npx.cmd +++ b/deps/npm/bin/npx.cmd @@ -1,20 +1,20 @@ -:: Created by npm, please don't edit manually. -@ECHO OFF - -SETLOCAL - -SET "NODE_EXE=%~dp0\node.exe" -IF NOT EXIST "%NODE_EXE%" ( - SET "NODE_EXE=node" -) - -SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" -SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js" -FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( - SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js" -) -IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" ( - SET "NPX_CLI_JS=%NPM_PREFIX_NPX_CLI_JS%" -) - -"%NODE_EXE%" "%NPX_CLI_JS%" %* +:: Created by npm, please don't edit manually. +@ECHO OFF + +SETLOCAL + +SET "NODE_EXE=%~dp0\node.exe" +IF NOT EXIST "%NODE_EXE%" ( + SET "NODE_EXE=node" +) + +SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" +SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js" +FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( + SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js" +) +IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" ( + SET "NPX_CLI_JS=%NPM_PREFIX_NPX_CLI_JS%" +) + +"%NODE_EXE%" "%NPX_CLI_JS%" %* diff --git a/deps/npm/changelogs/CHANGELOG-5.md b/deps/npm/changelogs/CHANGELOG-5.md index 57496984913d6f..ea8331b1b76f3f 100644 --- a/deps/npm/changelogs/CHANGELOG-5.md +++ b/deps/npm/changelogs/CHANGELOG-5.md @@ -1935,7 +1935,7 @@ helpful when community members go over our code and help clean it up, too! * [`9e5b76140`](https://github.com/npm/npm/commit/9e5b76140ffdb7dcd12aa402793644213fb8c5d7) [#17411](https://github.com/npm/npm/pull/17411) Convert all callback-style `move` usage to use Promises. - ([@vramana](https://github.com/vramana)) + ([@vramana](https://github.com/vramana)) * [`0711c08f7`](https://github.com/npm/npm/commit/0711c08f779ac641ec42ecc96f604c8861008b28) [#17394](https://github.com/npm/npm/pull/17394) Remove unused argument in `deepSortObject`. diff --git a/deps/npm/docs/content/commands/npm-completion.md b/deps/npm/docs/content/commands/npm-completion.md index 40ddc418de12fb..53737c8033194b 100644 --- a/deps/npm/docs/content/commands/npm-completion.md +++ b/deps/npm/docs/content/commands/npm-completion.md @@ -25,8 +25,8 @@ npm completion >> ~/.zshrc ``` You may of course also pipe the output of `npm completion` to a file -such as `/usr/local/etc/bash_completion.d/npm` or -`/etc/bash_completion.d/npm` if you have a system that will read +such as `/usr/local/etc/bash_completion.d/npm` or +`/etc/bash_completion.d/npm` if you have a system that will read that file for you. When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index 9142850f39c511..d0440efe890215 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -25,8 +25,8 @@ npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3" Note that you must be the package owner to deprecate something. See the `owner` and `adduser` help topics. -To un-deprecate a package, specify an empty string (`""`) for the `message` -argument. Note that you must use double quotes with no space between them to +To un-deprecate a package, specify an empty string (`""`) for the `message` +argument. Note that you must use double quotes with no space between them to format an empty string. ### See Also diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index e966b0bcd18b21..38fb1bf25af4be 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -30,9 +30,9 @@ This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via `npm run`. -Whatever packages are specified by the `--package` or `-p` option will be +Whatever packages are specified by the `--package` option will be provided in the `PATH` of the executed command, along with any locally -installed package executables. The `--package` or `-p` option may be +installed package executables. The `--package` option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available. @@ -48,7 +48,7 @@ only be considered a match if they have the exact same name and version as the local dependency. If no `-c` or `--call` option is provided, then the positional arguments -are used to generate the command string. If no `-p` or `--package` options +are used to generate the command string. If no `--package` options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic: diff --git a/deps/npm/docs/content/commands/npm-profile.md b/deps/npm/docs/content/commands/npm-profile.md index 07f94873bc8588..d44c994167f053 100644 --- a/deps/npm/docs/content/commands/npm-profile.md +++ b/deps/npm/docs/content/commands/npm-profile.md @@ -46,7 +46,7 @@ you're using a non-npmjs registry. | updated | 2017-10-02T21:29:45.922Z | +-----------------+---------------------------+ ``` - + * `npm profile set `: Set the value of a profile property. You can set the following properties this way: email, fullname, homepage, freenode, twitter, github diff --git a/deps/npm/docs/content/commands/npm-token.md b/deps/npm/docs/content/commands/npm-token.md index 61c6662c38423a..3716a0990299b1 100644 --- a/deps/npm/docs/content/commands/npm-token.md +++ b/deps/npm/docs/content/commands/npm-token.md @@ -60,5 +60,5 @@ This lets you list, create and revoke authentication tokens. * `npm token revoke `: This removes an authentication token, making it immediately unusable. This can accept both complete tokens (as you get back from `npm token create` and will - find in your `.npmrc`) and ids as seen in the `npm token list` output. + find in your `.npmrc`) and ids as seen in the `npm token list` output. This will NOT accept the truncated token found in `npm token list` output. diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md index 61f5e48d09f90f..b39a7c09eb6e4e 100644 --- a/deps/npm/docs/content/commands/npm-unpublish.md +++ b/deps/npm/docs/content/commands/npm-unpublish.md @@ -34,7 +34,7 @@ Even if a package version is unpublished, that specific name and version combination can never be reused. In order to publish the package again, a new version number must be used. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed. -To learn more about how unpublish is treated on the npm registry, see our unpublish policies. +To learn more about how unpublish is treated on the npm registry, see our unpublish policies. ### See Also diff --git a/deps/npm/docs/content/commands/npm-update.md b/deps/npm/docs/content/commands/npm-update.md index 0f0003873f8bd1..424d686189dca6 100644 --- a/deps/npm/docs/content/commands/npm-update.md +++ b/deps/npm/docs/content/commands/npm-update.md @@ -31,8 +31,8 @@ As of `npm@2.6.1`, the `npm update` will only inspect top-level packages. Prior versions of `npm` would also recursively inspect all dependencies. To get the old behavior, use `npm --depth 9999 update`. -As of `npm@5.0.0`, the `npm update` will change `package.json` to save the -new version as the minimum required dependency. To get the old behavior, +As of `npm@5.0.0`, the `npm update` will change `package.json` to save the +new version as the minimum required dependency. To get the old behavior, use `npm update --no-save`. ### Example diff --git a/deps/npm/docs/content/commands/npm-version.md b/deps/npm/docs/content/commands/npm-version.md index dfe71c708ef838..5f93ef44ae5dd1 100644 --- a/deps/npm/docs/content/commands/npm-version.md +++ b/deps/npm/docs/content/commands/npm-version.md @@ -94,7 +94,7 @@ and tag up to the server, and deletes the `build/temp` directory. * Default: false * Type: Boolean -Prevents throwing an error when `npm version` is used to set the new version +Prevents throwing an error when `npm version` is used to set the new version to the same value as the current version. #### git-tag-version diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md index adc2f12eb41627..3404c0314335b7 100644 --- a/deps/npm/docs/content/commands/npm-view.md +++ b/deps/npm/docs/content/commands/npm-view.md @@ -88,7 +88,7 @@ was required by each matching version of yui3: ```bash npm view yui3@'>0.5.4' dependencies.jsdom -``` +``` To show the `connect` package version history, you can do this: diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 74e2cbd11eec35..8b9b4ffbb1074a 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -716,6 +716,30 @@ the host package's major version will break your plugin. Thus, if you've worked with every 1.x version of the host package, use `"^1.0"` or `"1.x"` to express this. If you depend on features introduced in 1.5.2, use `">= 1.5.2 < 2"`. +### peerDependenciesMeta + +When a user installs your package, npm will emit warnings if packages specified in `peerDependencies` are not already installed. The `peerDependenciesMeta` field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional. + +For example: + +```json +{ + "name": "tea-latte", + "version": "1.3.5", + "peerDependencies": { + "tea": "2.x", + "soy-milk": "1.2" + }, + "peerDependenciesMeta": { + "soy-milk": { + "optional": true + } + } +} +``` + +Marking a peer dependency as optional ensures npm will not emit a warning if the `soy-milk` package is not installed on the host. This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed. + ### bundledDependencies This defines an array of package names that will be bundled when publishing diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md index 05d48506388545..f86f9e88bc9ddf 100644 --- a/deps/npm/docs/content/using-npm/scripts.md +++ b/deps/npm/docs/content/using-npm/scripts.md @@ -141,14 +141,14 @@ suites, then those executables will be added to the `PATH` for executing the scripts. So, if your package.json has this: ```json -{ - "name" : "foo", - "dependencies" : { - "bar" : "0.1.x" - }, - "scripts": { - "start" : "bar ./test" - } +{ + "name" : "foo", + "dependencies" : { + "bar" : "0.1.x" + }, + "scripts": { + "start" : "bar ./test" + } } ``` @@ -178,14 +178,14 @@ there is a config param of `[@]:`. For example, if the package.json has this: ```json -{ - "name" : "foo", - "config" : { - "port" : "8080" - }, - "scripts" : { - "start" : "node server.js" - } +{ + "name" : "foo", + "config" : { + "port" : "8080" + }, + "scripts" : { + "start" : "node server.js" + } } ``` @@ -221,10 +221,10 @@ process.env.npm_package_scripts_install === "foo.js" For example, if your package.json contains this: ```json -{ - "scripts" : { - "install" : "scripts/install.js", - "postinstall" : "scripts/postinstall.js", +{ + "scripts" : { + "install" : "scripts/install.js", + "postinstall" : "scripts/postinstall.js", "uninstall" : "scripts/uninstall.js" } } @@ -241,10 +241,10 @@ If you want to run a make command, you can do so. This works just fine: ```json -{ - "scripts" : { - "preinstall" : "./configure", - "install" : "make && make install", +{ + "scripts" : { + "preinstall" : "./configure", + "install" : "make && make install", "test" : "make test" } } diff --git a/deps/npm/docs/content/using-npm/workspaces.md b/deps/npm/docs/content/using-npm/workspaces.md index 348ab1cffd18d5..0379bd1549062e 100644 --- a/deps/npm/docs/content/using-npm/workspaces.md +++ b/deps/npm/docs/content/using-npm/workspaces.md @@ -92,3 +92,4 @@ nested workspaces to be consumed elsewhere. * [npm install](/commands/npm-install) * [npm publish](/commands/npm-publish) + diff --git a/deps/npm/docs/output/commands/npm-exec.html b/deps/npm/docs/output/commands/npm-exec.html index 7499271c905daf..6bd59f7a8ed674 100644 --- a/deps/npm/docs/output/commands/npm-exec.html +++ b/deps/npm/docs/output/commands/npm-exec.html @@ -165,9 +165,9 @@

Description

This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via npm run.

-

Whatever packages are specified by the --package or -p option will be +

Whatever packages are specified by the --package option will be provided in the PATH of the executed command, along with any locally -installed package executables. The --package or -p option may be +installed package executables. The --package option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available.

If any requested packages are not present in the local project @@ -180,7 +180,7 @@

Description

only be considered a match if they have the exact same name and version as the local dependency.

If no -c or --call option is provided, then the positional arguments -are used to generate the command string. If no -p or --package options +are used to generate the command string. If no --package options are provided, then npm will attempt to determine the executable name from the package specifier provided as the first positional argument according to the following heuristic:

diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 01249ced1c3ade..55722b8f1ce325 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -156,7 +156,7 @@

Description

limit the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm’s source tree will show:

-
    npm@7.0.7 /path/to/npm
+
    npm@7.0.8 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
 
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 39e6d3b0cada9e..e3f5ce28afc480 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -148,7 +148,7 @@

Table of contents

npm <command> [args]
 

Version

-

7.0.7

+

7.0.8

Description

npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 7032f052992dc3..0fdac293e3e4f0 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -141,7 +141,7 @@

package.json

Table of contents

- +

Description

@@ -669,6 +669,24 @@

peerDependencies

the host package’s major version will break your plugin. Thus, if you’ve worked with every 1.x version of the host package, use "^1.0" or "1.x" to express this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2".

+

peerDependenciesMeta

+

When a user installs your package, npm will emit warnings if packages specified in peerDependencies are not already installed. The peerDependenciesMeta field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional.

+

For example:

+
{
+  "name": "tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "tea": "2.x",
+    "soy-milk": "1.2"
+  },
+  "peerDependenciesMeta": {
+    "soy-milk": {
+      "optional": true
+    }
+  }
+}
+
+

Marking a peer dependency as optional ensures npm will not emit a warning if the soy-milk package is not installed on the host. This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed.

bundledDependencies

This defines an array of package names that will be bundled when publishing the package.

diff --git a/deps/npm/docs/output/using-npm/scripts.html b/deps/npm/docs/output/using-npm/scripts.html index 75fa87724ffde1..dc9d952142dfd9 100644 --- a/deps/npm/docs/output/using-npm/scripts.html +++ b/deps/npm/docs/output/using-npm/scripts.html @@ -266,14 +266,14 @@

path

If you depend on modules that define executable scripts, like test suites, then those executables will be added to the PATH for executing the scripts. So, if your package.json has this:

-
{
-  "name" : "foo",
-  "dependencies" : {
-    "bar" : "0.1.x"
-  },
-  "scripts": {
-    "start" : "bar ./test"
-  }
+
{ 
+  "name" : "foo", 
+  "dependencies" : { 
+    "bar" : "0.1.x" 
+  }, 
+  "scripts": { 
+    "start" : "bar ./test" 
+  } 
 }
 

then you could run npm start to execute the bar script, which is @@ -294,14 +294,14 @@

Special: package.json “config” ob

The package.json “config” keys are overwritten in the environment if there is a config param of <name>[@<version>]:<key>. For example, if the package.json has this:

-
{
-  "name" : "foo",
-  "config" : {
-    "port" : "8080"
-  },
-  "scripts" : {
-    "start" : "node server.js"
-  }
+
{ 
+  "name" : "foo", 
+  "config" : { 
+    "port" : "8080" 
+  }, 
+  "scripts" : { 
+    "start" : "node server.js" 
+  } 
 }
 

and the server.js is this:

@@ -322,10 +322,10 @@

current lifecycle event

Examples

For example, if your package.json contains this:

-
{
-  "scripts" : {
-    "install" : "scripts/install.js",
-    "postinstall" : "scripts/postinstall.js",
+
{ 
+  "scripts" : { 
+    "install" : "scripts/install.js", 
+    "postinstall" : "scripts/postinstall.js", 
     "uninstall" : "scripts/uninstall.js"
   }
 }
@@ -338,10 +338,10 @@ 

Examples

variable.

If you want to run a make command, you can do so. This works just fine:

-
{
-  "scripts" : {
-    "preinstall" : "./configure",
-    "install" : "make && make install",
+
{ 
+  "scripts" : { 
+    "preinstall" : "./configure", 
+    "install" : "make && make install", 
     "test" : "make test"
   }
 }
diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js
index 0ad5204c9624b5..da58134f7c2501 100644
--- a/deps/npm/lib/publish.js
+++ b/deps/npm/lib/publish.js
@@ -6,12 +6,17 @@ const semver = require('semver')
 const pack = require('libnpmpack')
 const libpub = require('libnpmpublish').publish
 const runScript = require('@npmcli/run-script')
+const pacote = require('pacote')
+const npa = require('npm-package-arg')
 
 const npm = require('./npm.js')
 const output = require('./utils/output.js')
 const otplease = require('./utils/otplease.js')
 const { getContents, logTar } = require('./utils/tar.js')
 
+// this is the only case in the CLI where we use the old full slow
+// 'read-package-json' module, because we want to pull in all the
+// defaults and metadata, like git sha's and default scripts and all that.
 const readJson = util.promisify(require('read-package-json'))
 
 const completion = require('./utils/completion/none.js')
@@ -46,47 +51,75 @@ const publish = async args => {
   return tarball
 }
 
+// if it's a directory, read it from the file system
+// otherwise, get the full metadata from whatever it is
+const getManifest = (spec, opts) =>
+  spec.type === 'directory' ? readJson(`${spec.fetchSpec}/package.json`)
+  : pacote.manifest(spec, { ...opts, fullMetadata: true })
+
+// for historical reasons, publishConfig in package.json can contain
+// ANY config keys that npm supports in .npmrc files and elsewhere.
+// We *may* want to revisit this at some point, and have a minimal set
+// that's a SemVer-major change that ought to get a RFC written on it.
+const { flatten } = require('./utils/flat-options.js')
+const publishConfigToOpts = publishConfig =>
+  // create a new object that inherits from the config stack
+  // then squash the css-case into camelCase opts, like we do
+  flatten(Object.assign(Object.create(npm.config.list[0]), publishConfig))
+
 const publish_ = async (arg, opts) => {
   const { unicode, dryRun, json } = opts
-  let manifest = await readJson(`${arg}/package.json`)
-
-  // prepublishOnly
-  await runScript({
-    event: 'prepublishOnly',
-    path: arg,
-    stdio: 'inherit',
-    pkg: manifest,
-  })
+  // you can publish name@version, ./foo.tgz, etc.
+  // even though the default is the 'file:.' cwd.
+  const spec = npa(arg)
+  const manifest = await getManifest(spec, opts)
+
+  if (manifest.publishConfig)
+    Object.assign(opts, publishConfigToOpts(manifest.publishConfig))
+
+  // only run scripts for directory type publishes
+  if (spec.type === 'directory') {
+    await runScript({
+      event: 'prepublishOnly',
+      path: spec.fetchSpec,
+      stdio: 'inherit',
+      pkg: manifest,
+    })
+  }
 
-  const tarballData = await pack(arg)
+  const tarballData = await pack(spec, opts)
   const pkgContents = await getContents(manifest, tarballData)
 
+  // note that logTar calls npmlog.notice(), so if we ARE in silent mode,
+  // this will do nothing, but we still want it in the debuglog if it fails.
   if (!json)
     logTar(pkgContents, { log, unicode })
 
   if (!dryRun) {
     // The purpose of re-reading the manifest is in case it changed,
     // so that we send the latest and greatest thing to the registry
-    manifest = await readJson(`${arg}/package.json`)
-    const { publishConfig } = manifest
-    await otplease(opts, opts => libpub(arg, manifest, { ...opts, publishConfig }))
+    // note that publishConfig might have changed as well!
+    const manifest = await getManifest(spec, opts)
+    if (manifest.publishConfig)
+      Object.assign(opts, publishConfigToOpts(manifest.publishConfig))
+    await otplease(opts, opts => libpub(manifest, tarballData, opts))
   }
 
-  // publish
-  await runScript({
-    event: 'publish',
-    path: arg,
-    stdio: 'inherit',
-    pkg: manifest,
-  })
-
-  // postpublish
-  await runScript({
-    event: 'postpublish',
-    path: arg,
-    stdio: 'inherit',
-    pkg: manifest,
-  })
+  if (spec.type === 'directory') {
+    await runScript({
+      event: 'publish',
+      path: spec.fetchSpec,
+      stdio: 'inherit',
+      pkg: manifest,
+    })
+
+    await runScript({
+      event: 'postpublish',
+      path: spec.fetchSpec,
+      stdio: 'inherit',
+      pkg: manifest,
+    })
+  }
 
   return pkgContents
 }
diff --git a/deps/npm/lib/utils/flat-options.js b/deps/npm/lib/utils/flat-options.js
index d7713ae13122f4..be62c5a4cdb589 100644
--- a/deps/npm/lib/utils/flat-options.js
+++ b/deps/npm/lib/utils/flat-options.js
@@ -7,241 +7,231 @@ const npmSession = crypto.randomBytes(8).toString('hex')
 log.verbose('npm-session', npmSession)
 const { join } = require('path')
 
-const buildOmitList = npm => {
-  const include = npm.config.get('include') || []
-  const omit = new Set((npm.config.get('omit') || [])
+const buildOmitList = obj => {
+  const include = obj.include || []
+  const omit = new Set((obj.omit || [])
     .filter(type => !include.includes(type)))
-  const only = npm.config.get('only')
+  const only = obj.only
 
-  if (/^prod(uction)?$/.test(only) || npm.config.get('production'))
+  if (/^prod(uction)?$/.test(only) || obj.production)
     omit.add('dev')
 
-  if (/dev/.test(npm.config.get('also')))
+  if (/dev/.test(obj.also))
     omit.delete('dev')
 
-  if (npm.config.get('dev'))
+  if (obj.dev)
     omit.delete('dev')
 
-  if (npm.config.get('optional') === false)
+  if (obj.optional === false)
     omit.add('optional')
 
-  npm.config.set('omit', [...omit])
+  obj.omit = [...omit]
   return [...omit]
 }
 
-const flatOptions = npm => npm.flatOptions || Object.freeze({
-  // Note that many of these do not come from configs or cli flags
-  // per se, though they may be implied or defined by them.
-  log,
-  npmSession,
-  dmode: npm.modes.exec,
-  fmode: npm.modes.file,
-  umask: npm.modes.umask,
-  hashAlgorithm: 'sha1', // XXX should this be sha512?
-  color: !!npm.color,
-  includeStaged: npm.config.get('include-staged'),
-
-  preferDedupe: npm.config.get('prefer-dedupe'),
-  ignoreScripts: npm.config.get('ignore-scripts'),
-
-  projectScope: npm.projectScope,
-  npmVersion: npm.version,
-  nodeVersion: npm.config.get('node-version'),
-  // npm.command is not set until AFTER flatOptions are defined
-  // so we need to make this a getter.
-  get npmCommand () {
-    return npm.command
-  },
-
-  tmp: npm.tmp,
-  cache: join(npm.config.get('cache'), '_cacache'),
-  prefix: npm.prefix,
-  globalPrefix: npm.globalPrefix,
-  localPrefix: npm.localPrefix,
-  global: npm.config.get('global'),
-
-  metricsRegistry: npm.config.get('metrics-registry') ||
-    npm.config.get('registry'),
-  sendMetrics: npm.config.get('send-metrics'),
-  registry: npm.config.get('registry'),
-  scope: npm.config.get('scope'),
-  access: npm.config.get('access'),
-  alwaysAuth: npm.config.get('always-auth'),
-  audit: npm.config.get('audit'),
-  auditLevel: npm.config.get('audit-level'),
-  authType: npm.config.get('auth-type'),
-  ssoType: npm.config.get('sso-type'),
-  ssoPollFrequency: npm.config.get('sso-poll-frequency'),
-  before: npm.config.get('before'),
-  browser: npm.config.get('browser'),
-  ca: npm.config.get('ca'),
-  cafile: npm.config.get('cafile'),
-  cert: npm.config.get('cert'),
-  key: npm.config.get('key'),
-
-  // XXX remove these when we don't use lockfile any more, once
-  // arborist is handling the installation process
-  cacheLockRetries: npm.config.get('cache-lock-retries'),
-  cacheLockStale: npm.config.get('cache-lock-stale'),
-  cacheLockWait: npm.config.get('cache-lock-wait'),
-  lockFile: {
-    retries: npm.config.get('cache-lock-retries'),
-    stale: npm.config.get('cache-lock-stale'),
-    wait: npm.config.get('cache-lock-wait'),
-  },
-
-  // XXX remove these once no longer used
-  get cacheMax () {
-    return npm.config.get('cache-max')
-  },
-  get cacheMin () {
-    return npm.config.get('cache-min')
-  },
+// turn an object with npm-config style keys into an options object
+// with camelCase values.  This doesn't account for the stuff that is
+// not pulled from the config keys, that's all handled only for the
+// main function which acts on the npm object itself.  Used by the
+// flatOptions generator, and by the publishConfig handling logic.
+const flatten = obj => ({
+  includeStaged: obj['include-staged'],
+  preferDedupe: obj['prefer-dedupe'],
+  ignoreScripts: obj['ignore-scripts'],
+  nodeVersion: obj['node-version'],
+  cache: join(obj.cache, '_cacache'),
+  global: obj.global,
+
+  metricsRegistry: obj['metrics-registry'] || obj.registry,
+  sendMetrics: obj['send-metrics'],
+  registry: obj.registry,
+  scope: obj.scope,
+  access: obj.access,
+  alwaysAuth: obj['always-auth'],
+  audit: obj.audit,
+  auditLevel: obj['audit-level'],
+  authType: obj['auth-type'],
+  ssoType: obj['sso-type'],
+  ssoPollFrequency: obj['sso-poll-frequency'],
+  before: obj.before,
+  browser: obj.browser,
+  ca: obj.ca,
+  cafile: obj.cafile,
+  cert: obj.cert,
+  key: obj.key,
 
   // token creation options
-  cidr: npm.config.get('cidr'),
-  readOnly: npm.config.get('read-only'),
+  cidr: obj.cidr,
+  readOnly: obj['read-only'],
 
   // npm version options
-  preid: npm.config.get('preid'),
-  tagVersionPrefix: npm.config.get('tag-version-prefix'),
-  allowSameVersion: npm.config.get('allow-same-version'),
+  preid: obj.preid,
+  tagVersionPrefix: obj['tag-version-prefix'],
+  allowSameVersion: obj['allow-same-version'],
 
   // npm version git options
-  message: npm.config.get('message'),
-  commitHooks: npm.config.get('commit-hooks'),
-  gitTagVersion: npm.config.get('git-tag-version'),
-  signGitCommit: npm.config.get('sign-git-commit'),
-  signGitTag: npm.config.get('sign-git-tag'),
+  message: obj.message,
+  commitHooks: obj['commit-hooks'],
+  gitTagVersion: obj['git-tag-version'],
+  signGitCommit: obj['sign-git-commit'],
+  signGitTag: obj['sign-git-tag'],
 
   // only used for npm ls in v7, not update
-  depth: npm.config.get('depth'),
-  all: npm.config.get('all'),
+  depth: obj.depth,
+  all: obj.all,
 
   // Output configs
-  unicode: npm.config.get('unicode'),
-  json: npm.config.get('json'),
-  long: npm.config.get('long'),
-  parseable: npm.config.get('parseable'),
+  unicode: obj.unicode,
+  json: obj.json,
+  long: obj.long,
+  parseable: obj.parseable,
 
   // options for npm search
   search: {
-    description: npm.config.get('description'),
-    exclude: npm.config.get('searchexclude'),
-    limit: npm.config.get('searchlimit') || 20,
-    opts: npm.config.get('searchopts'),
-    staleness: npm.config.get('searchstaleness'),
+    description: obj.description,
+    exclude: obj.searchexclude,
+    limit: obj.searchlimit || 20,
+    opts: obj.searchopts,
+    staleness: obj.searchstaleness,
   },
 
-  dryRun: npm.config.get('dry-run'),
-  engineStrict: npm.config.get('engine-strict'),
+  dryRun: obj['dry-run'],
+  engineStrict: obj['engine-strict'],
 
   retry: {
-    retries: npm.config.get('fetch-retries'),
-    factor: npm.config.get('fetch-retry-factor'),
-    maxTimeout: npm.config.get('fetch-retry-maxtimeout'),
-    minTimeout: npm.config.get('fetch-retry-mintimeout'),
+    retries: obj['fetch-retries'],
+    factor: obj['fetch-retry-factor'],
+    maxTimeout: obj['fetch-retry-maxtimeout'],
+    minTimeout: obj['fetch-retry-mintimeout'],
   },
 
-  timeout: npm.config.get('fetch-timeout'),
+  timeout: obj['fetch-timeout'],
 
-  force: npm.config.get('force'),
+  force: obj.force,
 
-  formatPackageLock: npm.config.get('format-package-lock'),
-  fund: npm.config.get('fund'),
+  formatPackageLock: obj['format-package-lock'],
+  fund: obj.fund,
 
   // binary locators
-  git: npm.config.get('git'),
-  npmBin: require.main.filename,
-  nodeBin: process.env.NODE || process.execPath,
-  viewer: npm.config.get('viewer'),
-  editor: npm.config.get('editor'),
+  git: obj.git,
+  viewer: obj.viewer,
+  editor: obj.editor,
 
   // configs that affect how we build trees
-  binLinks: npm.config.get('bin-links'),
-  rebuildBundle: npm.config.get('rebuild-bundle'),
+  binLinks: obj['bin-links'],
+  rebuildBundle: obj['rebuild-bundle'],
   // --no-shrinkwrap is the same as --no-package-lock
-  packageLock: !(npm.config.get('package-lock') === false ||
-    npm.config.get('shrinkwrap') === false),
-  packageLockOnly: npm.config.get('package-lock-only'),
-  globalStyle: npm.config.get('global-style'),
-  legacyBundling: npm.config.get('legacy-bundling'),
-  scriptShell: npm.config.get('script-shell') || undefined,
-  shell: npm.config.get('shell'),
-  omit: buildOmitList(npm),
-  legacyPeerDeps: npm.config.get('legacy-peer-deps'),
-  strictPeerDeps: npm.config.get('strict-peer-deps'),
+  packageLock: !(obj['package-lock'] === false ||
+    obj.shrinkwrap === false),
+  packageLockOnly: obj['package-lock-only'],
+  globalStyle: obj['global-style'],
+  legacyBundling: obj['legacy-bundling'],
+  scriptShell: obj['script-shell'] || undefined,
+  shell: obj.shell,
+  omit: buildOmitList(obj),
+  legacyPeerDeps: obj['legacy-peer-deps'],
+  strictPeerDeps: obj['strict-peer-deps'],
 
   // npx stuff
-  call: npm.config.get('call'),
-  package: npm.config.get('package'),
+  call: obj.call,
+  package: obj.package,
 
   // used to build up the appropriate {add:{...}} options to Arborist.reify
-  save: npm.config.get('save'),
-  saveBundle: npm.config.get('save-bundle') && !npm.config.get('save-peer'),
-  saveType: npm.config.get('save-optional') && npm.config.get('save-peer')
+  save: obj.save,
+  saveBundle: obj['save-bundle'] && !obj['save-peer'],
+  saveType: obj['save-optional'] && obj['save-peer']
     ? 'peerOptional'
-    : npm.config.get('save-optional') ? 'optional'
-    : npm.config.get('save-dev') ? 'dev'
-    : npm.config.get('save-peer') ? 'peer'
-    : npm.config.get('save-prod') ? 'prod'
+    : obj['save-optional'] ? 'optional'
+    : obj['save-dev'] ? 'dev'
+    : obj['save-peer'] ? 'peer'
+    : obj['save-prod'] ? 'prod'
     : null,
-  savePrefix: npm.config.get('save-exact') ? ''
-  : npm.config.get('save-prefix'),
+  savePrefix: obj['save-exact'] ? ''
+  : obj['save-prefix'],
 
   // configs for npm-registry-fetch
-  otp: npm.config.get('otp'),
-  offline: npm.config.get('offline'),
-  preferOffline: getPreferOffline(npm),
-  preferOnline: getPreferOnline(npm),
-  strictSSL: npm.config.get('strict-ssl'),
-  defaultTag: npm.config.get('tag'),
-  get tag () {
-    return npm.config.get('tag')
-  },
-  userAgent: npm.config.get('user-agent'),
+  otp: obj.otp,
+  offline: obj.offline,
+  preferOffline: getPreferOffline(obj),
+  preferOnline: getPreferOnline(obj),
+  strictSSL: obj['strict-ssl'],
+  defaultTag: obj.tag,
+  userAgent: obj['user-agent'],
 
   // yes, it's fine, just do it, jeez, stop asking
-  yes: npm.config.get('yes'),
+  yes: obj.yes,
 
-  ...getScopesAndAuths(npm),
+  ...getScopesAndAuths(obj),
 
   // npm fund exclusive option to select an item from a funding list
-  which: npm.config.get('which'),
+  which: obj.which,
 
   // socks proxy can be configured in https-proxy or proxy field
-  // note that the various (HTTPS_|HTTP_|)PROXY environs will be
+  // 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'),
+  proxy: obj['https-proxy'] || obj.proxy,
+  noProxy: obj.noproxy,
+})
+
+const flatOptions = npm => npm.flatOptions || Object.freeze({
+  // flatten the config object
+  ...flatten(npm.config.list[0]),
+
+  // Note that many of these do not come from configs or cli flags
+  // per se, though they may be implied or defined by them.
+  log,
+  npmSession,
+  dmode: npm.modes.exec,
+  fmode: npm.modes.file,
+  umask: npm.modes.umask,
+  hashAlgorithm: 'sha1', // XXX should this be sha512?
+  color: !!npm.color,
+  projectScope: npm.projectScope,
+  npmVersion: npm.version,
+
+  // npm.command is not set until AFTER flatOptions are defined
+  // so we need to make this a getter.
+  get npmCommand () {
+    return npm.command
+  },
+
+  tmp: npm.tmp,
+  prefix: npm.prefix,
+  globalPrefix: npm.globalPrefix,
+  localPrefix: npm.localPrefix,
+  npmBin: require.main && require.main.filename,
+  nodeBin: process.env.NODE || process.execPath,
+  get tag () {
+    return npm.config.get('tag')
+  },
 })
 
-const getPreferOnline = npm => {
-  const po = npm.config.get('prefer-online')
+const getPreferOnline = obj => {
+  const po = obj['prefer-online']
   if (po !== undefined)
     return po
 
-  return npm.config.get('cache-max') <= 0
+  return obj['cache-max'] <= 0
 }
 
-const getPreferOffline = npm => {
-  const po = npm.config.get('prefer-offline')
+const getPreferOffline = obj => {
+  const po = obj['prefer-offline']
   if (po !== undefined)
     return po
 
-  return npm.config.get('cache-min') >= 9999
+  return obj['cache-min'] >= 9999
 }
 
 // pull out all the @scope: and //host:key config fields
 // these are used by npm-registry-fetch for authing against registries
-const getScopesAndAuths = npm => {
+const getScopesAndAuths = obj => {
   const scopesAndAuths = {}
   // pull out all the @scope:... configs into a flat object.
-  for (const key in npm.config.list[0]) {
+  for (const key in obj) {
     if (/@.*:registry$/i.test(key) || /^\/\//.test(key))
-      scopesAndAuths[key] = npm.config.get(key)
+      scopesAndAuths[key] = obj[key]
   }
   return scopesAndAuths
 }
 
-module.exports = flatOptions
+module.exports = Object.assign(flatOptions, { flatten })
diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1
index 2a747745782224..6048388fd6e262 100644
--- a/deps/npm/man/man1/npm-exec.1
+++ b/deps/npm/man/man1/npm-exec.1
@@ -28,9 +28,9 @@ This command allows you to run an arbitrary command from an npm package
 (either one installed locally, or fetched remotely), in a similar context
 as running it via \fBnpm run\fP\|\.
 .P
-Whatever packages are specified by the \fB\-\-package\fP or \fB\-p\fP option will be
+Whatever packages are specified by the \fB\-\-package\fP option will be
 provided in the \fBPATH\fP of the executed command, along with any locally
-installed package executables\.  The \fB\-\-package\fP or \fB\-p\fP option may be
+installed package executables\.  The \fB\-\-package\fP option may be
 specified multiple times, to execute the supplied command in an environment
 where all specified packages are available\.
 .P
@@ -46,7 +46,7 @@ only be considered a match if they have the exact same name and version as
 the local dependency\.
 .P
 If no \fB\-c\fP or \fB\-\-call\fP option is provided, then the positional arguments
-are used to generate the command string\.  If no \fB\-p\fP or \fB\-\-package\fP options
+are used to generate the command string\.  If no \fB\-\-package\fP options
 are provided, then npm will attempt to determine the executable name from
 the package specifier provided as the first positional argument according
 to the following heuristic:
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 3d2fed764a924f..afa7913b743853 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show:
 .P
 .RS 2
 .nf
-    npm@7\.0\.7 /path/to/npm
+    npm@7\.0\.8 /path/to/npm
     └─┬ init\-package\-json@0\.0\.4
       └── promzard@0\.1\.5
 .fi
diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1
index 8933a8fd21c35d..556aea1f796490 100644
--- a/deps/npm/man/man1/npm-unpublish.1
+++ b/deps/npm/man/man1/npm-unpublish.1
@@ -31,7 +31,7 @@ Even if a package version is unpublished, that specific name and
 version combination can never be reused\. In order to publish the
 package again, a new version number must be used\. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed\.
 .P
-To learn more about how unpublish is treated on the npm registry, see our  unpublish policies\|\.
+To learn more about how unpublish is treated on the npm registry, see our  unpublish policies\|\. 
 .SS See Also
 .RS 0
 .IP \(bu 2
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 2a11538115e497..9197f45f0ad022 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm  [args]
 .RE
 .SS Version
 .P
-7\.0\.7
+7\.0\.8
 .SS Description
 .P
 npm is the package manager for the Node JavaScript platform\.  It puts
diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5
index a8301544eeed85..83f3babc75b0b3 100644
--- a/deps/npm/man/man5/package-json.5
+++ b/deps/npm/man/man5/package-json.5
@@ -801,6 +801,31 @@ Assuming the host complies with semver \fIhttps://semver\.org/\fR, only changes
 the host package's major version will break your plugin\. Thus, if you've worked
 with every 1\.x version of the host package, use \fB"^1\.0"\fP or \fB"1\.x"\fP to express
 this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fP\|\.
+.SS peerDependenciesMeta
+.P
+When a user installs your package, npm will emit warnings if packages specified in \fBpeerDependencies\fP are not already installed\. The \fBpeerDependenciesMeta\fP field serves to provide npm more information on how your peer dependencies are to be used\. Specifically, it allows peer dependencies to be marked as optional\.
+.P
+For example:
+.P
+.RS 2
+.nf
+{
+  "name": "tea\-latte",
+  "version": "1\.3\.5",
+  "peerDependencies": {
+    "tea": "2\.x",
+    "soy\-milk": "1\.2"
+  },
+  "peerDependenciesMeta": {
+    "soy\-milk": {
+      "optional": true
+    }
+  }
+}
+.fi
+.RE
+.P
+Marking a peer dependency as optional ensures npm will not emit a warning if the \fBsoy\-milk\fP package is not installed on the host\. This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed\.
 .SS bundledDependencies
 .P
 This defines an array of package names that will be bundled when publishing
diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7
index abba619ce021ee..522e32cb80e158 100644
--- a/deps/npm/man/man7/scripts.7
+++ b/deps/npm/man/man7/scripts.7
@@ -194,14 +194,14 @@ executing the scripts\.  So, if your package\.json has this:
 .P
 .RS 2
 .nf
-{
-  "name" : "foo",
-  "dependencies" : {
-    "bar" : "0\.1\.x"
-  },
-  "scripts": {
-    "start" : "bar \./test"
-  }
+{ 
+  "name" : "foo", 
+  "dependencies" : { 
+    "bar" : "0\.1\.x" 
+  }, 
+  "scripts": { 
+    "start" : "bar \./test" 
+  } 
 }
 .fi
 .RE
@@ -230,14 +230,14 @@ if the package\.json has this:
 .P
 .RS 2
 .nf
-{
-  "name" : "foo",
-  "config" : {
-    "port" : "8080"
-  },
-  "scripts" : {
-    "start" : "node server\.js"
-  }
+{ 
+  "name" : "foo", 
+  "config" : { 
+    "port" : "8080" 
+  }, 
+  "scripts" : { 
+    "start" : "node server\.js" 
+  } 
 }
 .fi
 .RE
@@ -279,10 +279,10 @@ For example, if your package\.json contains this:
 .P
 .RS 2
 .nf
-{
-  "scripts" : {
-    "install" : "scripts/install\.js",
-    "postinstall" : "scripts/postinstall\.js",
+{ 
+  "scripts" : { 
+    "install" : "scripts/install\.js", 
+    "postinstall" : "scripts/postinstall\.js", 
     "uninstall" : "scripts/uninstall\.js"
   }
 }
@@ -301,10 +301,10 @@ fine:
 .P
 .RS 2
 .nf
-{
-  "scripts" : {
-    "preinstall" : "\./configure",
-    "install" : "make && make install",
+{ 
+  "scripts" : { 
+    "preinstall" : "\./configure", 
+    "install" : "make && make install", 
     "test" : "make test"
   }
 }
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js
index 23497827a77494..54a6ff33751a1f 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js
@@ -759,6 +759,11 @@ This is a one-time fix-up, please be patient...
       // be forced to agree on a version of z.
       const dep = vrDep && vrDep.satisfies(edge) ? vrDep
         : await this[_nodeFromEdge](edge, edge.peer ? virtualRoot : null)
+      /* istanbul ignore next */
+      debug(() => {
+        if (!dep)
+          throw new Error('no dep??')
+      })
       tasks.push({edge, dep})
     }
 
@@ -1055,13 +1060,18 @@ This is a one-time fix-up, please be patient...
     // top nodes should still get peer deps from their fsParent if possible,
     // and only install locally if there's no other option, eg for a link
     // outside of the project root, or for a conflicted dep.
-    const start = edge.peer && !node.isRoot
-      ? node.resolveParent || node
+    const start = edge.peer && !node.isRoot ? node.resolveParent || node
       : node
 
     let target
     let canPlace = null
     for (let check = start; check; check = check.resolveParent) {
+      // if the current location has a peerDep on it, then we can't place here
+      // this is pretty rare to hit, since we always prefer deduping peers.
+      const checkEdge = check.edgesOut.get(edge.name)
+      if (!check.isTop && checkEdge && checkEdge.peer)
+        continue
+
       const cp = this[_canPlaceDep](dep, check, edge, peerEntryEdge, peerPath)
 
       // anything other than a conflict is fine to proceed with
@@ -1210,9 +1220,15 @@ This is a one-time fix-up, please be patient...
     // otherwise they'd be gone and the peer set would change throughout
     // this loop.
     for (const peerEdge of newDep.edgesOut.values()) {
-      if (!peerEdge.peer || peerEdge.valid)
-        continue
       const peer = virtualRoot.children.get(peerEdge.name)
+
+      // Note: if the virtualRoot *doesn't* have the peer, then that means
+      // it's an optional peer dep.  If it's not being properly met (ie,
+      // peerEdge.valid is false), that this is likely heading for an
+      // ERESOLVE error, unless it can walk further up the tree.
+      if (!peerEdge.peer || peerEdge.valid || !peer)
+        continue
+
       const peerPlaced = this[_placeDep](
         peer, newDep, peerEdge, peerEntryEdge || edge, peerPath)
       placed.push(...peerPlaced)
@@ -1264,6 +1280,11 @@ This is a one-time fix-up, please be patient...
   // When we check peers, we pass along the peerEntryEdge to track the
   // original edge that caused us to load the family of peer dependencies.
   [_canPlaceDep] (dep, target, edge, peerEntryEdge = null, peerPath = []) {
+    /* istanbul ignore next */
+    debug(() => {
+      if (!dep)
+        throw new Error('no dep??')
+    })
     const entryEdge = peerEntryEdge || edge
     const source = this[_peerSetSource].get(dep)
     const isSource = target === source
@@ -1308,7 +1329,10 @@ This is a one-time fix-up, please be patient...
         return KEEP
 
       // if we prefer deduping, then try replacing newer with older
-      if (this[_preferDedupe] && !tryReplace && dep.canReplace(current)) {
+      // we always prefer to dedupe peers, because they are trying
+      // a bit harder to be singletons.
+      const preferDedupe = this[_preferDedupe] || edge.peer
+      if (preferDedupe && !tryReplace && dep.canReplace(current)) {
         const res = this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge, peerPath)
         /* istanbul ignore else - It's extremely rare that a replaceable
          * node would be a conflict, if the current one wasn't a conflict,
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/node.js b/deps/npm/node_modules/@npmcli/arborist/lib/node.js
index cc3a7ec5ef709e..a783ce9c975722 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/node.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/node.js
@@ -175,7 +175,7 @@ class Node {
 
     // have to set the internal package ref before assigning the parent,
     // because this.package is read when adding to inventory
-    this[_package] = pkg
+    this[_package] = pkg && typeof pkg === 'object' ? pkg : {}
 
     // only relevant for the root and top nodes
     this.meta = meta
@@ -307,6 +307,13 @@ class Node {
       edge.detach()
 
     this[_explanation] = null
+    /* istanbul ignore next - should be impossible */
+    if (!pkg || typeof pkg !== 'object') {
+      debug(() => {
+        throw new Error('setting Node.package to non-object')
+      })
+      pkg = {}
+    }
     this[_package] = pkg
     this[_loadWorkspaces]()
     this[_loadDeps]()
diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json
index 73c6ce58d28391..fe72f409c4a457 100644
--- a/deps/npm/node_modules/@npmcli/arborist/package.json
+++ b/deps/npm/node_modules/@npmcli/arborist/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@npmcli/arborist",
-  "version": "1.0.6",
+  "version": "1.0.8",
   "description": "Manage node_modules trees",
   "dependencies": {
     "@npmcli/installed-package-contents": "^1.0.5",
diff --git a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
index d41b044ed9298d..b1b1db35c5a861 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
@@ -92,7 +92,8 @@ const setEnvs = (config) => {
   if (cliConf['node-options'])
     env.NODE_OPTIONS = cliConf['node-options']
 
-  env.npm_execpath = require.main.filename
+  if (require.main && require.main.filename)
+    env.npm_execpath = require.main.filename
   env.npm_node_execpath = config.execPath
 }
 
diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md b/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md
index a50779fcdc430c..b890b58e1405ae 100644
--- a/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md
+++ b/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md
@@ -3,3 +3,4 @@
 ## 0.0.0-pre.0
 
 - Initial pre-release.
+
diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/README.md b/deps/npm/node_modules/@npmcli/map-workspaces/README.md
index 001b269e458ff6..f8e114c2a14ca3 100644
--- a/deps/npm/node_modules/@npmcli/map-workspaces/README.md
+++ b/deps/npm/node_modules/@npmcli/map-workspaces/README.md
@@ -80,3 +80,4 @@ A **Map** in which keys are **package names** and values are the **pathnames** f
 ## LICENSE
 
 [ISC](./LICENSE)
+
diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js
index 02321a8fee978d..61602898db7ab5 100644
--- a/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js
+++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js
@@ -10,3 +10,4 @@ module.exports = (mani, name) => {
     ? mani.peerDependencies[name]
     : null
 }
+
diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd b/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd
index a59f0c4f9722e0..4c6987ac9868b2 100755
--- a/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd
+++ b/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd
@@ -1 +1 @@
-@node "%npm_config_node_gyp%" %*
+@node "%npm_config_node_gyp%" %*
diff --git a/deps/npm/node_modules/ajv/lib/dot/if.jst b/deps/npm/node_modules/ajv/lib/dot/if.jst
index e3098c77af3f4b..adb50361245a1f 100644
--- a/deps/npm/node_modules/ajv/lib/dot/if.jst
+++ b/deps/npm/node_modules/ajv/lib/dot/if.jst
@@ -63,10 +63,11 @@
 
   if (!{{=$valid}}) {
     {{# def.extraError:'if' }}
-  }
+  } 
   {{? $breakOnError }} else { {{?}}
 {{??}}
   {{? $breakOnError }}
     if (true) {
   {{?}}
 {{?}}
+
diff --git a/deps/npm/node_modules/ajv/lib/refs/data.json b/deps/npm/node_modules/ajv/lib/refs/data.json
index 317c6542e015fd..64aac5b613db10 100644
--- a/deps/npm/node_modules/ajv/lib/refs/data.json
+++ b/deps/npm/node_modules/ajv/lib/refs/data.json
@@ -8,7 +8,7 @@
         "$data": {
             "type": "string",
             "anyOf": [
-                { "format": "relative-json-pointer" },
+                { "format": "relative-json-pointer" }, 
                 { "format": "json-pointer" }
             ]
         }
diff --git a/deps/npm/node_modules/byte-size/README.md b/deps/npm/node_modules/byte-size/README.md
index afa6640a435210..71f47b1e49b3c5 100644
--- a/deps/npm/node_modules/byte-size/README.md
+++ b/deps/npm/node_modules/byte-size/README.md
@@ -140,7 +140,7 @@ Override the built-in defaults for the duration of the process by passing an opt
 ### 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
+**Kind**: Exported function  
 
 | Param | Type | Description |
 | --- | --- | --- |
@@ -156,7 +156,7 @@ Returns an object with the spec `{ value: string, unit: string, long: string }`.
 #### byteSize.defaultOptions(options)
 Set the default `byteSize` options for the duration of the process.
 
-**Kind**: static method of [byteSize](#exp_module_byte-size--byteSize)
+**Kind**: static method of [byteSize](#exp_module_byte-size--byteSize)  
 
 | Param | Type | Description |
 | --- | --- | --- |
diff --git a/deps/npm/node_modules/cacache/README.md b/deps/npm/node_modules/cacache/README.md
index f0f58be0e1eb5b..3f70f49a40b6c0 100644
--- a/deps/npm/node_modules/cacache/README.md
+++ b/deps/npm/node_modules/cacache/README.md
@@ -442,7 +442,7 @@ the reader functions, but their default will be to read from memory.
 ##### `opts.tmpPrefix`
 Default: null
 
-Prefix to append on the temporary directory name inside the cache's tmp dir.
+Prefix to append on the temporary directory name inside the cache's tmp dir. 
 
 ####  `> cacache.rm.all(cache) -> Promise`
 
@@ -542,7 +542,7 @@ cacache.tmp.mkdir(cache).then(dir => {
 
 Creates a temporary directory with [`tmp.mkdir()`](#tmp-mkdir) and calls `cb`
 with it. The created temporary directory will be removed when the return value
-of `cb()` resolves, the tmp directory will be automatically deleted once that
+of `cb()` resolves, the tmp directory will be automatically deleted once that 
 promise completes.
 
 The same caveats apply when it comes to managing permissions for the tmp dir's
@@ -565,7 +565,7 @@ cacache.tmp.withTmp(cache, dir => {
 ##### `opts.tmpPrefix`
 Default: null
 
-Prefix to append on the temporary directory name inside the cache's tmp dir.
+Prefix to append on the temporary directory name inside the cache's tmp dir. 
 
 ####  Subresource Integrity Digests
 
diff --git a/deps/npm/node_modules/cli-table3/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/cli-table3/node_modules/strip-ansi/readme.md
index e0ef1a809b6a50..7c4b56d46ddc72 100644
--- a/deps/npm/node_modules/cli-table3/node_modules/strip-ansi/readme.md
+++ b/deps/npm/node_modules/cli-table3/node_modules/strip-ansi/readme.md
@@ -43,3 +43,4 @@ The maintainers of strip-ansi and thousands of other packages are working with T
 
 - [Sindre Sorhus](https://github.com/sindresorhus)
 - [Josh Junon](https://github.com/qix-)
+
diff --git a/deps/npm/node_modules/cmd-shim/lib/to-batch-syntax.js b/deps/npm/node_modules/cmd-shim/lib/to-batch-syntax.js
index 59d242c071efe9..f3f5ffa63cbb59 100644
--- a/deps/npm/node_modules/cmd-shim/lib/to-batch-syntax.js
+++ b/deps/npm/node_modules/cmd-shim/lib/to-batch-syntax.js
@@ -1,49 +1,51 @@
-exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair
-exports.convertToSetCommand = convertToSetCommand
-exports.convertToSetCommands = convertToSetCommands
-
-function convertToSetCommand(key, value) {
-    var line = ""
-    key = key || ""
-    key = key.trim()
-    value = value || ""
-    value = value.trim()
-    if(key && value && value.length > 0) {
-        line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n"
-    }
-    return line
-}
-
-function extractVariableValuePairs(declarations) {
-    var pairs = {}
-    declarations.map(function(declaration) {
-        var split = declaration.split("=")
-        pairs[split[0]]=split[1]
-    })
-    return pairs
-}
-
-function convertToSetCommands(variableString) {
-    var variableValuePairs = extractVariableValuePairs(variableString.split(" "))
-    var variableDeclarationsAsBatch = ""
-    Object.keys(variableValuePairs).forEach(function (key) {
-        variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])
-    })
-    return variableDeclarationsAsBatch
-}
-
-function replaceDollarWithPercentPair(value) {
-    var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g
-    var result = ""
-    var startIndex = 0
-    do {
-        var match = dollarExpressions.exec(value)
-        if(match) {
-            var betweenMatches = value.substring(startIndex, match.index) || ""
-            result +=  betweenMatches + "%" + match[1] + "%"
-            startIndex = dollarExpressions.lastIndex
-        }
-    } while (dollarExpressions.lastIndex > 0)
-    result += value.substr(startIndex)
-    return result
-}
+exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair
+exports.convertToSetCommand = convertToSetCommand
+exports.convertToSetCommands = convertToSetCommands
+
+function convertToSetCommand(key, value) {
+    var line = ""
+    key = key || ""
+    key = key.trim()
+    value = value || ""
+    value = value.trim()
+    if(key && value && value.length > 0) {
+        line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n"
+    }
+    return line
+}
+
+function extractVariableValuePairs(declarations) {
+    var pairs = {}
+    declarations.map(function(declaration) {
+        var split = declaration.split("=")
+        pairs[split[0]]=split[1]
+    })
+    return pairs
+}
+
+function convertToSetCommands(variableString) {
+    var variableValuePairs = extractVariableValuePairs(variableString.split(" "))
+    var variableDeclarationsAsBatch = ""
+    Object.keys(variableValuePairs).forEach(function (key) {
+        variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])
+    })
+    return variableDeclarationsAsBatch
+}
+
+function replaceDollarWithPercentPair(value) {
+    var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g
+    var result = ""
+    var startIndex = 0
+    do {
+        var match = dollarExpressions.exec(value)
+        if(match) {
+            var betweenMatches = value.substring(startIndex, match.index) || ""
+            result +=  betweenMatches + "%" + match[1] + "%"
+            startIndex = dollarExpressions.lastIndex
+        }
+    } while (dollarExpressions.lastIndex > 0)
+    result += value.substr(startIndex)
+    return result
+}
+
+
diff --git a/deps/npm/node_modules/color-name/LICENSE b/deps/npm/node_modules/color-name/LICENSE
index 4d9802a89e2999..c6b10012540c24 100644
--- a/deps/npm/node_modules/color-name/LICENSE
+++ b/deps/npm/node_modules/color-name/LICENSE
@@ -1,8 +1,8 @@
-The MIT License (MIT)
-Copyright (c) 2015 Dmitry Ivanov
-
-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 MIT License (MIT)
+Copyright (c) 2015 Dmitry Ivanov
+
+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/deps/npm/node_modules/color-name/README.md b/deps/npm/node_modules/color-name/README.md
index 3611a6b523fe85..932b979176f33b 100644
--- a/deps/npm/node_modules/color-name/README.md
+++ b/deps/npm/node_modules/color-name/README.md
@@ -1,11 +1,11 @@
-A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
-
-[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/)
-
-
-```js
-var colors = require('color-name');
-colors.red //[255,0,0]
-```
-
-
+A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
+
+[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/)
+
+
+```js
+var colors = require('color-name');
+colors.red //[255,0,0]
+```
+
+
diff --git a/deps/npm/node_modules/color-name/index.js b/deps/npm/node_modules/color-name/index.js
index e42aa68a542d9e..b7c198a6f3d7c5 100644
--- a/deps/npm/node_modules/color-name/index.js
+++ b/deps/npm/node_modules/color-name/index.js
@@ -1,152 +1,152 @@
-'use strict'
-
-module.exports = {
-	"aliceblue": [240, 248, 255],
-	"antiquewhite": [250, 235, 215],
-	"aqua": [0, 255, 255],
-	"aquamarine": [127, 255, 212],
-	"azure": [240, 255, 255],
-	"beige": [245, 245, 220],
-	"bisque": [255, 228, 196],
-	"black": [0, 0, 0],
-	"blanchedalmond": [255, 235, 205],
-	"blue": [0, 0, 255],
-	"blueviolet": [138, 43, 226],
-	"brown": [165, 42, 42],
-	"burlywood": [222, 184, 135],
-	"cadetblue": [95, 158, 160],
-	"chartreuse": [127, 255, 0],
-	"chocolate": [210, 105, 30],
-	"coral": [255, 127, 80],
-	"cornflowerblue": [100, 149, 237],
-	"cornsilk": [255, 248, 220],
-	"crimson": [220, 20, 60],
-	"cyan": [0, 255, 255],
-	"darkblue": [0, 0, 139],
-	"darkcyan": [0, 139, 139],
-	"darkgoldenrod": [184, 134, 11],
-	"darkgray": [169, 169, 169],
-	"darkgreen": [0, 100, 0],
-	"darkgrey": [169, 169, 169],
-	"darkkhaki": [189, 183, 107],
-	"darkmagenta": [139, 0, 139],
-	"darkolivegreen": [85, 107, 47],
-	"darkorange": [255, 140, 0],
-	"darkorchid": [153, 50, 204],
-	"darkred": [139, 0, 0],
-	"darksalmon": [233, 150, 122],
-	"darkseagreen": [143, 188, 143],
-	"darkslateblue": [72, 61, 139],
-	"darkslategray": [47, 79, 79],
-	"darkslategrey": [47, 79, 79],
-	"darkturquoise": [0, 206, 209],
-	"darkviolet": [148, 0, 211],
-	"deeppink": [255, 20, 147],
-	"deepskyblue": [0, 191, 255],
-	"dimgray": [105, 105, 105],
-	"dimgrey": [105, 105, 105],
-	"dodgerblue": [30, 144, 255],
-	"firebrick": [178, 34, 34],
-	"floralwhite": [255, 250, 240],
-	"forestgreen": [34, 139, 34],
-	"fuchsia": [255, 0, 255],
-	"gainsboro": [220, 220, 220],
-	"ghostwhite": [248, 248, 255],
-	"gold": [255, 215, 0],
-	"goldenrod": [218, 165, 32],
-	"gray": [128, 128, 128],
-	"green": [0, 128, 0],
-	"greenyellow": [173, 255, 47],
-	"grey": [128, 128, 128],
-	"honeydew": [240, 255, 240],
-	"hotpink": [255, 105, 180],
-	"indianred": [205, 92, 92],
-	"indigo": [75, 0, 130],
-	"ivory": [255, 255, 240],
-	"khaki": [240, 230, 140],
-	"lavender": [230, 230, 250],
-	"lavenderblush": [255, 240, 245],
-	"lawngreen": [124, 252, 0],
-	"lemonchiffon": [255, 250, 205],
-	"lightblue": [173, 216, 230],
-	"lightcoral": [240, 128, 128],
-	"lightcyan": [224, 255, 255],
-	"lightgoldenrodyellow": [250, 250, 210],
-	"lightgray": [211, 211, 211],
-	"lightgreen": [144, 238, 144],
-	"lightgrey": [211, 211, 211],
-	"lightpink": [255, 182, 193],
-	"lightsalmon": [255, 160, 122],
-	"lightseagreen": [32, 178, 170],
-	"lightskyblue": [135, 206, 250],
-	"lightslategray": [119, 136, 153],
-	"lightslategrey": [119, 136, 153],
-	"lightsteelblue": [176, 196, 222],
-	"lightyellow": [255, 255, 224],
-	"lime": [0, 255, 0],
-	"limegreen": [50, 205, 50],
-	"linen": [250, 240, 230],
-	"magenta": [255, 0, 255],
-	"maroon": [128, 0, 0],
-	"mediumaquamarine": [102, 205, 170],
-	"mediumblue": [0, 0, 205],
-	"mediumorchid": [186, 85, 211],
-	"mediumpurple": [147, 112, 219],
-	"mediumseagreen": [60, 179, 113],
-	"mediumslateblue": [123, 104, 238],
-	"mediumspringgreen": [0, 250, 154],
-	"mediumturquoise": [72, 209, 204],
-	"mediumvioletred": [199, 21, 133],
-	"midnightblue": [25, 25, 112],
-	"mintcream": [245, 255, 250],
-	"mistyrose": [255, 228, 225],
-	"moccasin": [255, 228, 181],
-	"navajowhite": [255, 222, 173],
-	"navy": [0, 0, 128],
-	"oldlace": [253, 245, 230],
-	"olive": [128, 128, 0],
-	"olivedrab": [107, 142, 35],
-	"orange": [255, 165, 0],
-	"orangered": [255, 69, 0],
-	"orchid": [218, 112, 214],
-	"palegoldenrod": [238, 232, 170],
-	"palegreen": [152, 251, 152],
-	"paleturquoise": [175, 238, 238],
-	"palevioletred": [219, 112, 147],
-	"papayawhip": [255, 239, 213],
-	"peachpuff": [255, 218, 185],
-	"peru": [205, 133, 63],
-	"pink": [255, 192, 203],
-	"plum": [221, 160, 221],
-	"powderblue": [176, 224, 230],
-	"purple": [128, 0, 128],
-	"rebeccapurple": [102, 51, 153],
-	"red": [255, 0, 0],
-	"rosybrown": [188, 143, 143],
-	"royalblue": [65, 105, 225],
-	"saddlebrown": [139, 69, 19],
-	"salmon": [250, 128, 114],
-	"sandybrown": [244, 164, 96],
-	"seagreen": [46, 139, 87],
-	"seashell": [255, 245, 238],
-	"sienna": [160, 82, 45],
-	"silver": [192, 192, 192],
-	"skyblue": [135, 206, 235],
-	"slateblue": [106, 90, 205],
-	"slategray": [112, 128, 144],
-	"slategrey": [112, 128, 144],
-	"snow": [255, 250, 250],
-	"springgreen": [0, 255, 127],
-	"steelblue": [70, 130, 180],
-	"tan": [210, 180, 140],
-	"teal": [0, 128, 128],
-	"thistle": [216, 191, 216],
-	"tomato": [255, 99, 71],
-	"turquoise": [64, 224, 208],
-	"violet": [238, 130, 238],
-	"wheat": [245, 222, 179],
-	"white": [255, 255, 255],
-	"whitesmoke": [245, 245, 245],
-	"yellow": [255, 255, 0],
-	"yellowgreen": [154, 205, 50]
-};
+'use strict'
+
+module.exports = {
+	"aliceblue": [240, 248, 255],
+	"antiquewhite": [250, 235, 215],
+	"aqua": [0, 255, 255],
+	"aquamarine": [127, 255, 212],
+	"azure": [240, 255, 255],
+	"beige": [245, 245, 220],
+	"bisque": [255, 228, 196],
+	"black": [0, 0, 0],
+	"blanchedalmond": [255, 235, 205],
+	"blue": [0, 0, 255],
+	"blueviolet": [138, 43, 226],
+	"brown": [165, 42, 42],
+	"burlywood": [222, 184, 135],
+	"cadetblue": [95, 158, 160],
+	"chartreuse": [127, 255, 0],
+	"chocolate": [210, 105, 30],
+	"coral": [255, 127, 80],
+	"cornflowerblue": [100, 149, 237],
+	"cornsilk": [255, 248, 220],
+	"crimson": [220, 20, 60],
+	"cyan": [0, 255, 255],
+	"darkblue": [0, 0, 139],
+	"darkcyan": [0, 139, 139],
+	"darkgoldenrod": [184, 134, 11],
+	"darkgray": [169, 169, 169],
+	"darkgreen": [0, 100, 0],
+	"darkgrey": [169, 169, 169],
+	"darkkhaki": [189, 183, 107],
+	"darkmagenta": [139, 0, 139],
+	"darkolivegreen": [85, 107, 47],
+	"darkorange": [255, 140, 0],
+	"darkorchid": [153, 50, 204],
+	"darkred": [139, 0, 0],
+	"darksalmon": [233, 150, 122],
+	"darkseagreen": [143, 188, 143],
+	"darkslateblue": [72, 61, 139],
+	"darkslategray": [47, 79, 79],
+	"darkslategrey": [47, 79, 79],
+	"darkturquoise": [0, 206, 209],
+	"darkviolet": [148, 0, 211],
+	"deeppink": [255, 20, 147],
+	"deepskyblue": [0, 191, 255],
+	"dimgray": [105, 105, 105],
+	"dimgrey": [105, 105, 105],
+	"dodgerblue": [30, 144, 255],
+	"firebrick": [178, 34, 34],
+	"floralwhite": [255, 250, 240],
+	"forestgreen": [34, 139, 34],
+	"fuchsia": [255, 0, 255],
+	"gainsboro": [220, 220, 220],
+	"ghostwhite": [248, 248, 255],
+	"gold": [255, 215, 0],
+	"goldenrod": [218, 165, 32],
+	"gray": [128, 128, 128],
+	"green": [0, 128, 0],
+	"greenyellow": [173, 255, 47],
+	"grey": [128, 128, 128],
+	"honeydew": [240, 255, 240],
+	"hotpink": [255, 105, 180],
+	"indianred": [205, 92, 92],
+	"indigo": [75, 0, 130],
+	"ivory": [255, 255, 240],
+	"khaki": [240, 230, 140],
+	"lavender": [230, 230, 250],
+	"lavenderblush": [255, 240, 245],
+	"lawngreen": [124, 252, 0],
+	"lemonchiffon": [255, 250, 205],
+	"lightblue": [173, 216, 230],
+	"lightcoral": [240, 128, 128],
+	"lightcyan": [224, 255, 255],
+	"lightgoldenrodyellow": [250, 250, 210],
+	"lightgray": [211, 211, 211],
+	"lightgreen": [144, 238, 144],
+	"lightgrey": [211, 211, 211],
+	"lightpink": [255, 182, 193],
+	"lightsalmon": [255, 160, 122],
+	"lightseagreen": [32, 178, 170],
+	"lightskyblue": [135, 206, 250],
+	"lightslategray": [119, 136, 153],
+	"lightslategrey": [119, 136, 153],
+	"lightsteelblue": [176, 196, 222],
+	"lightyellow": [255, 255, 224],
+	"lime": [0, 255, 0],
+	"limegreen": [50, 205, 50],
+	"linen": [250, 240, 230],
+	"magenta": [255, 0, 255],
+	"maroon": [128, 0, 0],
+	"mediumaquamarine": [102, 205, 170],
+	"mediumblue": [0, 0, 205],
+	"mediumorchid": [186, 85, 211],
+	"mediumpurple": [147, 112, 219],
+	"mediumseagreen": [60, 179, 113],
+	"mediumslateblue": [123, 104, 238],
+	"mediumspringgreen": [0, 250, 154],
+	"mediumturquoise": [72, 209, 204],
+	"mediumvioletred": [199, 21, 133],
+	"midnightblue": [25, 25, 112],
+	"mintcream": [245, 255, 250],
+	"mistyrose": [255, 228, 225],
+	"moccasin": [255, 228, 181],
+	"navajowhite": [255, 222, 173],
+	"navy": [0, 0, 128],
+	"oldlace": [253, 245, 230],
+	"olive": [128, 128, 0],
+	"olivedrab": [107, 142, 35],
+	"orange": [255, 165, 0],
+	"orangered": [255, 69, 0],
+	"orchid": [218, 112, 214],
+	"palegoldenrod": [238, 232, 170],
+	"palegreen": [152, 251, 152],
+	"paleturquoise": [175, 238, 238],
+	"palevioletred": [219, 112, 147],
+	"papayawhip": [255, 239, 213],
+	"peachpuff": [255, 218, 185],
+	"peru": [205, 133, 63],
+	"pink": [255, 192, 203],
+	"plum": [221, 160, 221],
+	"powderblue": [176, 224, 230],
+	"purple": [128, 0, 128],
+	"rebeccapurple": [102, 51, 153],
+	"red": [255, 0, 0],
+	"rosybrown": [188, 143, 143],
+	"royalblue": [65, 105, 225],
+	"saddlebrown": [139, 69, 19],
+	"salmon": [250, 128, 114],
+	"sandybrown": [244, 164, 96],
+	"seagreen": [46, 139, 87],
+	"seashell": [255, 245, 238],
+	"sienna": [160, 82, 45],
+	"silver": [192, 192, 192],
+	"skyblue": [135, 206, 235],
+	"slateblue": [106, 90, 205],
+	"slategray": [112, 128, 144],
+	"slategrey": [112, 128, 144],
+	"snow": [255, 250, 250],
+	"springgreen": [0, 255, 127],
+	"steelblue": [70, 130, 180],
+	"tan": [210, 180, 140],
+	"teal": [0, 128, 128],
+	"thistle": [216, 191, 216],
+	"tomato": [255, 99, 71],
+	"turquoise": [64, 224, 208],
+	"violet": [238, 130, 238],
+	"wheat": [245, 222, 179],
+	"white": [255, 255, 255],
+	"whitesmoke": [245, 245, 245],
+	"yellow": [255, 255, 0],
+	"yellowgreen": [154, 205, 50]
+};
diff --git a/deps/npm/node_modules/color-name/package.json b/deps/npm/node_modules/color-name/package.json
index 7acc90285c96fb..782dd82878030a 100644
--- a/deps/npm/node_modules/color-name/package.json
+++ b/deps/npm/node_modules/color-name/package.json
@@ -1,28 +1,28 @@
-{
-  "name": "color-name",
-  "version": "1.1.4",
-  "description": "A list of color names and its values",
-  "main": "index.js",
-  "files": [
-    "index.js"
-  ],
-  "scripts": {
-    "test": "node test.js"
-  },
-  "repository": {
-    "type": "git",
-    "url": "git@github.com:colorjs/color-name.git"
-  },
-  "keywords": [
-    "color-name",
-    "color",
-    "color-keyword",
-    "keyword"
-  ],
-  "author": "DY ",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/colorjs/color-name/issues"
-  },
-  "homepage": "https://github.com/colorjs/color-name"
-}
+{
+  "name": "color-name",
+  "version": "1.1.4",
+  "description": "A list of color names and its values",
+  "main": "index.js",
+  "files": [
+    "index.js"
+  ],
+  "scripts": {
+    "test": "node test.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:colorjs/color-name.git"
+  },
+  "keywords": [
+    "color-name",
+    "color",
+    "color-keyword",
+    "keyword"
+  ],
+  "author": "DY ",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/colorjs/color-name/issues"
+  },
+  "homepage": "https://github.com/colorjs/color-name"
+}
diff --git a/deps/npm/node_modules/debug/README.md b/deps/npm/node_modules/debug/README.md
index e3d52bd3c2aa41..88dae35d9fc958 100644
--- a/deps/npm/node_modules/debug/README.md
+++ b/deps/npm/node_modules/debug/README.md
@@ -269,7 +269,7 @@ log('still goes to stdout, but via console.info now');
 ```
 
 ## Extend
-You can simply extend debugger
+You can simply extend debugger 
 ```js
 const log = require('debug')('auth');
 
@@ -299,18 +299,18 @@ console.log(3, debug.enabled('test'));
 
 ```
 
-print :
+print :   
 ```
 1 false
 2 true
 3 false
 ```
 
-Usage :
-`enable(namespaces)`
+Usage :  
+`enable(namespaces)`  
 `namespaces` can include modes separated by a colon and wildcards.
-
-Note that calling `enable()` completely overrides previously set DEBUG variable :
+   
+Note that calling `enable()` completely overrides previously set DEBUG variable : 
 
 ```
 $ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
diff --git a/deps/npm/node_modules/http-cache-semantics/index.js b/deps/npm/node_modules/http-cache-semantics/index.js
index 8b7da2412bef46..4f6c2f30498b45 100644
--- a/deps/npm/node_modules/http-cache-semantics/index.js
+++ b/deps/npm/node_modules/http-cache-semantics/index.js
@@ -35,7 +35,7 @@ const understoodStatuses = new Set([
 const errorStatusCodes = new Set([
     500,
     502,
-    503,
+    503, 
     504,
 ]);
 
diff --git a/deps/npm/node_modules/iconv-lite/Changelog.md b/deps/npm/node_modules/iconv-lite/Changelog.md
index 7935778c87b8a7..c299cc06a25d3e 100644
--- a/deps/npm/node_modules/iconv-lite/Changelog.md
+++ b/deps/npm/node_modules/iconv-lite/Changelog.md
@@ -10,13 +10,13 @@
 
 ## 0.6.0 / 2020-06-08
   * Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22).
-  * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work
+  * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work 
     in recent Node versions.
-  * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be
-    excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using
+  * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be 
+    excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using 
     `iconv.enableStreamingAPI(require('stream'))`.
   * Updates to development environment & tests:
-    * Added ./test/webpack private package to test complex new use cases that need custom environment.
+    * Added ./test/webpack private package to test complex new use cases that need custom environment. 
       It's tested as a separate job in Travis CI.
     * Updated generation code for the new EUC-KR index file format from Encoding Standard.
     * Removed Buffer() constructor in tests (#197 by @gabrielschulhof).
@@ -32,7 +32,7 @@
 ## 0.5.1 / 2020-01-18
 
   * Added cp720 encoding (#221, by @kr-deps)
-  * (minor) Changed Changelog.md formatting to use h2.
+  * (minor) Changed Changelog.md formatting to use h2. 
 
 
 ## 0.5.0 / 2019-06-26
diff --git a/deps/npm/node_modules/iconv-lite/README.md b/deps/npm/node_modules/iconv-lite/README.md
index aa01122380635a..3c97f873079467 100644
--- a/deps/npm/node_modules/iconv-lite/README.md
+++ b/deps/npm/node_modules/iconv-lite/README.md
@@ -10,7 +10,7 @@
  * React Native is supported (need to install `stream` module to enable Streaming API).
  * License: MIT.
 
-[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/)
+[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/)  
 [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite)
 [![npm](https://img.shields.io/npm/v/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/)
 [![npm downloads](https://img.shields.io/npm/dm/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/)
@@ -103,7 +103,7 @@ smart about endianness in the following ways:
 
 ## UTF-32 Encodings
 
-This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness.
+This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. 
  * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`.
  * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.)
 
diff --git a/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js b/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js
index 825a4b83d071e6..fa839170367b27 100644
--- a/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js
+++ b/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js
@@ -510,9 +510,9 @@ DBCSDecoder.prototype.write = function(buf) {
             if (i >= 3) {
                 var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30);
             } else {
-                var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 +
-                          (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 +
-                          (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 +
+                var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + 
+                          (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + 
+                          (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + 
                           (curByte-0x30);
             }
             var idx = findIdx(this.gb18030.gbChars, ptr);
@@ -535,7 +535,7 @@ DBCSDecoder.prototype.write = function(buf) {
             throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
 
         // Write the character to buffer, handling higher planes using surrogate pair.
-        if (uCode >= 0x10000) {
+        if (uCode >= 0x10000) { 
             uCode -= 0x10000;
             var uCodeLead = 0xD800 | (uCode >> 10);
             newBuf[j++] = uCodeLead & 0xFF;
diff --git a/deps/npm/node_modules/iconv-lite/encodings/utf32.js b/deps/npm/node_modules/iconv-lite/encodings/utf32.js
index d3ed794b5f72d3..2fa900a12eb356 100644
--- a/deps/npm/node_modules/iconv-lite/encodings/utf32.js
+++ b/deps/npm/node_modules/iconv-lite/encodings/utf32.js
@@ -118,7 +118,7 @@ Utf32Decoder.prototype.write = function(src) {
     if (overflow.length > 0) {
         for (; i < src.length && overflow.length < 4; i++)
             overflow.push(src[i]);
-
+        
         if (overflow.length === 4) {
             // NOTE: codepoint is a signed int32 and can be negative.
             // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer).
@@ -157,7 +157,7 @@ function _writeCodepoint(dst, offset, codepoint, badChar) {
     if (codepoint < 0 || codepoint > 0x10FFFF) {
         // Not a valid Unicode codepoint
         codepoint = badChar;
-    }
+    } 
 
     // Ephemeral Planes: Write high surrogate.
     if (codepoint >= 0x10000) {
@@ -229,7 +229,7 @@ function Utf32AutoDecoder(options, codec) {
 }
 
 Utf32AutoDecoder.prototype.write = function(buf) {
-    if (!this.decoder) {
+    if (!this.decoder) { 
         // Codec is not chosen yet. Accumulate initial bytes.
         this.initialBufs.push(buf);
         this.initialBufsLen += buf.length;
diff --git a/deps/npm/node_modules/iconv-lite/lib/streams.js b/deps/npm/node_modules/iconv-lite/lib/streams.js
index 661767ad6cbc98..a1506482f58016 100644
--- a/deps/npm/node_modules/iconv-lite/lib/streams.js
+++ b/deps/npm/node_modules/iconv-lite/lib/streams.js
@@ -2,7 +2,7 @@
 
 var Buffer = require("safer-buffer").Buffer;
 
-// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
+// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), 
 // we opt to dependency-inject it instead of creating a hard dependency.
 module.exports = function(stream_module) {
     var Transform = stream_module.Transform;
@@ -84,7 +84,7 @@ module.exports = function(stream_module) {
     IconvLiteDecoderStream.prototype._flush = function(done) {
         try {
             var res = this.conv.end();
-            if (res && res.length) this.push(res, this.encoding);
+            if (res && res.length) this.push(res, this.encoding);                
             done();
         }
         catch (e) {
diff --git a/deps/npm/node_modules/json-schema/README.md b/deps/npm/node_modules/json-schema/README.md
index 78b81d39683251..ccc591b68fc58c 100644
--- a/deps/npm/node_modules/json-schema/README.md
+++ b/deps/npm/node_modules/json-schema/README.md
@@ -1,5 +1,5 @@
-JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator).
-
-Code is licensed under the AFL or BSD license as part of the Persevere
-project which is administered under the Dojo foundation,
+JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator).
+
+Code is licensed under the AFL or BSD license as part of the Persevere 
+project which is administered under the Dojo foundation,
 and all contributions require a Dojo CLA.
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-00/hyper-schema b/deps/npm/node_modules/json-schema/draft-00/hyper-schema
index 36a85ccd244926..12fe26b621ae6d 100644
--- a/deps/npm/node_modules/json-schema/draft-00/hyper-schema
+++ b/deps/npm/node_modules/json-schema/draft-00/hyper-schema
@@ -1,68 +1,68 @@
-{
-	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
-	"id" : "http://json-schema.org/draft-00/hyper-schema#",
-
-	"properties" : {
-		"links" : {
-			"type" : "array",
-			"items" : {"$ref" : "http://json-schema.org/draft-00/links#"},
-			"optional" : true
-		},
-
-		"fragmentResolution" : {
-			"type" : "string",
-			"optional" : true,
-			"default" : "dot-delimited"
-		},
-
-		"root" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"readonly" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"pathStart" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "uri"
-		},
-
-		"mediaType" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "media-type"
-		},
-
-		"alternate" : {
-			"type" : "array",
-			"items" : {"$ref" : "#"},
-			"optional" : true
-		}
-	},
-
-	"links" : [
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		},
-
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		}
-	],
-
-	"fragmentResolution" : "dot-delimited",
-	"extends" : {"$ref" : "http://json-schema.org/draft-00/schema#"}
+{
+	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
+	"id" : "http://json-schema.org/draft-00/hyper-schema#",
+
+	"properties" : {
+		"links" : {
+			"type" : "array",
+			"items" : {"$ref" : "http://json-schema.org/draft-00/links#"},
+			"optional" : true
+		},
+		
+		"fragmentResolution" : {
+			"type" : "string",
+			"optional" : true,
+			"default" : "dot-delimited"
+		},
+		
+		"root" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"readonly" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"pathStart" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "uri"
+		},
+		
+		"mediaType" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "media-type"
+		},
+		
+		"alternate" : {
+			"type" : "array",
+			"items" : {"$ref" : "#"},
+			"optional" : true
+		}
+	},
+	
+	"links" : [
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		},
+		
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		}
+	],
+	
+	"fragmentResolution" : "dot-delimited",
+	"extends" : {"$ref" : "http://json-schema.org/draft-00/schema#"}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-00/json-ref b/deps/npm/node_modules/json-schema/draft-00/json-ref
index 5d1f76b6a694a4..0c825bce4f175a 100644
--- a/deps/npm/node_modules/json-schema/draft-00/json-ref
+++ b/deps/npm/node_modules/json-schema/draft-00/json-ref
@@ -1,26 +1,26 @@
-{
-	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
-	"id" : "http://json-schema.org/draft-00/json-ref#",
-
-	"items" : {"$ref" : "#"},
-	"additionalProperties" : {"$ref" : "#"},
-
-	"links" : [
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		},
-
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		}
-	],
-
-	"fragmentResolution" : "dot-delimited"
+{
+	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
+	"id" : "http://json-schema.org/draft-00/json-ref#",
+	
+	"items" : {"$ref" : "#"},
+	"additionalProperties" : {"$ref" : "#"},
+	
+	"links" : [
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		},
+		
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		}
+	],
+	
+	"fragmentResolution" : "dot-delimited"
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-00/links b/deps/npm/node_modules/json-schema/draft-00/links
index cbef326dd3de5b..c9b5517725f461 100644
--- a/deps/npm/node_modules/json-schema/draft-00/links
+++ b/deps/npm/node_modules/json-schema/draft-00/links
@@ -1,33 +1,33 @@
-{
-	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
-	"id" : "http://json-schema.org/draft-00/links#",
-	"type" : "object",
-
-	"properties" : {
-		"href" : {
-			"type" : "string"
-		},
-
-		"rel" : {
-			"type" : "string"
-		},
-
-		"method" : {
-			"type" : "string",
-			"default" : "GET",
-			"optional" : true
-		},
-
-		"enctype" : {
-			"type" : "string",
-			"requires" : "method",
-			"optional" : true
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-00/hyper-schema#"},
-			"optional" : true
-		}
-	}
+{
+	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
+	"id" : "http://json-schema.org/draft-00/links#",
+	"type" : "object",
+	
+	"properties" : {
+		"href" : {
+			"type" : "string"
+		},
+		
+		"rel" : {
+			"type" : "string"
+		},
+		
+		"method" : {
+			"type" : "string",
+			"default" : "GET",
+			"optional" : true
+		},
+		
+		"enctype" : {
+			"type" : "string",
+			"requires" : "method",
+			"optional" : true
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-00/hyper-schema#"},
+			"optional" : true
+		}
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-00/schema b/deps/npm/node_modules/json-schema/draft-00/schema
index d452b023ee484a..a3a214436e4570 100644
--- a/deps/npm/node_modules/json-schema/draft-00/schema
+++ b/deps/npm/node_modules/json-schema/draft-00/schema
@@ -1,155 +1,155 @@
-{
-	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
-	"id" : "http://json-schema.org/draft-00/schema#",
-	"type" : "object",
-
-	"properties" : {
-		"type" : {
-			"type" : ["string", "array"],
-			"items" : {
-				"type" : ["string", {"$ref" : "#"}]
-			},
-			"optional" : true,
-			"default" : "any"
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		},
-
-		"items" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		},
-
-		"optional" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"additionalProperties" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"optional" : true,
-			"default" : {}
-		},
-
-		"requires" : {
-			"type" : ["string", {"$ref" : "#"}],
-			"optional" : true
-		},
-
-		"minimum" : {
-			"type" : "number",
-			"optional" : true
-		},
-
-		"maximum" : {
-			"type" : "number",
-			"optional" : true
-		},
-
-		"minimumCanEqual" : {
-			"type" : "boolean",
-			"optional" : true,
-			"requires" : "minimum",
-			"default" : true
-		},
-
-		"maximumCanEqual" : {
-			"type" : "boolean",
-			"optional" : true,
-			"requires" : "maximum",
-			"default" : true
-		},
-
-		"minItems" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxItems" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0
-		},
-
-		"pattern" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "regex"
-		},
-
-		"minLength" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxLength" : {
-			"type" : "integer",
-			"optional" : true
-		},
-
-		"enum" : {
-			"type" : "array",
-			"optional" : true,
-			"minItems" : 1
-		},
-
-		"title" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"description" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"format" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"contentEncoding" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"default" : {
-			"type" : "any",
-			"optional" : true
-		},
-
-		"maxDecimal" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0
-		},
-
-		"disallow" : {
-			"type" : ["string", "array"],
-			"items" : {"type" : "string"},
-			"optional" : true
-		},
-
-		"extends" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		}
-	},
-
-	"optional" : true,
-	"default" : {}
+{
+	"$schema" : "http://json-schema.org/draft-00/hyper-schema#",
+	"id" : "http://json-schema.org/draft-00/schema#",
+	"type" : "object",
+	
+	"properties" : {
+		"type" : {
+			"type" : ["string", "array"],
+			"items" : {
+				"type" : ["string", {"$ref" : "#"}]
+			},
+			"optional" : true,
+			"default" : "any"
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"items" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"optional" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"additionalProperties" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"requires" : {
+			"type" : ["string", {"$ref" : "#"}],
+			"optional" : true
+		},
+		
+		"minimum" : {
+			"type" : "number",
+			"optional" : true
+		},
+		
+		"maximum" : {
+			"type" : "number",
+			"optional" : true
+		},
+		
+		"minimumCanEqual" : {
+			"type" : "boolean",
+			"optional" : true,
+			"requires" : "minimum",
+			"default" : true
+		},
+		
+		"maximumCanEqual" : {
+			"type" : "boolean",
+			"optional" : true,
+			"requires" : "maximum",
+			"default" : true
+		},
+		
+		"minItems" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxItems" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0
+		},
+		
+		"pattern" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "regex"
+		},
+		
+		"minLength" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxLength" : {
+			"type" : "integer",
+			"optional" : true
+		},
+		
+		"enum" : {
+			"type" : "array",
+			"optional" : true,
+			"minItems" : 1
+		},
+		
+		"title" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"description" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"format" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"contentEncoding" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"default" : {
+			"type" : "any",
+			"optional" : true
+		},
+		
+		"maxDecimal" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0
+		},
+		
+		"disallow" : {
+			"type" : ["string", "array"],
+			"items" : {"type" : "string"},
+			"optional" : true
+		},
+		
+		"extends" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		}
+	},
+	
+	"optional" : true,
+	"default" : {}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-01/hyper-schema b/deps/npm/node_modules/json-schema/draft-01/hyper-schema
index b0fb5e157ef9bd..66e835b655004d 100644
--- a/deps/npm/node_modules/json-schema/draft-01/hyper-schema
+++ b/deps/npm/node_modules/json-schema/draft-01/hyper-schema
@@ -1,68 +1,68 @@
-{
-	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
-	"id" : "http://json-schema.org/draft-01/hyper-schema#",
-
-	"properties" : {
-		"links" : {
-			"type" : "array",
-			"items" : {"$ref" : "http://json-schema.org/draft-01/links#"},
-			"optional" : true
-		},
-
-		"fragmentResolution" : {
-			"type" : "string",
-			"optional" : true,
-			"default" : "dot-delimited"
-		},
-
-		"root" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"readonly" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"pathStart" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "uri"
-		},
-
-		"mediaType" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "media-type"
-		},
-
-		"alternate" : {
-			"type" : "array",
-			"items" : {"$ref" : "#"},
-			"optional" : true
-		}
-	},
-
-	"links" : [
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		},
-
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		}
-	],
-
-	"fragmentResolution" : "dot-delimited",
-	"extends" : {"$ref" : "http://json-schema.org/draft-01/schema#"}
+{
+	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
+	"id" : "http://json-schema.org/draft-01/hyper-schema#",
+
+	"properties" : {
+		"links" : {
+			"type" : "array",
+			"items" : {"$ref" : "http://json-schema.org/draft-01/links#"},
+			"optional" : true
+		},
+		
+		"fragmentResolution" : {
+			"type" : "string",
+			"optional" : true,
+			"default" : "dot-delimited"
+		},
+		
+		"root" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"readonly" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"pathStart" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "uri"
+		},
+		
+		"mediaType" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "media-type"
+		},
+		
+		"alternate" : {
+			"type" : "array",
+			"items" : {"$ref" : "#"},
+			"optional" : true
+		}
+	},
+	
+	"links" : [
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		},
+		
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		}
+	],
+	
+	"fragmentResolution" : "dot-delimited",
+	"extends" : {"$ref" : "http://json-schema.org/draft-01/schema#"}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-01/json-ref b/deps/npm/node_modules/json-schema/draft-01/json-ref
index cbac1ba2e53286..f2ad55b1e7de6f 100644
--- a/deps/npm/node_modules/json-schema/draft-01/json-ref
+++ b/deps/npm/node_modules/json-schema/draft-01/json-ref
@@ -1,26 +1,26 @@
-{
-	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
-	"id" : "http://json-schema.org/draft-01/json-ref#",
-
-	"items" : {"$ref" : "#"},
-	"additionalProperties" : {"$ref" : "#"},
-
-	"links" : [
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		},
-
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		}
-	],
-
-	"fragmentResolution" : "dot-delimited"
+{
+	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
+	"id" : "http://json-schema.org/draft-01/json-ref#",
+	
+	"items" : {"$ref" : "#"},
+	"additionalProperties" : {"$ref" : "#"},
+	
+	"links" : [
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		},
+		
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		}
+	],
+	
+	"fragmentResolution" : "dot-delimited"
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-01/links b/deps/npm/node_modules/json-schema/draft-01/links
index ebc7b7b58b1326..cb183c4d86319a 100644
--- a/deps/npm/node_modules/json-schema/draft-01/links
+++ b/deps/npm/node_modules/json-schema/draft-01/links
@@ -1,33 +1,33 @@
-{
-	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
-	"id" : "http://json-schema.org/draft-01/links#",
-	"type" : "object",
-
-	"properties" : {
-		"href" : {
-			"type" : "string"
-		},
-
-		"rel" : {
-			"type" : "string"
-		},
-
-		"method" : {
-			"type" : "string",
-			"default" : "GET",
-			"optional" : true
-		},
-
-		"enctype" : {
-			"type" : "string",
-			"requires" : "method",
-			"optional" : true
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-01/hyper-schema#"},
-			"optional" : true
-		}
-	}
+{
+	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
+	"id" : "http://json-schema.org/draft-01/links#",
+	"type" : "object",
+	
+	"properties" : {
+		"href" : {
+			"type" : "string"
+		},
+		
+		"rel" : {
+			"type" : "string"
+		},
+		
+		"method" : {
+			"type" : "string",
+			"default" : "GET",
+			"optional" : true
+		},
+		
+		"enctype" : {
+			"type" : "string",
+			"requires" : "method",
+			"optional" : true
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-01/hyper-schema#"},
+			"optional" : true
+		}
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-01/schema b/deps/npm/node_modules/json-schema/draft-01/schema
index a0f3801f840cca..e6b6aea4ea5d47 100644
--- a/deps/npm/node_modules/json-schema/draft-01/schema
+++ b/deps/npm/node_modules/json-schema/draft-01/schema
@@ -1,155 +1,155 @@
-{
-	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
-	"id" : "http://json-schema.org/draft-01/schema#",
-	"type" : "object",
-
-	"properties" : {
-		"type" : {
-			"type" : ["string", "array"],
-			"items" : {
-				"type" : ["string", {"$ref" : "#"}]
-			},
-			"optional" : true,
-			"default" : "any"
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		},
-
-		"items" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		},
-
-		"optional" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"additionalProperties" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"optional" : true,
-			"default" : {}
-		},
-
-		"requires" : {
-			"type" : ["string", {"$ref" : "#"}],
-			"optional" : true
-		},
-
-		"minimum" : {
-			"type" : "number",
-			"optional" : true
-		},
-
-		"maximum" : {
-			"type" : "number",
-			"optional" : true
-		},
-
-		"minimumCanEqual" : {
-			"type" : "boolean",
-			"optional" : true,
-			"requires" : "minimum",
-			"default" : true
-		},
-
-		"maximumCanEqual" : {
-			"type" : "boolean",
-			"optional" : true,
-			"requires" : "maximum",
-			"default" : true
-		},
-
-		"minItems" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxItems" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0
-		},
-
-		"pattern" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "regex"
-		},
-
-		"minLength" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxLength" : {
-			"type" : "integer",
-			"optional" : true
-		},
-
-		"enum" : {
-			"type" : "array",
-			"optional" : true,
-			"minItems" : 1
-		},
-
-		"title" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"description" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"format" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"contentEncoding" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"default" : {
-			"type" : "any",
-			"optional" : true
-		},
-
-		"maxDecimal" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0
-		},
-
-		"disallow" : {
-			"type" : ["string", "array"],
-			"items" : {"type" : "string"},
-			"optional" : true
-		},
-
-		"extends" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		}
-	},
-
-	"optional" : true,
-	"default" : {}
+{
+	"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
+	"id" : "http://json-schema.org/draft-01/schema#",
+	"type" : "object",
+	
+	"properties" : {
+		"type" : {
+			"type" : ["string", "array"],
+			"items" : {
+				"type" : ["string", {"$ref" : "#"}]
+			},
+			"optional" : true,
+			"default" : "any"
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"items" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"optional" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"additionalProperties" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"requires" : {
+			"type" : ["string", {"$ref" : "#"}],
+			"optional" : true
+		},
+		
+		"minimum" : {
+			"type" : "number",
+			"optional" : true
+		},
+		
+		"maximum" : {
+			"type" : "number",
+			"optional" : true
+		},
+		
+		"minimumCanEqual" : {
+			"type" : "boolean",
+			"optional" : true,
+			"requires" : "minimum",
+			"default" : true
+		},
+		
+		"maximumCanEqual" : {
+			"type" : "boolean",
+			"optional" : true,
+			"requires" : "maximum",
+			"default" : true
+		},
+		
+		"minItems" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxItems" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0
+		},
+		
+		"pattern" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "regex"
+		},
+		
+		"minLength" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxLength" : {
+			"type" : "integer",
+			"optional" : true
+		},
+		
+		"enum" : {
+			"type" : "array",
+			"optional" : true,
+			"minItems" : 1
+		},
+		
+		"title" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"description" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"format" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"contentEncoding" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"default" : {
+			"type" : "any",
+			"optional" : true
+		},
+		
+		"maxDecimal" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0
+		},
+		
+		"disallow" : {
+			"type" : ["string", "array"],
+			"items" : {"type" : "string"},
+			"optional" : true
+		},
+		
+		"extends" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		}
+	},
+	
+	"optional" : true,
+	"default" : {}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-02/hyper-schema b/deps/npm/node_modules/json-schema/draft-02/hyper-schema
index 0771e2b31e8eef..2d2bc6853e86d3 100644
--- a/deps/npm/node_modules/json-schema/draft-02/hyper-schema
+++ b/deps/npm/node_modules/json-schema/draft-02/hyper-schema
@@ -1,68 +1,68 @@
-{
-	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
-	"id" : "http://json-schema.org/draft-02/hyper-schema#",
-
-	"properties" : {
-		"links" : {
-			"type" : "array",
-			"items" : {"$ref" : "http://json-schema.org/draft-02/links#"},
-			"optional" : true
-		},
-
-		"fragmentResolution" : {
-			"type" : "string",
-			"optional" : true,
-			"default" : "slash-delimited"
-		},
-
-		"root" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"readonly" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"pathStart" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "uri"
-		},
-
-		"mediaType" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "media-type"
-		},
-
-		"alternate" : {
-			"type" : "array",
-			"items" : {"$ref" : "#"},
-			"optional" : true
-		}
-	},
-
-	"links" : [
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		},
-
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		}
-	],
-
-	"fragmentResolution" : "slash-delimited",
-	"extends" : {"$ref" : "http://json-schema.org/draft-02/schema#"}
+{
+	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
+	"id" : "http://json-schema.org/draft-02/hyper-schema#",
+
+	"properties" : {
+		"links" : {
+			"type" : "array",
+			"items" : {"$ref" : "http://json-schema.org/draft-02/links#"},
+			"optional" : true
+		},
+		
+		"fragmentResolution" : {
+			"type" : "string",
+			"optional" : true,
+			"default" : "slash-delimited"
+		},
+		
+		"root" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"readonly" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"pathStart" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "uri"
+		},
+		
+		"mediaType" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "media-type"
+		},
+		
+		"alternate" : {
+			"type" : "array",
+			"items" : {"$ref" : "#"},
+			"optional" : true
+		}
+	},
+	
+	"links" : [
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		},
+		
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		}
+	],
+	
+	"fragmentResolution" : "slash-delimited",
+	"extends" : {"$ref" : "http://json-schema.org/draft-02/schema#"}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-02/json-ref b/deps/npm/node_modules/json-schema/draft-02/json-ref
index 1a6c56d04b665a..2b23fcdc66ca48 100644
--- a/deps/npm/node_modules/json-schema/draft-02/json-ref
+++ b/deps/npm/node_modules/json-schema/draft-02/json-ref
@@ -1,26 +1,26 @@
-{
-	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
-	"id" : "http://json-schema.org/draft-02/json-ref#",
-
-	"items" : {"$ref" : "#"},
-	"additionalProperties" : {"$ref" : "#"},
-
-	"links" : [
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		},
-
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		}
-	],
-
-	"fragmentResolution" : "dot-delimited"
+{
+	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
+	"id" : "http://json-schema.org/draft-02/json-ref#",
+	
+	"items" : {"$ref" : "#"},
+	"additionalProperties" : {"$ref" : "#"},
+	
+	"links" : [
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		},
+		
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		}
+	],
+	
+	"fragmentResolution" : "dot-delimited"
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-02/links b/deps/npm/node_modules/json-schema/draft-02/links
index dacc53a1a4adb6..ab971b7c2dc311 100644
--- a/deps/npm/node_modules/json-schema/draft-02/links
+++ b/deps/npm/node_modules/json-schema/draft-02/links
@@ -1,35 +1,35 @@
-{
-	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
-	"id" : "http://json-schema.org/draft-02/links#",
-	"type" : "object",
-
-	"properties" : {
-		"href" : {
-			"type" : "string"
-		},
-
-		"rel" : {
-			"type" : "string"
-		},
-
-		"targetSchema" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"},
-
-		"method" : {
-			"type" : "string",
-			"default" : "GET",
-			"optional" : true
-		},
-
-		"enctype" : {
-			"type" : "string",
-			"requires" : "method",
-			"optional" : true
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"},
-			"optional" : true
-		}
-	}
+{
+	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
+	"id" : "http://json-schema.org/draft-02/links#",
+	"type" : "object",
+	
+	"properties" : {
+		"href" : {
+			"type" : "string"
+		},
+		
+		"rel" : {
+			"type" : "string"
+		},
+		
+		"targetSchema" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"},
+		
+		"method" : {
+			"type" : "string",
+			"default" : "GET",
+			"optional" : true
+		},
+		
+		"enctype" : {
+			"type" : "string",
+			"requires" : "method",
+			"optional" : true
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"},
+			"optional" : true
+		}
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-02/schema b/deps/npm/node_modules/json-schema/draft-02/schema
index a4998abea2065e..cc2b6693b9772a 100644
--- a/deps/npm/node_modules/json-schema/draft-02/schema
+++ b/deps/npm/node_modules/json-schema/draft-02/schema
@@ -1,166 +1,166 @@
-{
-	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
-	"id" : "http://json-schema.org/draft-02/schema#",
-	"type" : "object",
-
-	"properties" : {
-		"type" : {
-			"type" : ["string", "array"],
-			"items" : {
-				"type" : ["string", {"$ref" : "#"}]
-			},
-			"optional" : true,
-			"uniqueItems" : true,
-			"default" : "any"
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		},
-
-		"items" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		},
-
-		"optional" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"additionalProperties" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"optional" : true,
-			"default" : {}
-		},
-
-		"requires" : {
-			"type" : ["string", {"$ref" : "#"}],
-			"optional" : true
-		},
-
-		"minimum" : {
-			"type" : "number",
-			"optional" : true
-		},
-
-		"maximum" : {
-			"type" : "number",
-			"optional" : true
-		},
-
-		"minimumCanEqual" : {
-			"type" : "boolean",
-			"optional" : true,
-			"requires" : "minimum",
-			"default" : true
-		},
-
-		"maximumCanEqual" : {
-			"type" : "boolean",
-			"optional" : true,
-			"requires" : "maximum",
-			"default" : true
-		},
-
-		"minItems" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxItems" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0
-		},
-
-		"uniqueItems" : {
-			"type" : "boolean",
-			"optional" : true,
-			"default" : false
-		},
-
-		"pattern" : {
-			"type" : "string",
-			"optional" : true,
-			"format" : "regex"
-		},
-
-		"minLength" : {
-			"type" : "integer",
-			"optional" : true,
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxLength" : {
-			"type" : "integer",
-			"optional" : true
-		},
-
-		"enum" : {
-			"type" : "array",
-			"optional" : true,
-			"minItems" : 1,
-			"uniqueItems" : true
-		},
-
-		"title" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"description" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"format" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"contentEncoding" : {
-			"type" : "string",
-			"optional" : true
-		},
-
-		"default" : {
-			"type" : "any",
-			"optional" : true
-		},
-
-		"divisibleBy" : {
-			"type" : "number",
-			"minimum" : 0,
-			"minimumCanEqual" : false,
-			"optional" : true,
-			"default" : 1
-		},
-
-		"disallow" : {
-			"type" : ["string", "array"],
-			"items" : {"type" : "string"},
-			"optional" : true,
-			"uniqueItems" : true
-		},
-
-		"extends" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"optional" : true,
-			"default" : {}
-		}
-	},
-
-	"optional" : true,
-	"default" : {}
+{
+	"$schema" : "http://json-schema.org/draft-02/hyper-schema#",
+	"id" : "http://json-schema.org/draft-02/schema#",
+	"type" : "object",
+	
+	"properties" : {
+		"type" : {
+			"type" : ["string", "array"],
+			"items" : {
+				"type" : ["string", {"$ref" : "#"}]
+			},
+			"optional" : true,
+			"uniqueItems" : true,
+			"default" : "any"
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"items" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"optional" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"additionalProperties" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"optional" : true,
+			"default" : {}
+		},
+		
+		"requires" : {
+			"type" : ["string", {"$ref" : "#"}],
+			"optional" : true
+		},
+		
+		"minimum" : {
+			"type" : "number",
+			"optional" : true
+		},
+		
+		"maximum" : {
+			"type" : "number",
+			"optional" : true
+		},
+		
+		"minimumCanEqual" : {
+			"type" : "boolean",
+			"optional" : true,
+			"requires" : "minimum",
+			"default" : true
+		},
+		
+		"maximumCanEqual" : {
+			"type" : "boolean",
+			"optional" : true,
+			"requires" : "maximum",
+			"default" : true
+		},
+		
+		"minItems" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxItems" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0
+		},
+		
+		"uniqueItems" : {
+			"type" : "boolean",
+			"optional" : true,
+			"default" : false
+		},
+		
+		"pattern" : {
+			"type" : "string",
+			"optional" : true,
+			"format" : "regex"
+		},
+		
+		"minLength" : {
+			"type" : "integer",
+			"optional" : true,
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxLength" : {
+			"type" : "integer",
+			"optional" : true
+		},
+		
+		"enum" : {
+			"type" : "array",
+			"optional" : true,
+			"minItems" : 1,
+			"uniqueItems" : true
+		},
+		
+		"title" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"description" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"format" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"contentEncoding" : {
+			"type" : "string",
+			"optional" : true
+		},
+		
+		"default" : {
+			"type" : "any",
+			"optional" : true
+		},
+		
+		"divisibleBy" : {
+			"type" : "number",
+			"minimum" : 0,
+			"minimumCanEqual" : false,
+			"optional" : true,
+			"default" : 1
+		},
+		
+		"disallow" : {
+			"type" : ["string", "array"],
+			"items" : {"type" : "string"},
+			"optional" : true,
+			"uniqueItems" : true
+		},
+		
+		"extends" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"optional" : true,
+			"default" : {}
+		}
+	},
+	
+	"optional" : true,
+	"default" : {}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-03/examples/address b/deps/npm/node_modules/json-schema/draft-03/examples/address
index 074d34e82b2647..401f20f1c4bfef 100644
--- a/deps/npm/node_modules/json-schema/draft-03/examples/address
+++ b/deps/npm/node_modules/json-schema/draft-03/examples/address
@@ -1,20 +1,20 @@
-{
-	"description" : "An Address following the convention of http://microformats.org/wiki/hcard",
-	"type" : "object",
-	"properties" : {
-		"post-office-box" : { "type" : "string" },
-		"extended-address" : { "type" : "string" },
-		"street-address" : { "type":"string" },
-		"locality" : { "type" : "string", "required" : true },
-		"region" : { "type" : "string", "required" : true },
-		"postal-code" : { "type" : "string" },
-		"country-name" : { "type" : "string", "required" : true }
-	},
-	"dependencies" : {
-		"post-office-box" : "street-address",
-		"extended-address" : "street-address",
-		"street-address" : "region",
-		"locality" : "region",
-		"region" : "country-name"
-	}
+{
+	"description" : "An Address following the convention of http://microformats.org/wiki/hcard",
+	"type" : "object",
+	"properties" : {
+		"post-office-box" : { "type" : "string" },
+		"extended-address" : { "type" : "string" },
+		"street-address" : { "type":"string" },
+		"locality" : { "type" : "string", "required" : true },
+		"region" : { "type" : "string", "required" : true },
+		"postal-code" : { "type" : "string" },
+		"country-name" : { "type" : "string", "required" : true }
+	},
+	"dependencies" : {
+		"post-office-box" : "street-address",
+		"extended-address" : "street-address",
+		"street-address" : "region",
+		"locality" : "region",
+		"region" : "country-name"
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-03/examples/calendar b/deps/npm/node_modules/json-schema/draft-03/examples/calendar
index d8fb5335f081b4..0ec47c23c3fa07 100644
--- a/deps/npm/node_modules/json-schema/draft-03/examples/calendar
+++ b/deps/npm/node_modules/json-schema/draft-03/examples/calendar
@@ -1,49 +1,53 @@
-{
-	"description" : "A representation of an event",
-	"type" : "object",
-	"properties" : {
-		"dtstart" : {
-			"format" : "date-time",
-			"type" : "string",
-			"description" : "Event starting time",
-			"required":true
-		},
-		"summary" : {
-			"type":"string",
-			"required":true
-		},
-		"location" : {
-			"type" : "string"
-		},
-		"url" : {
-			"type" : "string",
-			"format" : "url"
-		},
-		"dtend" : {
-			"format" : "date-time",
-			"type" : "string",
-			"description" : "Event ending time"
-		},
-		"duration" : {
-			"format" : "date",
-			"type" : "string",
-			"description" : "Event duration"
-		},
-		"rdate" : {
-			"format" : "date-time",
-			"type" : "string",
-			"description" : "Recurrence date"
-		},
-		"rrule" : {
-			"type" : "string",
-			"description" : "Recurrence rule"
-		},
-		"category" : {
-			"type" : "string"
-		},
-		"description" : {
-			"type" : "string"
-		},
-		"geo" : { "$ref" : "http://json-schema.org/draft-03/geo" }
-	}
-}
+{
+	"description" : "A representation of an event",
+	"type" : "object",
+	"properties" : {
+		"dtstart" : {
+			"format" : "date-time",
+			"type" : "string",
+			"description" : "Event starting time",
+			"required":true
+		},
+		"summary" : {
+			"type":"string",
+			"required":true
+		},
+		"location" : { 
+			"type" : "string" 
+		},
+		"url" : {
+			"type" : "string", 
+			"format" : "url" 
+		},
+		"dtend" : {
+			"format" : "date-time",
+			"type" : "string",
+			"description" : "Event ending time"
+		},
+		"duration" : {
+			"format" : "date",
+			"type" : "string",
+			"description" : "Event duration"
+		},
+		"rdate" : {
+			"format" : "date-time",
+			"type" : "string",
+			"description" : "Recurrence date"
+		},
+		"rrule" : {
+			"type" : "string",
+			"description" : "Recurrence rule"
+		},
+		"category" : {
+			"type" : "string"
+		},
+		"description" : {
+			"type" : "string"
+		},
+		"geo" : { "$ref" : "http://json-schema.org/draft-03/geo" }
+	}
+}
+		
+			
+			
+
diff --git a/deps/npm/node_modules/json-schema/draft-03/examples/card b/deps/npm/node_modules/json-schema/draft-03/examples/card
index 89287a40d3f716..a5667ffdd73535 100644
--- a/deps/npm/node_modules/json-schema/draft-03/examples/card
+++ b/deps/npm/node_modules/json-schema/draft-03/examples/card
@@ -1,105 +1,105 @@
-{
-   "description":"A representation of a person, company, organization, or place",
-   "type":"object",
-   "properties":{
-      "fn":{
-         "description":"Formatted Name",
-         "type":"string"
-      },
-      "familyName":{
-         "type":"string",
-         "required":true
-      },
-      "givenName":{
-         "type":"string",
-         "required":true
-      },
-      "additionalName":{
-         "type":"array",
-         "items":{
-            "type":"string"
-         }
-      },
-      "honorificPrefix":{
-         "type":"array",
-         "items":{
-            "type":"string"
-         }
-      },
-      "honorificSuffix":{
-         "type":"array",
-         "items":{
-            "type":"string"
-         }
-      },
-      "nickname":{
-         "type":"string"
-      },
-      "url":{
-         "type":"string",
-         "format":"url"
-      },
-      "email":{
-         "type":"object",
-         "properties":{
-            "type":{
-               "type":"string"
-            },
-            "value":{
-               "type":"string",
-               "format":"email"
-            }
-         }
-      },
-      "tel":{
-         "type":"object",
-         "properties":{
-            "type":{
-               "type":"string"
-            },
-            "value":{
-               "type":"string",
-               "format":"phone"
-            }
-         }
-      },
-      "adr":{"$ref" : "http://json-schema.org/address"},
-      "geo":{"$ref" : "http://json-schema.org/geo"},
-      "tz":{
-         "type":"string"
-      },
-      "photo":{
-         "format":"image",
-         "type":"string"
-      },
-      "logo":{
-         "format":"image",
-         "type":"string"
-      },
-      "sound":{
-         "format":"attachment",
-         "type":"string"
-      },
-      "bday":{
-         "type":"string",
-         "format":"date"
-      },
-      "title":{
-         "type":"string"
-      },
-      "role":{
-         "type":"string"
-      },
-      "org":{
-         "type":"object",
-         "properties":{
-            "organizationName":{
-               "type":"string"
-            },
-            "organizationUnit":{
-               "type":"string"
-            }
-         }
-      }
-   }
+{
+   "description":"A representation of a person, company, organization, or place",
+   "type":"object",
+   "properties":{
+      "fn":{
+         "description":"Formatted Name",
+         "type":"string"
+      },
+      "familyName":{
+         "type":"string",
+         "required":true
+      },
+      "givenName":{
+         "type":"string",
+         "required":true
+      },
+      "additionalName":{
+         "type":"array",
+         "items":{
+            "type":"string"
+         }
+      },
+      "honorificPrefix":{
+         "type":"array",
+         "items":{
+            "type":"string"
+         }
+      },
+      "honorificSuffix":{
+         "type":"array",
+         "items":{
+            "type":"string"
+         }
+      },
+      "nickname":{
+         "type":"string"
+      },
+      "url":{
+         "type":"string",
+         "format":"url"
+      },
+      "email":{
+         "type":"object",
+         "properties":{
+            "type":{
+               "type":"string"
+            },
+            "value":{
+               "type":"string",
+               "format":"email"
+            }
+         }
+      },
+      "tel":{
+         "type":"object",
+         "properties":{
+            "type":{
+               "type":"string"
+            },
+            "value":{
+               "type":"string",
+               "format":"phone"
+            }
+         }
+      },
+      "adr":{"$ref" : "http://json-schema.org/address"},
+      "geo":{"$ref" : "http://json-schema.org/geo"},
+      "tz":{
+         "type":"string"
+      },
+      "photo":{
+         "format":"image",
+         "type":"string"
+      },
+      "logo":{
+         "format":"image",
+         "type":"string"
+      },
+      "sound":{
+         "format":"attachment",
+         "type":"string"
+      },
+      "bday":{
+         "type":"string",
+         "format":"date"
+      },
+      "title":{
+         "type":"string"
+      },
+      "role":{
+         "type":"string"
+      },
+      "org":{
+         "type":"object",
+         "properties":{
+            "organizationName":{
+               "type":"string"
+            },
+            "organizationUnit":{
+               "type":"string"
+            }
+         }
+      }
+   }
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-03/examples/geo b/deps/npm/node_modules/json-schema/draft-03/examples/geo
index 73ac7e538f2972..4357a909ae06ed 100644
--- a/deps/npm/node_modules/json-schema/draft-03/examples/geo
+++ b/deps/npm/node_modules/json-schema/draft-03/examples/geo
@@ -1,8 +1,8 @@
-{
-	"description" : "A geographical coordinate",
-	"type" : "object",
-	"properties" : {
-		"latitude" : { "type" : "number" },
-		"longitude" : { "type" : "number" }
-	}
+{
+	"description" : "A geographical coordinate",
+	"type" : "object",
+	"properties" : {
+		"latitude" : { "type" : "number" },
+		"longitude" : { "type" : "number" }
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-03/examples/interfaces b/deps/npm/node_modules/json-schema/draft-03/examples/interfaces
index 84ebf83a993f6d..b8532f2974b0b1 100644
--- a/deps/npm/node_modules/json-schema/draft-03/examples/interfaces
+++ b/deps/npm/node_modules/json-schema/draft-03/examples/interfaces
@@ -1,23 +1,23 @@
-{
-    "extends":"http://json-schema.org/hyper-schema",
-    "description":"A schema for schema interface definitions that describe programmatic class structures using JSON schema syntax",
-    "properties":{
-        "methods":{
-            "type":"object",
-            "description":"This defines the set of methods available to the class instances",
-            "additionalProperties":{
-		"type":"object",
-		"description":"The definition of the method",
-		"properties":{
-			"parameters":{
-				"type":"array",
-				"description":"The set of parameters that should be passed to the method when it is called",
-				"items":{"$ref":"#"},
-				"required": true
-			},
-			"returns":{"$ref":"#"}
-		}
-            }
-        }
-    }
-}
+{
+    "extends":"http://json-schema.org/hyper-schema",
+    "description":"A schema for schema interface definitions that describe programmatic class structures using JSON schema syntax",
+    "properties":{
+        "methods":{
+            "type":"object",
+            "description":"This defines the set of methods available to the class instances",
+            "additionalProperties":{
+            	"type":"object",
+            	"description":"The definition of the method",
+            	"properties":{
+            		"parameters":{
+            			"type":"array",
+            			"description":"The set of parameters that should be passed to the method when it is called",
+            			"items":{"$ref":"#"},
+            			"required": true
+            		},
+            		"returns":{"$ref":"#"}
+            	}
+            }
+        }    
+    }
+}
diff --git a/deps/npm/node_modules/json-schema/draft-03/hyper-schema b/deps/npm/node_modules/json-schema/draft-03/hyper-schema
index 623055c3599615..38ca2e103f2139 100644
--- a/deps/npm/node_modules/json-schema/draft-03/hyper-schema
+++ b/deps/npm/node_modules/json-schema/draft-03/hyper-schema
@@ -1,60 +1,60 @@
-{
-	"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
-	"extends" : {"$ref" : "http://json-schema.org/draft-03/schema#"},
-	"id" : "http://json-schema.org/draft-03/hyper-schema#",
-
-	"properties" : {
-		"links" : {
-			"type" : "array",
-			"items" : {"$ref" : "http://json-schema.org/draft-03/links#"}
-		},
-
-		"fragmentResolution" : {
-			"type" : "string",
-			"default" : "slash-delimited"
-		},
-
-		"root" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"readonly" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"contentEncoding" : {
-			"type" : "string"
-		},
-
-		"pathStart" : {
-			"type" : "string",
-			"format" : "uri"
-		},
-
-		"mediaType" : {
-			"type" : "string",
-			"format" : "media-type"
-		}
-	},
-
-	"links" : [
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		},
-
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		}
-	],
-
-	"fragmentResolution" : "slash-delimited"
-}
+{
+	"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
+	"extends" : {"$ref" : "http://json-schema.org/draft-03/schema#"},
+	"id" : "http://json-schema.org/draft-03/hyper-schema#",
+
+	"properties" : {
+		"links" : {
+			"type" : "array",
+			"items" : {"$ref" : "http://json-schema.org/draft-03/links#"}
+		},
+
+		"fragmentResolution" : {
+			"type" : "string",
+			"default" : "slash-delimited"
+		},
+
+		"root" : {
+			"type" : "boolean",
+			"default" : false
+		},
+
+		"readonly" : {
+			"type" : "boolean",
+			"default" : false
+		},
+
+		"contentEncoding" : {
+			"type" : "string"
+		},
+
+		"pathStart" : {
+			"type" : "string",
+			"format" : "uri"
+		},
+
+		"mediaType" : {
+			"type" : "string",
+			"format" : "media-type"
+		}
+	},
+
+	"links" : [
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		},
+
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		}
+	],
+
+	"fragmentResolution" : "slash-delimited"
+}
diff --git a/deps/npm/node_modules/json-schema/draft-03/json-ref b/deps/npm/node_modules/json-schema/draft-03/json-ref
index 388476323a08ab..66e08f26078bf1 100644
--- a/deps/npm/node_modules/json-schema/draft-03/json-ref
+++ b/deps/npm/node_modules/json-schema/draft-03/json-ref
@@ -1,26 +1,26 @@
-{
-	"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
-	"id" : "http://json-schema.org/draft-03/json-ref#",
-
-	"additionalItems" : {"$ref" : "#"},
-	"additionalProperties" : {"$ref" : "#"},
-
-	"links" : [
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		},
-
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		}
-	],
-
-	"fragmentResolution" : "dot-delimited"
+{
+	"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
+	"id" : "http://json-schema.org/draft-03/json-ref#",
+	
+	"additionalItems" : {"$ref" : "#"},
+	"additionalProperties" : {"$ref" : "#"},
+	
+	"links" : [
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		},
+		
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+		
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		}
+	],
+	
+	"fragmentResolution" : "dot-delimited"
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-03/links b/deps/npm/node_modules/json-schema/draft-03/links
index 3dbcdba73cc4e8..9fa63f987948a3 100644
--- a/deps/npm/node_modules/json-schema/draft-03/links
+++ b/deps/npm/node_modules/json-schema/draft-03/links
@@ -1,35 +1,35 @@
-{
-	"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
-	"id" : "http://json-schema.org/draft-03/links#",
-	"type" : "object",
-
-	"properties" : {
-		"href" : {
-			"type" : "string",
-			"required" : true,
-			"format" : "link-description-object-template"
-		},
-
-		"rel" : {
-			"type" : "string",
-			"required" : true
-		},
-
-		"targetSchema" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"},
-
-		"method" : {
-			"type" : "string",
-			"default" : "GET"
-		},
-
-		"enctype" : {
-			"type" : "string",
-			"requires" : "method"
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"}
-		}
-	}
+{
+	"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
+	"id" : "http://json-schema.org/draft-03/links#",
+	"type" : "object",
+	
+	"properties" : {
+		"href" : {
+			"type" : "string",
+			"required" : true,
+			"format" : "link-description-object-template"
+		},
+		
+		"rel" : {
+			"type" : "string",
+			"required" : true
+		},
+		
+		"targetSchema" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"},
+		
+		"method" : {
+			"type" : "string",
+			"default" : "GET"
+		},
+		
+		"enctype" : {
+			"type" : "string",
+			"requires" : "method"
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"}
+		}
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-03/schema b/deps/npm/node_modules/json-schema/draft-03/schema
index 361456d8a7e89e..29d9469f9fb50a 100644
--- a/deps/npm/node_modules/json-schema/draft-03/schema
+++ b/deps/npm/node_modules/json-schema/draft-03/schema
@@ -1,174 +1,174 @@
-{
-	"$schema" : "http://json-schema.org/draft-03/schema#",
-	"id" : "http://json-schema.org/draft-03/schema#",
-	"type" : "object",
-
-	"properties" : {
-		"type" : {
-			"type" : ["string", "array"],
-			"items" : {
-				"type" : ["string", {"$ref" : "#"}]
-			},
-			"uniqueItems" : true,
-			"default" : "any"
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"patternProperties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"additionalProperties" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"default" : {}
-		},
-
-		"items" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"additionalItems" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"default" : {}
-		},
-
-		"required" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"dependencies" : {
-			"type" : "object",
-			"additionalProperties" : {
-				"type" : ["string", "array", {"$ref" : "#"}],
-				"items" : {
-					"type" : "string"
-				}
-			},
-			"default" : {}
-		},
-
-		"minimum" : {
-			"type" : "number"
-		},
-
-		"maximum" : {
-			"type" : "number"
-		},
-
-		"exclusiveMinimum" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"exclusiveMaximum" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"minItems" : {
-			"type" : "integer",
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxItems" : {
-			"type" : "integer",
-			"minimum" : 0
-		},
-
-		"uniqueItems" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"pattern" : {
-			"type" : "string",
-			"format" : "regex"
-		},
-
-		"minLength" : {
-			"type" : "integer",
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxLength" : {
-			"type" : "integer"
-		},
-
-		"enum" : {
-			"type" : "array",
-			"minItems" : 1,
-			"uniqueItems" : true
-		},
-
-		"default" : {
-			"type" : "any"
-		},
-
-		"title" : {
-			"type" : "string"
-		},
-
-		"description" : {
-			"type" : "string"
-		},
-
-		"format" : {
-			"type" : "string"
-		},
-
-		"divisibleBy" : {
-			"type" : "number",
-			"minimum" : 0,
-			"exclusiveMinimum" : true,
-			"default" : 1
-		},
-
-		"disallow" : {
-			"type" : ["string", "array"],
-			"items" : {
-				"type" : ["string", {"$ref" : "#"}]
-			},
-			"uniqueItems" : true
-		},
-
-		"extends" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"id" : {
-			"type" : "string",
-			"format" : "uri"
-		},
-
-		"$ref" : {
-			"type" : "string",
-			"format" : "uri"
-		},
-
-		"$schema" : {
-			"type" : "string",
-			"format" : "uri"
-		}
-	},
-
-	"dependencies" : {
-		"exclusiveMinimum" : "minimum",
-		"exclusiveMaximum" : "maximum"
-	},
-
-	"default" : {}
+{
+	"$schema" : "http://json-schema.org/draft-03/schema#",
+	"id" : "http://json-schema.org/draft-03/schema#",
+	"type" : "object",
+	
+	"properties" : {
+		"type" : {
+			"type" : ["string", "array"],
+			"items" : {
+				"type" : ["string", {"$ref" : "#"}]
+			},
+			"uniqueItems" : true,
+			"default" : "any"
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"patternProperties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"additionalProperties" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"default" : {}
+		},
+		
+		"items" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"additionalItems" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"default" : {}
+		},
+		
+		"required" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"dependencies" : {
+			"type" : "object",
+			"additionalProperties" : {
+				"type" : ["string", "array", {"$ref" : "#"}],
+				"items" : {
+					"type" : "string"
+				}
+			},
+			"default" : {}
+		},
+		
+		"minimum" : {
+			"type" : "number"
+		},
+		
+		"maximum" : {
+			"type" : "number"
+		},
+		
+		"exclusiveMinimum" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"exclusiveMaximum" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"minItems" : {
+			"type" : "integer",
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxItems" : {
+			"type" : "integer",
+			"minimum" : 0
+		},
+		
+		"uniqueItems" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"pattern" : {
+			"type" : "string",
+			"format" : "regex"
+		},
+		
+		"minLength" : {
+			"type" : "integer",
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxLength" : {
+			"type" : "integer"
+		},
+		
+		"enum" : {
+			"type" : "array",
+			"minItems" : 1,
+			"uniqueItems" : true
+		},
+		
+		"default" : {
+			"type" : "any"
+		},
+		
+		"title" : {
+			"type" : "string"
+		},
+		
+		"description" : {
+			"type" : "string"
+		},
+		
+		"format" : {
+			"type" : "string"
+		},
+		
+		"divisibleBy" : {
+			"type" : "number",
+			"minimum" : 0,
+			"exclusiveMinimum" : true,
+			"default" : 1
+		},
+		
+		"disallow" : {
+			"type" : ["string", "array"],
+			"items" : {
+				"type" : ["string", {"$ref" : "#"}]
+			},
+			"uniqueItems" : true
+		},
+		
+		"extends" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"id" : {
+			"type" : "string",
+			"format" : "uri"
+		},
+		
+		"$ref" : {
+			"type" : "string",
+			"format" : "uri"
+		},
+		
+		"$schema" : {
+			"type" : "string",
+			"format" : "uri"
+		}
+	},
+	
+	"dependencies" : {
+		"exclusiveMinimum" : "minimum",
+		"exclusiveMaximum" : "maximum"
+	},
+	
+	"default" : {}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-04/hyper-schema b/deps/npm/node_modules/json-schema/draft-04/hyper-schema
index f96d1ac6a585ed..63fb34d93e84fa 100644
--- a/deps/npm/node_modules/json-schema/draft-04/hyper-schema
+++ b/deps/npm/node_modules/json-schema/draft-04/hyper-schema
@@ -1,60 +1,60 @@
-{
-	"$schema" : "http://json-schema.org/draft-04/hyper-schema#",
-	"extends" : {"$ref" : "http://json-schema.org/draft-04/schema#"},
-	"id" : "http://json-schema.org/draft-04/hyper-schema#",
-
-	"properties" : {
-		"links" : {
-			"type" : "array",
-			"items" : {"$ref" : "http://json-schema.org/draft-04/links#"}
-		},
-
-		"fragmentResolution" : {
-			"type" : "string",
-			"default" : "json-pointer"
-		},
-
-		"root" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"readonly" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"contentEncoding" : {
-			"type" : "string"
-		},
-
-		"pathStart" : {
-			"type" : "string",
-			"format" : "uri"
-		},
-
-		"mediaType" : {
-			"type" : "string",
-			"format" : "media-type"
-		}
-	},
-
-	"links" : [
-		{
-			"href" : "{id}",
-			"rel" : "self"
-		},
-
-		{
-			"href" : "{$ref}",
-			"rel" : "full"
-		},
-
-		{
-			"href" : "{$schema}",
-			"rel" : "describedby"
-		}
-	],
-
-	"fragmentResolution" : "json-pointer"
-}
+{
+	"$schema" : "http://json-schema.org/draft-04/hyper-schema#",
+	"extends" : {"$ref" : "http://json-schema.org/draft-04/schema#"},
+	"id" : "http://json-schema.org/draft-04/hyper-schema#",
+
+	"properties" : {
+		"links" : {
+			"type" : "array",
+			"items" : {"$ref" : "http://json-schema.org/draft-04/links#"}
+		},
+
+		"fragmentResolution" : {
+			"type" : "string",
+			"default" : "json-pointer"
+		},
+
+		"root" : {
+			"type" : "boolean",
+			"default" : false
+		},
+
+		"readonly" : {
+			"type" : "boolean",
+			"default" : false
+		},
+
+		"contentEncoding" : {
+			"type" : "string"
+		},
+
+		"pathStart" : {
+			"type" : "string",
+			"format" : "uri"
+		},
+
+		"mediaType" : {
+			"type" : "string",
+			"format" : "media-type"
+		}
+	},
+
+	"links" : [
+		{
+			"href" : "{id}",
+			"rel" : "self"
+		},
+
+		{
+			"href" : "{$ref}",
+			"rel" : "full"
+		},
+
+		{
+			"href" : "{$schema}",
+			"rel" : "describedby"
+		}
+	],
+
+	"fragmentResolution" : "json-pointer"
+}
diff --git a/deps/npm/node_modules/json-schema/draft-04/links b/deps/npm/node_modules/json-schema/draft-04/links
index 7cf7c92c20965c..6c06d2930f71e6 100644
--- a/deps/npm/node_modules/json-schema/draft-04/links
+++ b/deps/npm/node_modules/json-schema/draft-04/links
@@ -1,41 +1,41 @@
-{
-	"$schema" : "http://json-schema.org/draft-04/hyper-schema#",
-	"id" : "http://json-schema.org/draft-04/links#",
-	"type" : "object",
-
-	"properties" : {
-		"rel" : {
-			"type" : "string"
-		},
-
-		"href" : {
-			"type" : "string"
-		},
-
-		"template" : {
-			"type" : "string"
-		},
-
-		"targetSchema" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"},
-
-		"method" : {
-			"type" : "string",
-			"default" : "GET"
-		},
-
-		"enctype" : {
-			"type" : "string"
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"}
-		}
-	},
-
-	"required" : ["rel", "href"],
-
-	"dependencies" : {
-		"enctype" : "method"
-	}
+{
+	"$schema" : "http://json-schema.org/draft-04/hyper-schema#",
+	"id" : "http://json-schema.org/draft-04/links#",
+	"type" : "object",
+	
+	"properties" : {
+		"rel" : {
+			"type" : "string"
+		},
+
+		"href" : {
+			"type" : "string"
+		},
+
+		"template" : {
+			"type" : "string"
+		},
+		
+		"targetSchema" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"},
+		
+		"method" : {
+			"type" : "string",
+			"default" : "GET"
+		},
+		
+		"enctype" : {
+			"type" : "string"
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"}
+		}
+	},
+	
+	"required" : ["rel", "href"],
+	
+	"dependencies" : {
+		"enctype" : "method"
+	}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-04/schema b/deps/npm/node_modules/json-schema/draft-04/schema
index e9c90699fda128..4231b1692178c5 100644
--- a/deps/npm/node_modules/json-schema/draft-04/schema
+++ b/deps/npm/node_modules/json-schema/draft-04/schema
@@ -1,189 +1,189 @@
-{
-	"$schema" : "http://json-schema.org/draft-04/schema#",
-	"id" : "http://json-schema.org/draft-04/schema#",
-	"type" : "object",
-
-	"properties" : {
-		"type" : {
-			"type" : [
-				{
-					"id" : "#simple-type",
-					"type" : "string",
-					"enum" : ["object", "array", "string", "number", "boolean", "null", "any"]
-				},
-				"array"
-			],
-			"items" : {
-				"type" : [
-					{"$ref" : "#simple-type"},
-					{"$ref" : "#"}
-				]
-			},
-			"uniqueItems" : true,
-			"default" : "any"
-		},
-
-		"disallow" : {
-			"type" : ["string", "array"],
-			"items" : {
-				"type" : ["string", {"$ref" : "#"}]
-			},
-			"uniqueItems" : true
-		},
-
-		"extends" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"enum" : {
-			"type" : "array",
-			"minItems" : 1,
-			"uniqueItems" : true
-		},
-
-		"minimum" : {
-			"type" : "number"
-		},
-
-		"maximum" : {
-			"type" : "number"
-		},
-
-		"exclusiveMinimum" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"exclusiveMaximum" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"divisibleBy" : {
-			"type" : "number",
-			"minimum" : 0,
-			"exclusiveMinimum" : true,
-			"default" : 1
-		},
-
-		"minLength" : {
-			"type" : "integer",
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxLength" : {
-			"type" : "integer"
-		},
-
-		"pattern" : {
-			"type" : "string"
-		},
-
-		"items" : {
-			"type" : [{"$ref" : "#"}, "array"],
-			"items" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"additionalItems" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"default" : {}
-		},
-
-		"minItems" : {
-			"type" : "integer",
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxItems" : {
-			"type" : "integer",
-			"minimum" : 0
-		},
-
-		"uniqueItems" : {
-			"type" : "boolean",
-			"default" : false
-		},
-
-		"properties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"patternProperties" : {
-			"type" : "object",
-			"additionalProperties" : {"$ref" : "#"},
-			"default" : {}
-		},
-
-		"additionalProperties" : {
-			"type" : [{"$ref" : "#"}, "boolean"],
-			"default" : {}
-		},
-
-		"minProperties" : {
-			"type" : "integer",
-			"minimum" : 0,
-			"default" : 0
-		},
-
-		"maxProperties" : {
-			"type" : "integer",
-			"minimum" : 0
-		},
-
-		"required" : {
-			"type" : "array",
-			"items" : {
-				"type" : "string"
-			}
-		},
-
-		"dependencies" : {
-			"type" : "object",
-			"additionalProperties" : {
-				"type" : ["string", "array", {"$ref" : "#"}],
-				"items" : {
-					"type" : "string"
-				}
-			},
-			"default" : {}
-		},
-
-		"id" : {
-			"type" : "string"
-		},
-
-		"$ref" : {
-			"type" : "string"
-		},
-
-		"$schema" : {
-			"type" : "string"
-		},
-
-		"title" : {
-			"type" : "string"
-		},
-
-		"description" : {
-			"type" : "string"
-		},
-
-		"default" : {
-			"type" : "any"
-		}
-	},
-
-	"dependencies" : {
-		"exclusiveMinimum" : "minimum",
-		"exclusiveMaximum" : "maximum"
-	},
-
-	"default" : {}
+{
+	"$schema" : "http://json-schema.org/draft-04/schema#",
+	"id" : "http://json-schema.org/draft-04/schema#",
+	"type" : "object",
+	
+	"properties" : {
+		"type" : {
+			"type" : [
+				{
+					"id" : "#simple-type",
+					"type" : "string",
+					"enum" : ["object", "array", "string", "number", "boolean", "null", "any"]
+				}, 
+				"array"
+			],
+			"items" : {
+				"type" : [
+					{"$ref" : "#simple-type"}, 
+					{"$ref" : "#"}
+				]
+			},
+			"uniqueItems" : true,
+			"default" : "any"
+		},
+		
+		"disallow" : {
+			"type" : ["string", "array"],
+			"items" : {
+				"type" : ["string", {"$ref" : "#"}]
+			},
+			"uniqueItems" : true
+		},
+		
+		"extends" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"default" : {}
+		},
+
+		"enum" : {
+			"type" : "array",
+			"minItems" : 1,
+			"uniqueItems" : true
+		},
+	
+		"minimum" : {
+			"type" : "number"
+		},
+		
+		"maximum" : {
+			"type" : "number"
+		},
+		
+		"exclusiveMinimum" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"exclusiveMaximum" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"divisibleBy" : {
+			"type" : "number",
+			"minimum" : 0,
+			"exclusiveMinimum" : true,
+			"default" : 1
+		},
+		
+		"minLength" : {
+			"type" : "integer",
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxLength" : {
+			"type" : "integer"
+		},
+		
+		"pattern" : {
+			"type" : "string"
+		},
+		
+		"items" : {
+			"type" : [{"$ref" : "#"}, "array"],
+			"items" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"additionalItems" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"default" : {}
+		},
+		
+		"minItems" : {
+			"type" : "integer",
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxItems" : {
+			"type" : "integer",
+			"minimum" : 0
+		},
+		
+		"uniqueItems" : {
+			"type" : "boolean",
+			"default" : false
+		},
+		
+		"properties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"patternProperties" : {
+			"type" : "object",
+			"additionalProperties" : {"$ref" : "#"},
+			"default" : {}
+		},
+		
+		"additionalProperties" : {
+			"type" : [{"$ref" : "#"}, "boolean"],
+			"default" : {}
+		},
+		
+		"minProperties" : {
+			"type" : "integer",
+			"minimum" : 0,
+			"default" : 0
+		},
+		
+		"maxProperties" : {
+			"type" : "integer",
+			"minimum" : 0
+		},
+		
+		"required" : {
+			"type" : "array",
+			"items" : {
+				"type" : "string"
+			}
+		},
+		
+		"dependencies" : {
+			"type" : "object",
+			"additionalProperties" : {
+				"type" : ["string", "array", {"$ref" : "#"}],
+				"items" : {
+					"type" : "string"
+				}
+			},
+			"default" : {}
+		},
+		
+		"id" : {
+			"type" : "string"
+		},
+		
+		"$ref" : {
+			"type" : "string"
+		},
+		
+		"$schema" : {
+			"type" : "string"
+		},
+		
+		"title" : {
+			"type" : "string"
+		},
+		
+		"description" : {
+			"type" : "string"
+		},
+		
+		"default" : {
+			"type" : "any"
+		}
+	},
+	
+	"dependencies" : {
+		"exclusiveMinimum" : "minimum",
+		"exclusiveMaximum" : "maximum"
+	},
+	
+	"default" : {}
 }
\ No newline at end of file
diff --git a/deps/npm/node_modules/json-schema/draft-zyp-json-schema-03.xml b/deps/npm/node_modules/json-schema/draft-zyp-json-schema-03.xml
index 1cf715910b5a83..cf606208197a4c 100644
--- a/deps/npm/node_modules/json-schema/draft-zyp-json-schema-03.xml
+++ b/deps/npm/node_modules/json-schema/draft-zyp-json-schema-03.xml
@@ -1,1120 +1,1120 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]>
-
-
-
-
-
-
-
-	
-		A JSON Media Type for Describing the Structure and Meaning of JSON Documents
-
-		
-			SitePen (USA)
-			
- - 530 Lytton Avenue - Palo Alto, CA 94301 - USA - - +1 650 968 8787 - kris@sitepen.com -
-
- - -
- - - Calgary, AB - Canada - - gary.court@gmail.com -
-
- - - Internet Engineering Task Force - JSON - Schema - JavaScript - Object - Notation - Hyper Schema - Hypermedia - - - - JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", - a JSON based format for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. - - -
- - -
- - JSON (JavaScript Object Notation) Schema is a JSON media type for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. - -
- -
- - - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", - "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be - interpreted as described in RFC 2119. - -
- - - -
- - JSON Schema defines the media type "application/schema+json" for - describing the structure of other - JSON documents. JSON Schema is JSON-based and includes facilities - for describing the structure of JSON documents in terms of - allowable values, descriptions, and interpreting relations with other resources. - - - JSON Schema format is organized into several separate definitions. The first - definition is the core schema specification. This definition is primary - concerned with describing a JSON structure and specifying valid elements - in the structure. The second definition is the Hyper Schema specification - which is intended define elements in a structure that can be interpreted as - hyperlinks. - Hyper Schema builds on JSON Schema to describe the hyperlink structure of - other JSON documents and elements of interaction. This allows user agents to be able to successfully navigate - JSON documents based on their schemas. - - - Cumulatively JSON Schema acts as a meta-document that can be used to define the required type and constraints on - property values, as well as define the meaning of the property values - for the purpose of describing a resource and determining hyperlinks - within the representation. - -
- An example JSON Schema that describes products might look like: - - - - - This schema defines the properties of the instance JSON documents, - the required properties (id, name, and price), as well as an optional - property (tags). This also defines the link relations of the instance - JSON documents. - -
- -
- - For this specification, schema will be used to denote a JSON Schema - definition, and an instance refers to a JSON value that the schema - will be describing and validating. - -
- -
- - The JSON Schema media type does not attempt to dictate the structure of JSON - representations that contain data, but rather provides a separate format - for flexibly communicating how a JSON representation should be - interpreted and validated, such that user agents can properly understand - acceptable structures and extrapolate hyperlink information - with the JSON document. It is acknowledged that JSON documents come - in a variety of structures, and JSON is unique in that the structure - of stored data structures often prescribes a non-ambiguous definite - JSON representation. Attempting to force a specific structure is generally - not viable, and therefore JSON Schema allows for a great flexibility - in the structure of the JSON data that it describes. - - - This specification is protocol agnostic. - The underlying protocol (such as HTTP) should sufficiently define the - semantics of the client-server interface, the retrieval of resource - representations linked to by JSON representations, and modification of - those resources. The goal of this - format is to sufficiently describe JSON structures such that one can - utilize existing information available in existing JSON - representations from a large variety of services that leverage a representational state transfer - architecture using existing protocols. - -
-
- -
- - JSON Schema instances are correlated to their schema by the "describedby" - relation, where the schema is defined to be the target of the relation. - Instance representations may be of the "application/json" media type or - any other subtype. Consequently, dictating how an instance - representation should specify the relation to the schema is beyond the normative scope - of this document (since this document specifically defines the JSON - Schema media type, and no other), but it is recommended that instances - specify their schema so that user agents can interpret the instance - representation and messages may retain the self-descriptive - characteristic, avoiding the need for out-of-band information about - instance data. Two approaches are recommended for declaring the - relation to the schema that describes the meaning of a JSON instance's (or collection - of instances) structure. A MIME type parameter named - "profile" or a relation of "describedby" (which could be defined by a Link header) may be used: - -
- - - -
- - or if the content is being transferred by a protocol (such as HTTP) that - provides headers, a Link header can be used: - -
- -; rel="describedby" -]]> - -
- - Instances MAY specify multiple schemas, to indicate all the schemas that - are applicable to the data, and the data SHOULD be valid by all the schemas. - The instance data MAY have multiple schemas - that it is defined by (the instance data SHOULD be valid for those schemas). - Or if the document is a collection of instances, the collection MAY contain - instances from different schemas. When collections contain heterogeneous - instances, the "pathStart" attribute MAY be specified in the - schema to disambiguate which schema should be applied for each item in the - collection. However, ultimately, the mechanism for referencing a schema is up to the - media type of the instance documents (if they choose to specify that schemas - can be referenced). -
- -
- - JSON Schemas can themselves be described using JSON Schemas. - A self-describing JSON Schema for the core JSON Schema can - be found at http://json-schema.org/schema for the latest version or - http://json-schema.org/draft-03/schema for the draft-03 version. The hyper schema - self-description can be found at http://json-schema.org/hyper-schema - or http://json-schema.org/draft-03/hyper-schema. All schemas - used within a protocol with media type definitions - SHOULD include a MIME parameter that refers to the self-descriptive - hyper schema or another schema that extends this hyper schema: - -
- - - -
-
-
-
- -
- - A JSON Schema is a JSON Object that defines various attributes - (including usage and valid values) of a JSON value. JSON - Schema has recursive capabilities; there are a number of elements - in the structure that allow for nested JSON Schemas. - - -
- An example JSON Schema definition could look like: - - - -
- - - A JSON Schema object may have any of the following properties, called schema - attributes (all attributes are optional): - - -
- - This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. - This attribute can take one of two forms: - - - - A string indicating a primitive or simple type. The following are acceptable string values: - - - Value MUST be a string. - Value MUST be a number, floating point numbers are allowed. - Value MUST be an integer, no floating point numbers are allowed. This is a subset of the number type. - Value MUST be a boolean. - Value MUST be an object. - Value MUST be an array. - Value MUST be null. Note this is mainly for purpose of being able use union types to define nullability. If this type is not included in a union, null values are not allowed (the primitives listed above do not allow nulls on their own). - Value MAY be of any type including null. - - - If the property is not defined or is not in this list, then any type of value is acceptable. - Other type values MAY be used for custom purposes, but minimal validators of the specification - implementation can allow any instance value on unknown type values. - - - - An array of two or more simple type definitions. Each item in the array MUST be a simple type definition or a schema. - The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. - - - - -
- For example, a schema that defines if an instance can be a string or a number would be: - - -
-
- -
- This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a schema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order. -
- -
- This attribute is an object that defines the schema for a set of property names of an object instance. The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value. -
- -
- This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties. -
- -
- This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array. - When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. - When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute using the same rules as "additionalProperties" for objects. -
- -
- This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema that defines the schema of the additional items. -
- -
- This attribute indicates if the instance must have a value, and not be undefined. This is false by default, making the instance optional. -
- -
- This attribute is an object that defines the requirements of a property on an instance object. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). - - The dependency value can take one of two forms: - - - - If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. - If the dependency value is an array of strings, then the instance object MUST have a property with the same name as each string in the dependency value's array. - - - If the dependency value is a schema, then the instance object MUST be valid against the schema. - - - -
- -
- This attribute defines the minimum value of the instance property when the type of the instance value is a number. -
- -
- This attribute defines the maximum value of the instance property when the type of the instance value is a number. -
- -
- This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value. -
- -
- This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value. -
- -
- This attribute defines the minimum number of values in an array when the array is the instance value. -
- -
- This attribute defines the maximum number of values in an array when the array is the instance value. -
- -
- This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). - - Two instance are consider equal if they are both of the same type and: - - - are null; or - are booleans/numbers/strings and have the same value; or - are arrays, contains the same number of items, and each item in the array is equal to the corresponding item in the other array; or - are objects, contains the same property names, and each property in the object is equal to the corresponding property in the other object. - - -
- -
- When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5 -
- -
- When the instance value is a string, this defines the minimum length of the string. -
- -
- When the instance value is a string, this defines the maximum length of the string. -
- -
- This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems". -
- -
- This attribute defines the default value of the instance when the instance is undefined. -
- -
- This attribute is a string that provides a short description of the instance property. -
- -
- This attribute is a string that provides a full description of the of purpose the instance property. -
- -
- This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MAY (but are not required to) validate that the instance values conform to a format. - - - The following formats are predefined: - - - This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. This is the recommended form of date/timestamp. - This SHOULD be a date in the format of YYYY-MM-DD. It is recommended that you use the "date-time" format instead of "date" unless you need to transfer only the date part. - This SHOULD be a time in the format of hh:mm:ss. It is recommended that you use the "date-time" format instead of "time" unless you need to transfer only the time part. - This SHOULD be the difference, measured in milliseconds, between the specified time and midnight, 00:00 of January 1, 1970 UTC. The value SHOULD be a number (integer or float). - A regular expression, following the regular expression specification from ECMA 262/Perl 5. - This is a CSS color (like "#FF0000" or "red"), based on CSS 2.1. - This is a CSS style definition (like "color: red; background-color:#FFF"), based on CSS 2.1. - This SHOULD be a phone number (format MAY follow E.123). - This value SHOULD be a URI. - This SHOULD be an email address. - This SHOULD be an ip version 4 address. - This SHOULD be an ip version 6 address. - This SHOULD be a host-name. - - - - Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format. -
- -
- This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0. -
- -
- This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid. -
- -
- The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. - - Conceptually, the behavior of extends can be seen as validating an - instance against all constraints in the extending schema as well as - the extended schema(s). More optimized implementations that merge - schemas are possible, but are not required. Some examples of using "extends": - -
- - - -
- -
- - - -
-
-
- -
- - This attribute defines the current URI of this schema (this attribute is - effectively a "self" link). This URI MAY be relative or absolute. If - the URI is relative it is resolved against the current URI of the parent - schema it is contained in. If this schema is not contained in any - parent schema, the current URI of the parent schema is held to be the - URI under which this schema was addressed. If id is missing, the current URI of a schema is - defined to be that of the parent schema. The current URI of the schema - is also used to construct relative references such as for $ref. - -
- -
- - This attribute defines a URI of a schema that contains the full representation of this schema. - When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. - This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema. - -
- -
- - This attribute defines a URI of a JSON Schema that is the schema of the current schema. - When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. - - - - A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. - Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes. - -
-
- -
- - The following attributes are specified in addition to those - attributes that already provided by the core schema with the specific - purpose of informing user agents of relations between resources based - on JSON data. Just as with JSON - schema attributes, all the attributes in hyper schemas are optional. - Therefore, an empty object is a valid (non-informative) schema, and - essentially describes plain JSON (no constraints on the structures). - Addition of attributes provides additive information for user agents. - - -
- - The value of the links property MUST be an array, where each item - in the array is a link description object which describes the link - relations of the instances. - - -
- - A link description object is used to describe link relations. In - the context of a schema, it defines the link relations of the - instances of the schema, and can be parameterized by the instance - values. The link description format can be used on its own in - regular (non-schema documents), and use of this format can - be declared by referencing the normative link description - schema as the the schema for the data structure that uses the - links. The URI of the normative link description schema is: - http://json-schema.org/links (latest version) or - http://json-schema.org/draft-03/links (draft-03 version). - - -
- - The value of the "href" link description property - indicates the target URI of the related resource. The value - of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 - and MAY be a relative URI. The base URI to be used for relative resolution - SHOULD be the URI used to retrieve the instance object (not the schema) - when used within a schema. Also, when links are used within a schema, the URI - SHOULD be parametrized by the property values of the instance - object, if property values exist for the corresponding variables - in the template (otherwise they MAY be provided from alternate sources, like user input). - - - - Instance property values SHOULD be substituted into the URIs where - matching braces ('{', '}') are found surrounding zero or more characters, - creating an expanded URI. Instance property value substitutions are resolved - by using the text between the braces to denote the property name - from the instance to get the value to substitute. - -
- For example, if an href value is defined: - - - - Then it would be resolved by replace the value of the "id" property value from the instance object. -
- -
- If the value of the "id" property was "45", the expanded URI would be: - - - -
- - If matching braces are found with the string "@" (no quotes) between the braces, then the - actual instance value SHOULD be used to replace the braces, rather than a property value. - This should only be used in situations where the instance is a scalar (string, - boolean, or number), and not for objects or arrays. -
-
- -
- - The value of the "rel" property indicates the name of the - relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. - - - - Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: - - - - If the relation value is "self", when this property is encountered in - the instance object, the object represents a resource and the instance object is - treated as a full representation of the target resource identified by - the specified URI. - - - - This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. - - - - This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. - - - - This relation indicates that the target of the link - SHOULD be treated as the root or the body of the representation for the - purposes of user agent interaction or fragment resolution. All other - properties of the instance objects can be regarded as meta-data - descriptions for the data. - - - - - - The following relations are applicable for schemas (the schema as the "from" resource in the relation): - - - This indicates the target resource that represents collection of instances of a schema. - This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). - - - - -
- For example, if a schema is defined: - - - -
- -
- And if a collection of instance resource's JSON representation was retrieved: - - - -
- - This would indicate that for the first item in the collection, its own - (self) URI would resolve to "/Resource/thing" and the first item's "up" - relation SHOULD be resolved to the resource at "/Resource/parent". - The "children" collection would be located at "/Resource/?upId=thing". -
-
- -
- This property value is a schema that defines the expected structure of the JSON representation of the target of the link. -
- -
- - The following properties also apply to link definition objects, and - provide functionality analogous to HTML forms, in providing a - means for submitting extra (often user supplied) information to send to a server. - - -
- - This attribute defines which method can be used to access the target resource. - In an HTTP environment, this would be "GET" or "POST" (other HTTP methods - such as "PUT" and "DELETE" have semantics that are clearly implied by - accessed resources, and do not need to be defined here). - This defaults to "GET". - -
- -
- - If present, this property indicates a query media type format that the server - supports for querying or posting to the collection of instances at the target - resource. The query can be - suffixed to the target URI to query the collection with - property-based constraints on the resources that SHOULD be returned from - the server or used to post data to the resource (depending on the method). - -
- For example, with the following schema: - - - - This indicates that the client can query the server for instances that have a specific name. -
- -
- For example: - - - -
- - If no enctype or method is specified, only the single URI specified by - the href property is defined. If the method is POST, "application/json" is - the default media type. -
-
- -
- - This attribute contains a schema which defines the acceptable structure of the submitted - request (for a GET request, this schema would define the properties for the query string - and for a POST request, this would define the body). - -
-
-
-
- -
- - This property indicates the fragment resolution protocol to use for - resolving fragment identifiers in URIs within the instance - representations. This applies to the instance object URIs and all - children of the instance object's URIs. The default fragment resolution - protocol is "slash-delimited", which is defined below. Other fragment - resolution protocols MAY be used, but are not defined in this document. - - - - The fragment identifier is based on RFC 2396, Sec 5, and defines the - mechanism for resolving references to entities within a document. - - -
- - With the slash-delimited fragment resolution protocol, the fragment - identifier is interpreted as a series of property reference tokens that start with and - are delimited by the "/" character (\x2F). Each property reference token - is a series of unreserved or escaped URI characters. Each property - reference token SHOULD be interpreted, starting from the beginning of - the fragment identifier, as a path reference in the target JSON - structure. The final target value of the fragment can be determined by - starting with the root of the JSON structure from the representation of - the resource identified by the pre-fragment URI. If the target is a JSON - object, then the new target is the value of the property with the name - identified by the next property reference token in the fragment. If the - target is a JSON array, then the target is determined by finding the - item in array the array with the index defined by the next property - reference token (which MUST be a number). The target is successively - updated for each property reference token, until the entire fragment has - been traversed. - - - - Property names SHOULD be URI-encoded. In particular, any "/" in a - property name MUST be encoded to avoid being interpreted as a property - delimiter. - - - -
- For example, for the following JSON representation: - - - -
- -
- The following fragment identifiers would be resolved: - - - -
-
-
- -
- - The dot-delimited fragment resolution protocol is the same as - slash-delimited fragment resolution protocol except that the "." character - (\x2E) is used as the delimiter between property names (instead of "/") and - the path does not need to start with a ".". For example, #.foo and #foo are a valid fragment - identifiers for referencing the value of the foo propery. - -
-
- -
- This attribute indicates that the instance property SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server. -
- -
- If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property. -
- -
- - This attribute is a URI that defines what the instance's URI MUST start with in order to validate. - The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, - and is relative to the instance's URI. - - - - When multiple schemas have been referenced for an instance, the user agent - can determine if this schema is applicable for a particular instance by - determining if the URI of the instance begins with the the value of the "pathStart" - attribute. If the URI of the instance does not start with this URI, - or if another schema specifies a starting URI that is longer and also matches the - instance, this schema SHOULD NOT be applied to the instance. Any schema - that does not have a pathStart attribute SHOULD be considered applicable - to all the instances for which it is referenced. - -
- -
- This attribute defines the media type of the instance representations that this schema is defining. -
-
- -
- - This specification is a sub-type of the JSON format, and - consequently the security considerations are generally the same as RFC 4627. - However, an additional issue is that when link relation of "self" - is used to denote a full representation of an object, the user agent - SHOULD NOT consider the representation to be the authoritative representation - of the resource denoted by the target URI if the target URI is not - equivalent to or a sub-path of the the URI used to request the resource - representation which contains the target URI with the "self" link. - -
- For example, if a hyper schema was defined: - - - -
- -
- And a resource was requested from somesite.com: - - - -
- -
- With a response of: - - - -
-
-
- -
- The proposed MIME media type for JSON Schema is "application/schema+json". - Type name: application - Subtype name: schema+json - Required parameters: profile - - The value of the profile parameter SHOULD be a URI (relative or absolute) that - refers to the schema used to define the structure of this structure (the - meta-schema). Normally the value would be http://json-schema.org/draft-03/hyper-schema, - but it is allowable to use other schemas that extend the hyper schema's meta- - schema. - - Optional parameters: pretty - The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. - -
- - This registry is maintained by IANA per RFC 4287 and this specification adds - four values: "full", "create", "instances", "root". New - assignments are subject to IESG Approval, as outlined in RFC 5226. - Requests should be made by email to IANA, which will then forward the - request to the IESG, requesting approval. - -
-
-
- - - - - &rfc2045; - &rfc2119; - &rfc2396; - &rfc3339; - &rfc3986; - &rfc4287; - - - &rfc2616; - &rfc4627; - &rfc5226; - &iddiscovery; - &uritemplate; - &linkheader; - &html401; - &css21; - - -
- - - - - Added example and verbiage to "extends" attribute. - Defined slash-delimited to use a leading slash. - Made "root" a relation instead of an attribute. - Removed address values, and MIME media type from format to reduce confusion (mediaType already exists, so it can be used for MIME types). - Added more explanation of nullability. - Removed "alternate" attribute. - Upper cased many normative usages of must, may, and should. - Replaced the link submission "properties" attribute to "schema" attribute. - Replaced "optional" attribute with "required" attribute. - Replaced "maximumCanEqual" attribute with "exclusiveMaximum" attribute. - Replaced "minimumCanEqual" attribute with "exclusiveMinimum" attribute. - Replaced "requires" attribute with "dependencies" attribute. - Moved "contentEncoding" attribute to hyper schema. - Added "additionalItems" attribute. - Added "id" attribute. - Switched self-referencing variable substitution from "-this" to "@" to align with reserved characters in URI template. - Added "patternProperties" attribute. - Schema URIs are now namespace versioned. - Added "$ref" and "$schema" attributes. - - - - - - Replaced "maxDecimal" attribute with "divisibleBy" attribute. - Added slash-delimited fragment resolution protocol and made it the default. - Added language about using links outside of schemas by referencing its normative URI. - Added "uniqueItems" attribute. - Added "targetSchema" attribute to link description object. - - - - - - Fixed category and updates from template. - - - - - - Initial draft. - - - - -
- -
- - - Should we give a preference to MIME headers over Link headers (or only use one)? - Should "root" be a MIME parameter? - Should "format" be renamed to "mediaType" or "contentType" to reflect the usage MIME media types that are allowed? - How should dates be handled? - - -
-
-
+ + + + + + + + + + + + + + + +]> + + + + + + + + + A JSON Media Type for Describing the Structure and Meaning of JSON Documents + + + SitePen (USA) +
+ + 530 Lytton Avenue + Palo Alto, CA 94301 + USA + + +1 650 968 8787 + kris@sitepen.com +
+
+ + +
+ + + Calgary, AB + Canada + + gary.court@gmail.com +
+
+ + + Internet Engineering Task Force + JSON + Schema + JavaScript + Object + Notation + Hyper Schema + Hypermedia + + + + JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", + a JSON based format for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data. + + +
+ + +
+ + JSON (JavaScript Object Notation) Schema is a JSON media type for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data. + +
+ +
+ + + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", + "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be + interpreted as described in RFC 2119. + +
+ + + +
+ + JSON Schema defines the media type "application/schema+json" for + describing the structure of other + JSON documents. JSON Schema is JSON-based and includes facilities + for describing the structure of JSON documents in terms of + allowable values, descriptions, and interpreting relations with other resources. + + + JSON Schema format is organized into several separate definitions. The first + definition is the core schema specification. This definition is primary + concerned with describing a JSON structure and specifying valid elements + in the structure. The second definition is the Hyper Schema specification + which is intended define elements in a structure that can be interpreted as + hyperlinks. + Hyper Schema builds on JSON Schema to describe the hyperlink structure of + other JSON documents and elements of interaction. This allows user agents to be able to successfully navigate + JSON documents based on their schemas. + + + Cumulatively JSON Schema acts as a meta-document that can be used to define the required type and constraints on + property values, as well as define the meaning of the property values + for the purpose of describing a resource and determining hyperlinks + within the representation. + +
+ An example JSON Schema that describes products might look like: + + + + + This schema defines the properties of the instance JSON documents, + the required properties (id, name, and price), as well as an optional + property (tags). This also defines the link relations of the instance + JSON documents. + +
+ +
+ + For this specification, schema will be used to denote a JSON Schema + definition, and an instance refers to a JSON value that the schema + will be describing and validating. + +
+ +
+ + The JSON Schema media type does not attempt to dictate the structure of JSON + representations that contain data, but rather provides a separate format + for flexibly communicating how a JSON representation should be + interpreted and validated, such that user agents can properly understand + acceptable structures and extrapolate hyperlink information + with the JSON document. It is acknowledged that JSON documents come + in a variety of structures, and JSON is unique in that the structure + of stored data structures often prescribes a non-ambiguous definite + JSON representation. Attempting to force a specific structure is generally + not viable, and therefore JSON Schema allows for a great flexibility + in the structure of the JSON data that it describes. + + + This specification is protocol agnostic. + The underlying protocol (such as HTTP) should sufficiently define the + semantics of the client-server interface, the retrieval of resource + representations linked to by JSON representations, and modification of + those resources. The goal of this + format is to sufficiently describe JSON structures such that one can + utilize existing information available in existing JSON + representations from a large variety of services that leverage a representational state transfer + architecture using existing protocols. + +
+
+ +
+ + JSON Schema instances are correlated to their schema by the "describedby" + relation, where the schema is defined to be the target of the relation. + Instance representations may be of the "application/json" media type or + any other subtype. Consequently, dictating how an instance + representation should specify the relation to the schema is beyond the normative scope + of this document (since this document specifically defines the JSON + Schema media type, and no other), but it is recommended that instances + specify their schema so that user agents can interpret the instance + representation and messages may retain the self-descriptive + characteristic, avoiding the need for out-of-band information about + instance data. Two approaches are recommended for declaring the + relation to the schema that describes the meaning of a JSON instance's (or collection + of instances) structure. A MIME type parameter named + "profile" or a relation of "describedby" (which could be defined by a Link header) may be used: + +
+ + + +
+ + or if the content is being transferred by a protocol (such as HTTP) that + provides headers, a Link header can be used: + +
+ +; rel="describedby" +]]> + +
+ + Instances MAY specify multiple schemas, to indicate all the schemas that + are applicable to the data, and the data SHOULD be valid by all the schemas. + The instance data MAY have multiple schemas + that it is defined by (the instance data SHOULD be valid for those schemas). + Or if the document is a collection of instances, the collection MAY contain + instances from different schemas. When collections contain heterogeneous + instances, the "pathStart" attribute MAY be specified in the + schema to disambiguate which schema should be applied for each item in the + collection. However, ultimately, the mechanism for referencing a schema is up to the + media type of the instance documents (if they choose to specify that schemas + can be referenced). +
+ +
+ + JSON Schemas can themselves be described using JSON Schemas. + A self-describing JSON Schema for the core JSON Schema can + be found at http://json-schema.org/schema for the latest version or + http://json-schema.org/draft-03/schema for the draft-03 version. The hyper schema + self-description can be found at http://json-schema.org/hyper-schema + or http://json-schema.org/draft-03/hyper-schema. All schemas + used within a protocol with media type definitions + SHOULD include a MIME parameter that refers to the self-descriptive + hyper schema or another schema that extends this hyper schema: + +
+ + + +
+
+
+
+ +
+ + A JSON Schema is a JSON Object that defines various attributes + (including usage and valid values) of a JSON value. JSON + Schema has recursive capabilities; there are a number of elements + in the structure that allow for nested JSON Schemas. + + +
+ An example JSON Schema definition could look like: + + + +
+ + + A JSON Schema object may have any of the following properties, called schema + attributes (all attributes are optional): + + +
+ + This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. + This attribute can take one of two forms: + + + + A string indicating a primitive or simple type. The following are acceptable string values: + + + Value MUST be a string. + Value MUST be a number, floating point numbers are allowed. + Value MUST be an integer, no floating point numbers are allowed. This is a subset of the number type. + Value MUST be a boolean. + Value MUST be an object. + Value MUST be an array. + Value MUST be null. Note this is mainly for purpose of being able use union types to define nullability. If this type is not included in a union, null values are not allowed (the primitives listed above do not allow nulls on their own). + Value MAY be of any type including null. + + + If the property is not defined or is not in this list, then any type of value is acceptable. + Other type values MAY be used for custom purposes, but minimal validators of the specification + implementation can allow any instance value on unknown type values. + + + + An array of two or more simple type definitions. Each item in the array MUST be a simple type definition or a schema. + The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. + + + + +
+ For example, a schema that defines if an instance can be a string or a number would be: + + +
+
+ +
+ This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a schema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order. +
+ +
+ This attribute is an object that defines the schema for a set of property names of an object instance. The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value. +
+ +
+ This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties. +
+ +
+ This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array. + When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. + When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute using the same rules as "additionalProperties" for objects. +
+ +
+ This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema that defines the schema of the additional items. +
+ +
+ This attribute indicates if the instance must have a value, and not be undefined. This is false by default, making the instance optional. +
+ +
+ This attribute is an object that defines the requirements of a property on an instance object. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). + + The dependency value can take one of two forms: + + + + If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. + If the dependency value is an array of strings, then the instance object MUST have a property with the same name as each string in the dependency value's array. + + + If the dependency value is a schema, then the instance object MUST be valid against the schema. + + + +
+ +
+ This attribute defines the minimum value of the instance property when the type of the instance value is a number. +
+ +
+ This attribute defines the maximum value of the instance property when the type of the instance value is a number. +
+ +
+ This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value. +
+ +
+ This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value. +
+ +
+ This attribute defines the minimum number of values in an array when the array is the instance value. +
+ +
+ This attribute defines the maximum number of values in an array when the array is the instance value. +
+ +
+ This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). + + Two instance are consider equal if they are both of the same type and: + + + are null; or + are booleans/numbers/strings and have the same value; or + are arrays, contains the same number of items, and each item in the array is equal to the corresponding item in the other array; or + are objects, contains the same property names, and each property in the object is equal to the corresponding property in the other object. + + +
+ +
+ When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5 +
+ +
+ When the instance value is a string, this defines the minimum length of the string. +
+ +
+ When the instance value is a string, this defines the maximum length of the string. +
+ +
+ This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems". +
+ +
+ This attribute defines the default value of the instance when the instance is undefined. +
+ +
+ This attribute is a string that provides a short description of the instance property. +
+ +
+ This attribute is a string that provides a full description of the of purpose the instance property. +
+ +
+ This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MAY (but are not required to) validate that the instance values conform to a format. + + + The following formats are predefined: + + + This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. This is the recommended form of date/timestamp. + This SHOULD be a date in the format of YYYY-MM-DD. It is recommended that you use the "date-time" format instead of "date" unless you need to transfer only the date part. + This SHOULD be a time in the format of hh:mm:ss. It is recommended that you use the "date-time" format instead of "time" unless you need to transfer only the time part. + This SHOULD be the difference, measured in milliseconds, between the specified time and midnight, 00:00 of January 1, 1970 UTC. The value SHOULD be a number (integer or float). + A regular expression, following the regular expression specification from ECMA 262/Perl 5. + This is a CSS color (like "#FF0000" or "red"), based on CSS 2.1. + This is a CSS style definition (like "color: red; background-color:#FFF"), based on CSS 2.1. + This SHOULD be a phone number (format MAY follow E.123). + This value SHOULD be a URI. + This SHOULD be an email address. + This SHOULD be an ip version 4 address. + This SHOULD be an ip version 6 address. + This SHOULD be a host-name. + + + + Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format. +
+ +
+ This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0. +
+ +
+ This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid. +
+ +
+ The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. + + Conceptually, the behavior of extends can be seen as validating an + instance against all constraints in the extending schema as well as + the extended schema(s). More optimized implementations that merge + schemas are possible, but are not required. Some examples of using "extends": + +
+ + + +
+ +
+ + + +
+
+
+ +
+ + This attribute defines the current URI of this schema (this attribute is + effectively a "self" link). This URI MAY be relative or absolute. If + the URI is relative it is resolved against the current URI of the parent + schema it is contained in. If this schema is not contained in any + parent schema, the current URI of the parent schema is held to be the + URI under which this schema was addressed. If id is missing, the current URI of a schema is + defined to be that of the parent schema. The current URI of the schema + is also used to construct relative references such as for $ref. + +
+ +
+ + This attribute defines a URI of a schema that contains the full representation of this schema. + When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. + This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema. + +
+ +
+ + This attribute defines a URI of a JSON Schema that is the schema of the current schema. + When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. + + + + A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. + Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes. + +
+
+ +
+ + The following attributes are specified in addition to those + attributes that already provided by the core schema with the specific + purpose of informing user agents of relations between resources based + on JSON data. Just as with JSON + schema attributes, all the attributes in hyper schemas are optional. + Therefore, an empty object is a valid (non-informative) schema, and + essentially describes plain JSON (no constraints on the structures). + Addition of attributes provides additive information for user agents. + + +
+ + The value of the links property MUST be an array, where each item + in the array is a link description object which describes the link + relations of the instances. + + +
+ + A link description object is used to describe link relations. In + the context of a schema, it defines the link relations of the + instances of the schema, and can be parameterized by the instance + values. The link description format can be used on its own in + regular (non-schema documents), and use of this format can + be declared by referencing the normative link description + schema as the the schema for the data structure that uses the + links. The URI of the normative link description schema is: + http://json-schema.org/links (latest version) or + http://json-schema.org/draft-03/links (draft-03 version). + + +
+ + The value of the "href" link description property + indicates the target URI of the related resource. The value + of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 + and MAY be a relative URI. The base URI to be used for relative resolution + SHOULD be the URI used to retrieve the instance object (not the schema) + when used within a schema. Also, when links are used within a schema, the URI + SHOULD be parametrized by the property values of the instance + object, if property values exist for the corresponding variables + in the template (otherwise they MAY be provided from alternate sources, like user input). + + + + Instance property values SHOULD be substituted into the URIs where + matching braces ('{', '}') are found surrounding zero or more characters, + creating an expanded URI. Instance property value substitutions are resolved + by using the text between the braces to denote the property name + from the instance to get the value to substitute. + +
+ For example, if an href value is defined: + + + + Then it would be resolved by replace the value of the "id" property value from the instance object. +
+ +
+ If the value of the "id" property was "45", the expanded URI would be: + + + +
+ + If matching braces are found with the string "@" (no quotes) between the braces, then the + actual instance value SHOULD be used to replace the braces, rather than a property value. + This should only be used in situations where the instance is a scalar (string, + boolean, or number), and not for objects or arrays. +
+
+ +
+ + The value of the "rel" property indicates the name of the + relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. + + + + Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: + + + + If the relation value is "self", when this property is encountered in + the instance object, the object represents a resource and the instance object is + treated as a full representation of the target resource identified by + the specified URI. + + + + This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. + + + + This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. + + + + This relation indicates that the target of the link + SHOULD be treated as the root or the body of the representation for the + purposes of user agent interaction or fragment resolution. All other + properties of the instance objects can be regarded as meta-data + descriptions for the data. + + + + + + The following relations are applicable for schemas (the schema as the "from" resource in the relation): + + + This indicates the target resource that represents collection of instances of a schema. + This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). + + + + +
+ For example, if a schema is defined: + + + +
+ +
+ And if a collection of instance resource's JSON representation was retrieved: + + + +
+ + This would indicate that for the first item in the collection, its own + (self) URI would resolve to "/Resource/thing" and the first item's "up" + relation SHOULD be resolved to the resource at "/Resource/parent". + The "children" collection would be located at "/Resource/?upId=thing". +
+
+ +
+ This property value is a schema that defines the expected structure of the JSON representation of the target of the link. +
+ +
+ + The following properties also apply to link definition objects, and + provide functionality analogous to HTML forms, in providing a + means for submitting extra (often user supplied) information to send to a server. + + +
+ + This attribute defines which method can be used to access the target resource. + In an HTTP environment, this would be "GET" or "POST" (other HTTP methods + such as "PUT" and "DELETE" have semantics that are clearly implied by + accessed resources, and do not need to be defined here). + This defaults to "GET". + +
+ +
+ + If present, this property indicates a query media type format that the server + supports for querying or posting to the collection of instances at the target + resource. The query can be + suffixed to the target URI to query the collection with + property-based constraints on the resources that SHOULD be returned from + the server or used to post data to the resource (depending on the method). + +
+ For example, with the following schema: + + + + This indicates that the client can query the server for instances that have a specific name. +
+ +
+ For example: + + + +
+ + If no enctype or method is specified, only the single URI specified by + the href property is defined. If the method is POST, "application/json" is + the default media type. +
+
+ +
+ + This attribute contains a schema which defines the acceptable structure of the submitted + request (for a GET request, this schema would define the properties for the query string + and for a POST request, this would define the body). + +
+
+
+
+ +
+ + This property indicates the fragment resolution protocol to use for + resolving fragment identifiers in URIs within the instance + representations. This applies to the instance object URIs and all + children of the instance object's URIs. The default fragment resolution + protocol is "slash-delimited", which is defined below. Other fragment + resolution protocols MAY be used, but are not defined in this document. + + + + The fragment identifier is based on RFC 2396, Sec 5, and defines the + mechanism for resolving references to entities within a document. + + +
+ + With the slash-delimited fragment resolution protocol, the fragment + identifier is interpreted as a series of property reference tokens that start with and + are delimited by the "/" character (\x2F). Each property reference token + is a series of unreserved or escaped URI characters. Each property + reference token SHOULD be interpreted, starting from the beginning of + the fragment identifier, as a path reference in the target JSON + structure. The final target value of the fragment can be determined by + starting with the root of the JSON structure from the representation of + the resource identified by the pre-fragment URI. If the target is a JSON + object, then the new target is the value of the property with the name + identified by the next property reference token in the fragment. If the + target is a JSON array, then the target is determined by finding the + item in array the array with the index defined by the next property + reference token (which MUST be a number). The target is successively + updated for each property reference token, until the entire fragment has + been traversed. + + + + Property names SHOULD be URI-encoded. In particular, any "/" in a + property name MUST be encoded to avoid being interpreted as a property + delimiter. + + + +
+ For example, for the following JSON representation: + + + +
+ +
+ The following fragment identifiers would be resolved: + + + +
+
+
+ +
+ + The dot-delimited fragment resolution protocol is the same as + slash-delimited fragment resolution protocol except that the "." character + (\x2E) is used as the delimiter between property names (instead of "/") and + the path does not need to start with a ".". For example, #.foo and #foo are a valid fragment + identifiers for referencing the value of the foo propery. + +
+
+ +
+ This attribute indicates that the instance property SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server. +
+ +
+ If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property. +
+ +
+ + This attribute is a URI that defines what the instance's URI MUST start with in order to validate. + The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, + and is relative to the instance's URI. + + + + When multiple schemas have been referenced for an instance, the user agent + can determine if this schema is applicable for a particular instance by + determining if the URI of the instance begins with the the value of the "pathStart" + attribute. If the URI of the instance does not start with this URI, + or if another schema specifies a starting URI that is longer and also matches the + instance, this schema SHOULD NOT be applied to the instance. Any schema + that does not have a pathStart attribute SHOULD be considered applicable + to all the instances for which it is referenced. + +
+ +
+ This attribute defines the media type of the instance representations that this schema is defining. +
+
+ +
+ + This specification is a sub-type of the JSON format, and + consequently the security considerations are generally the same as RFC 4627. + However, an additional issue is that when link relation of "self" + is used to denote a full representation of an object, the user agent + SHOULD NOT consider the representation to be the authoritative representation + of the resource denoted by the target URI if the target URI is not + equivalent to or a sub-path of the the URI used to request the resource + representation which contains the target URI with the "self" link. + +
+ For example, if a hyper schema was defined: + + + +
+ +
+ And a resource was requested from somesite.com: + + + +
+ +
+ With a response of: + + + +
+
+
+ +
+ The proposed MIME media type for JSON Schema is "application/schema+json". + Type name: application + Subtype name: schema+json + Required parameters: profile + + The value of the profile parameter SHOULD be a URI (relative or absolute) that + refers to the schema used to define the structure of this structure (the + meta-schema). Normally the value would be http://json-schema.org/draft-03/hyper-schema, + but it is allowable to use other schemas that extend the hyper schema's meta- + schema. + + Optional parameters: pretty + The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. + +
+ + This registry is maintained by IANA per RFC 4287 and this specification adds + four values: "full", "create", "instances", "root". New + assignments are subject to IESG Approval, as outlined in RFC 5226. + Requests should be made by email to IANA, which will then forward the + request to the IESG, requesting approval. + +
+
+
+ + + + + &rfc2045; + &rfc2119; + &rfc2396; + &rfc3339; + &rfc3986; + &rfc4287; + + + &rfc2616; + &rfc4627; + &rfc5226; + &iddiscovery; + &uritemplate; + &linkheader; + &html401; + &css21; + + +
+ + + + + Added example and verbiage to "extends" attribute. + Defined slash-delimited to use a leading slash. + Made "root" a relation instead of an attribute. + Removed address values, and MIME media type from format to reduce confusion (mediaType already exists, so it can be used for MIME types). + Added more explanation of nullability. + Removed "alternate" attribute. + Upper cased many normative usages of must, may, and should. + Replaced the link submission "properties" attribute to "schema" attribute. + Replaced "optional" attribute with "required" attribute. + Replaced "maximumCanEqual" attribute with "exclusiveMaximum" attribute. + Replaced "minimumCanEqual" attribute with "exclusiveMinimum" attribute. + Replaced "requires" attribute with "dependencies" attribute. + Moved "contentEncoding" attribute to hyper schema. + Added "additionalItems" attribute. + Added "id" attribute. + Switched self-referencing variable substitution from "-this" to "@" to align with reserved characters in URI template. + Added "patternProperties" attribute. + Schema URIs are now namespace versioned. + Added "$ref" and "$schema" attributes. + + + + + + Replaced "maxDecimal" attribute with "divisibleBy" attribute. + Added slash-delimited fragment resolution protocol and made it the default. + Added language about using links outside of schemas by referencing its normative URI. + Added "uniqueItems" attribute. + Added "targetSchema" attribute to link description object. + + + + + + Fixed category and updates from template. + + + + + + Initial draft. + + + + +
+ +
+ + + Should we give a preference to MIME headers over Link headers (or only use one)? + Should "root" be a MIME parameter? + Should "format" be renamed to "mediaType" or "contentType" to reflect the usage MIME media types that are allowed? + How should dates be handled? + + +
+
+
diff --git a/deps/npm/node_modules/json-schema/draft-zyp-json-schema-04.xml b/deps/npm/node_modules/json-schema/draft-zyp-json-schema-04.xml index 22fb3290df1472..8ede6bf9ebdce9 100644 --- a/deps/npm/node_modules/json-schema/draft-zyp-json-schema-04.xml +++ b/deps/npm/node_modules/json-schema/draft-zyp-json-schema-04.xml @@ -1,1072 +1,1072 @@ - - - - - - - - - - - - - - -]> - - - - - - - - - A JSON Media Type for Describing the Structure and Meaning of JSON Documents - - - SitePen (USA) -
- - 530 Lytton Avenue - Palo Alto, CA 94301 - USA - - +1 650 968 8787 - kris@sitepen.com -
-
- - -
- - - Calgary, AB - Canada - - gary.court@gmail.com -
-
- - - Internet Engineering Task Force - JSON - Schema - JavaScript - Object - Notation - Hyper Schema - Hypermedia - - - - JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", - a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. - - -
- - -
- - JSON (JavaScript Object Notation) Schema is a JSON media type for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. - -
- -
- - - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", - "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be - interpreted as described in RFC 2119. - - - - The terms "JSON", "JSON text", "JSON value", "member", "element", "object", - "array", "number", "string", "boolean", "true", "false", and "null" in this - document are to be interpreted as defined in RFC 4627. - - - - This specification also uses the following defined terms: - - - A JSON Schema object. - Equivalent to "JSON value" as defined in RFC 4627. - Equivalent to "member" as defined in RFC 4627. - Equivalent to "element" as defined in RFC 4627. - A property of a JSON Schema object. - - -
- -
- - JSON Schema defines the media type "application/schema+json" for - describing the structure of JSON text. JSON Schemas are also written in JSON and includes facilities - for describing the structure of JSON in terms of - allowable values, descriptions, and interpreting relations with other resources. - - - This document is organized into several separate definitions. The first - definition is the core schema specification. This definition is primary - concerned with describing a JSON structure and specifying valid elements - in the structure. The second definition is the Hyper Schema specification - which is intended to define elements in a structure that can be interpreted as - hyperlinks. - Hyper Schema builds on JSON Schema to describe the hyperlink structure of - JSON values. This allows user agents to be able to successfully navigate - documents containing JSON based on their schemas. - - - Cumulatively JSON Schema acts as meta-JSON that can be used to define the - required type and constraints on JSON values, as well as define the meaning - of the JSON values for the purpose of describing a resource and determining - hyperlinks within the representation. - -
- An example JSON Schema that describes products might look like: - - - - - This schema defines the properties of the instance, - the required properties (id, name, and price), as well as an optional - property (tags). This also defines the link relations of the instance. - -
- -
- - The JSON Schema media type does not attempt to dictate the structure of JSON - values that contain data, but rather provides a separate format - for flexibly communicating how a JSON value should be - interpreted and validated, such that user agents can properly understand - acceptable structures and extrapolate hyperlink information - from the JSON. It is acknowledged that JSON values come - in a variety of structures, and JSON is unique in that the structure - of stored data structures often prescribes a non-ambiguous definite - JSON representation. Attempting to force a specific structure is generally - not viable, and therefore JSON Schema allows for a great flexibility - in the structure of the JSON data that it describes. - - - This specification is protocol agnostic. - The underlying protocol (such as HTTP) should sufficiently define the - semantics of the client-server interface, the retrieval of resource - representations linked to by JSON representations, and modification of - those resources. The goal of this - format is to sufficiently describe JSON structures such that one can - utilize existing information available in existing JSON - representations from a large variety of services that leverage a representational state transfer - architecture using existing protocols. - -
-
- -
- - JSON values are correlated to their schema by the "describedby" - relation, where the schema is the target of the relation. - JSON values MUST be of the "application/json" media type or - any other subtype. Consequently, dictating how a JSON value should - specify the relation to the schema is beyond the normative scope - of this document since this document specifically defines the JSON - Schema media type, and no other. It is RECOMMNENDED that JSON values - specify their schema so that user agents can interpret the instance - and retain the self-descriptive characteristics. This avoides the need for out-of-band information about - instance data. Two approaches are recommended for declaring the - relation to the schema that describes the meaning of a JSON instance's (or collection - of instances) structure. A MIME type parameter named - "profile" or a relation of "describedby" (which could be specified by a Link header) may be used: - -
- - - -
- - or if the content is being transferred by a protocol (such as HTTP) that - provides headers, a Link header can be used: - -
- -; rel="describedby" -]]> - -
- - Instances MAY specify multiple schemas, to indicate all the schemas that - are applicable to the data, and the data SHOULD be valid by all the schemas. - The instance data MAY have multiple schemas - that it is described by (the instance data SHOULD be valid for those schemas). - Or if the document is a collection of instances, the collection MAY contain - instances from different schemas. The mechanism for referencing a schema is - determined by the media type of the instance (if it provides a method for - referencing schemas). -
- -
- - JSON Schemas can themselves be described using JSON Schemas. - A self-describing JSON Schema for the core JSON Schema can - be found at http://json-schema.org/schema for the latest version or - http://json-schema.org/draft-04/schema for the draft-04 version. The hyper schema - self-description can be found at http://json-schema.org/hyper-schema - or http://json-schema.org/draft-04/hyper-schema. All schemas - used within a protocol with a media type specified SHOULD include a MIME parameter that refers to the self-descriptive - hyper schema or another schema that extends this hyper schema: - -
- - - -
-
-
-
- -
- - A JSON Schema is a JSON object that defines various attributes - (including usage and valid values) of a JSON value. JSON - Schema has recursive capabilities; there are a number of elements - in the structure that allow for nested JSON Schemas. - - -
- An example JSON Schema could look like: - - - -
- - - A JSON Schema object MAY have any of the following optional properties: - - - - - -
- - This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. - This attribute can take one of two forms: - - - - A string indicating a primitive or simple type. The string MUST be one of the following values: - - - Instance MUST be an object. - Instance MUST be an array. - Instance MUST be a string. - Instance MUST be a number, including floating point numbers. - Instance MUST be the JSON literal "true" or "false". - Instance MUST be the JSON literal "null". Note that without this type, null values are not allowed. - Instance MAY be of any type, including null. - - - - - An array of one or more simple or schema types. - The instance value is valid if it is of the same type as one of the simple types, or valid by one of the schemas, in the array. - - - - If this attribute is not specified, then all value types are accepted. - - -
- For example, a schema that defines if an instance can be a string or a number would be: - - -
-
- -
- - This attribute is an object with properties that specify the schemas for the properties of the instance object. - In this attribute's object, each property value MUST be a schema. - When the instance value is an object, the value of the instance's properties MUST be valid according to the schemas with the same property names specified in this attribute. - Objects are unordered, so therefore the order of the instance properties or attribute properties MUST NOT determine validation success. - -
- -
- - This attribute is an object that defines the schema for a set of property names of an object instance. - The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. - If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value. - -
- -
- This attribute specifies how any instance property that is not explicitly defined by either the "properties" or "patternProperties" attributes (hereafter referred to as "additional properties") is handled. If specified, the value MUST be a schema or a boolean. - If a schema is provided, then all additional properties MUST be valid according to the schema. - If false is provided, then no additional properties are allowed. - The default value is an empty schema, which allows any value for additional properties. -
- -
- This attribute provides the allowed items in an array instance. If specified, this attribute MUST be a schema or an array of schemas. - When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. - When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST be valid according to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute the same way as "additionalProperties" for objects is. -
- -
- This attribute specifies how any item in the array instance that is not explicitly defined by "items" (hereafter referred to as "additional items") is handled. If specified, the value MUST be a schema or a boolean. - If a schema is provided: - - If the "items" attribute is unspecified, then all items in the array instance must be valid against this schema. - If the "items" attribute is a schema, then this attribute is ignored. - If the "items" attribute is an array (during tuple typing), then any additional items MUST be valid against this schema. - - - If false is provided, then any additional items in the array are not allowed. - The default value is an empty schema, which allows any value for additional items. -
- -
- This attribute is an array of strings that defines all the property names that must exist on the object instance. -
- -
- This attribute is an object that specifies the requirements of a property on an object instance. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). - - The dependency value can take one of two forms: - - - - If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. - If the dependency value is an array of strings, then the instance object MUST have a property with the same name as each string in the dependency value's array. - - - If the dependency value is a schema, then the instance object MUST be valid against the schema. - - - -
- -
- This attribute defines the minimum value of the instance property when the type of the instance value is a number. -
- -
- This attribute defines the maximum value of the instance property when the type of the instance value is a number. -
- -
- This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value. -
- -
- This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value. -
- -
- This attribute defines the minimum number of values in an array when the array is the instance value. -
- -
- This attribute defines the maximum number of values in an array when the array is the instance value. -
- -
- This attribute defines the minimum number of properties required on an object instance. -
- -
- This attribute defines the maximum number of properties the object instance can have. -
- -
- This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). - - Two instance are consider equal if they are both of the same type and: - - - are null; or - are booleans/numbers/strings and have the same value; or - are arrays, contains the same number of items, and each item in the array is equal to the item at the corresponding index in the other array; or - are objects, contains the same property names, and each property in the object is equal to the corresponding property in the other object. - - -
- -
- When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5 -
- -
- When the instance value is a string, this defines the minimum length of the string. -
- -
- When the instance value is a string, this defines the maximum length of the string. -
- -
- This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems". -
- -
- This attribute defines the default value of the instance when the instance is undefined. -
- -
- This attribute is a string that provides a short description of the instance property. -
- -
- This attribute is a string that provides a full description of the of purpose the instance property. -
- -
- This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0. -
- -
- This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid. -
- -
- The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. - - Conceptually, the behavior of extends can be seen as validating an - instance against all constraints in the extending schema as well as - the extended schema(s). More optimized implementations that merge - schemas are possible, but are not required. Some examples of using "extends": - -
- - - -
- -
- - - -
-
-
- -
- - This attribute defines the current URI of this schema (this attribute is - effectively a "self" link). This URI MAY be relative or absolute. If - the URI is relative it is resolved against the current URI of the parent - schema it is contained in. If this schema is not contained in any - parent schema, the current URI of the parent schema is held to be the - URI under which this schema was addressed. If id is missing, the current URI of a schema is - defined to be that of the parent schema. The current URI of the schema - is also used to construct relative references such as for $ref. - -
- -
- - This attribute defines a URI of a schema that contains the full representation of this schema. - When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. - This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema. - -
- -
- - This attribute defines a URI of a JSON Schema that is the schema of the current schema. - When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. - - - - A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. - Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes. - -
-
- -
- - The following attributes are specified in addition to those - attributes that already provided by the core schema with the specific - purpose of informing user agents of relations between resources based - on JSON data. Just as with JSON - schema attributes, all the attributes in hyper schemas are optional. - Therefore, an empty object is a valid (non-informative) schema, and - essentially describes plain JSON (no constraints on the structures). - Addition of attributes provides additive information for user agents. - - -
- - The value of the links property MUST be an array, where each item - in the array is a link description object which describes the link - relations of the instances. - - - - -
- - A link description object is used to describe link relations. In - the context of a schema, it defines the link relations of the - instances of the schema, and can be parameterized by the instance - values. The link description format can be used without JSON Schema, - and use of this format can - be declared by referencing the normative link description - schema as the the schema for the data structure that uses the - links. The URI of the normative link description schema is: - http://json-schema.org/links (latest version) or - http://json-schema.org/draft-04/links (draft-04 version). - - -
- - The value of the "href" link description property - indicates the target URI of the related resource. The value - of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 - and MAY be a relative URI. The base URI to be used for relative resolution - SHOULD be the URI used to retrieve the instance object (not the schema) - when used within a schema. Also, when links are used within a schema, the URI - SHOULD be parametrized by the property values of the instance - object, if property values exist for the corresponding variables - in the template (otherwise they MAY be provided from alternate sources, like user input). - - - - Instance property values SHOULD be substituted into the URIs where - matching braces ('{', '}') are found surrounding zero or more characters, - creating an expanded URI. Instance property value substitutions are resolved - by using the text between the braces to denote the property name - from the instance to get the value to substitute. - -
- For example, if an href value is defined: - - - - Then it would be resolved by replace the value of the "id" property value from the instance object. -
- -
- If the value of the "id" property was "45", the expanded URI would be: - - - -
- - If matching braces are found with the string "@" (no quotes) between the braces, then the - actual instance value SHOULD be used to replace the braces, rather than a property value. - This should only be used in situations where the instance is a scalar (string, - boolean, or number), and not for objects or arrays. -
-
- -
- - The value of the "rel" property indicates the name of the - relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. - - - - Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: - - - - If the relation value is "self", when this property is encountered in - the instance object, the object represents a resource and the instance object is - treated as a full representation of the target resource identified by - the specified URI. - - - - This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. - - - - This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. - - - - This relation indicates that the target of the link - SHOULD be treated as the root or the body of the representation for the - purposes of user agent interaction or fragment resolution. All other - properties of the instance objects can be regarded as meta-data - descriptions for the data. - - - - - - The following relations are applicable for schemas (the schema as the "from" resource in the relation): - - - This indicates the target resource that represents collection of instances of a schema. - This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). - - - - -
- For example, if a schema is defined: - - - -
- -
- And if a collection of instance resource's JSON representation was retrieved: - - - -
- - This would indicate that for the first item in the collection, its own - (self) URI would resolve to "/Resource/thing" and the first item's "up" - relation SHOULD be resolved to the resource at "/Resource/parent". - The "children" collection would be located at "/Resource/?upId=thing". -
-
- -
- This property value is a string that defines the templating language used in the "href" attribute. If no templating language is defined, then the default Link Description Object templating langauge is used. -
- -
- This property value is a schema that defines the expected structure of the JSON representation of the target of the link. -
- -
- - The following properties also apply to link definition objects, and - provide functionality analogous to HTML forms, in providing a - means for submitting extra (often user supplied) information to send to a server. - - -
- - This attribute defines which method can be used to access the target resource. - In an HTTP environment, this would be "GET" or "POST" (other HTTP methods - such as "PUT" and "DELETE" have semantics that are clearly implied by - accessed resources, and do not need to be defined here). - This defaults to "GET". - -
- -
- - If present, this property indicates a query media type format that the server - supports for querying or posting to the collection of instances at the target - resource. The query can be - suffixed to the target URI to query the collection with - property-based constraints on the resources that SHOULD be returned from - the server or used to post data to the resource (depending on the method). - -
- For example, with the following schema: - - - - This indicates that the client can query the server for instances that have a specific name. -
- -
- For example: - - - -
- - If no enctype or method is specified, only the single URI specified by - the href property is defined. If the method is POST, "application/json" is - the default media type. -
-
- -
- - This attribute contains a schema which defines the acceptable structure of the submitted - request (for a GET request, this schema would define the properties for the query string - and for a POST request, this would define the body). - -
-
-
-
- -
- - This property indicates the fragment resolution protocol to use for - resolving fragment identifiers in URIs within the instance - representations. This applies to the instance object URIs and all - children of the instance object's URIs. The default fragment resolution - protocol is "json-pointer", which is defined below. Other fragment - resolution protocols MAY be used, but are not defined in this document. - - - - The fragment identifier is based on RFC 3986, Sec 5, and defines the - mechanism for resolving references to entities within a document. - - -
- The "json-pointer" fragment resolution protocol uses a JSON Pointer to resolve fragment identifiers in URIs within instance representations. -
-
- - - -
- This attribute indicates that the instance value SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server. -
- -
- If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property. -
- -
- - This attribute is a URI that defines what the instance's URI MUST start with in order to validate. - The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, - and is relative to the instance's URI. - - - - When multiple schemas have been referenced for an instance, the user agent - can determine if this schema is applicable for a particular instance by - determining if the URI of the instance begins with the the value of the "pathStart" - attribute. If the URI of the instance does not start with this URI, - or if another schema specifies a starting URI that is longer and also matches the - instance, this schema SHOULD NOT be applied to the instance. Any schema - that does not have a pathStart attribute SHOULD be considered applicable - to all the instances for which it is referenced. - -
- -
- This attribute defines the media type of the instance representations that this schema is defining. -
-
- -
- - This specification is a sub-type of the JSON format, and - consequently the security considerations are generally the same as RFC 4627. - However, an additional issue is that when link relation of "self" - is used to denote a full representation of an object, the user agent - SHOULD NOT consider the representation to be the authoritative representation - of the resource denoted by the target URI if the target URI is not - equivalent to or a sub-path of the the URI used to request the resource - representation which contains the target URI with the "self" link. - -
- For example, if a hyper schema was defined: - - - -
- -
- And a resource was requested from somesite.com: - - - -
- -
- With a response of: - - - -
-
-
- -
- The proposed MIME media type for JSON Schema is "application/schema+json". - Type name: application - Subtype name: schema+json - Required parameters: profile - - The value of the profile parameter SHOULD be a URI (relative or absolute) that - refers to the schema used to define the structure of this structure (the - meta-schema). Normally the value would be http://json-schema.org/draft-04/hyper-schema, - but it is allowable to use other schemas that extend the hyper schema's meta- - schema. - - Optional parameters: pretty - The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. - -
- - This registry is maintained by IANA per RFC 4287 and this specification adds - four values: "full", "create", "instances", "root". New - assignments are subject to IESG Approval, as outlined in RFC 5226. - Requests should be made by email to IANA, which will then forward the - request to the IESG, requesting approval. - -
-
-
- - - - - &rfc2045; - &rfc2119; - &rfc3339; - &rfc3986; - &rfc4287; - - - JSON Pointer - - ForgeRock US, Inc. - - - SitePen (USA) - - - - - - - &rfc2616; - &rfc4627; - &rfc5226; - &iddiscovery; - &uritemplate; - &linkheader; - &html401; - &css21; - - -
- - - - - Changed "required" attribute to an array of strings. - Removed "format" attribute. - Added "minProperties" and "maxProperties" attributes. - Replaced "slash-delimited" fragment resolution with "json-pointer". - Added "template" LDO attribute. - Removed irrelevant "Open Issues" section. - Merged Conventions and Terminology sections. - Defined terms used in specification. - Removed "integer" type in favor of {"type":"number", "divisibleBy":1}. - Restricted "type" to only the core JSON types. - Improved wording of many sections. - - - - - - Added example and verbiage to "extends" attribute. - Defined slash-delimited to use a leading slash. - Made "root" a relation instead of an attribute. - Removed address values, and MIME media type from format to reduce confusion (mediaType already exists, so it can be used for MIME types). - Added more explanation of nullability. - Removed "alternate" attribute. - Upper cased many normative usages of must, may, and should. - Replaced the link submission "properties" attribute to "schema" attribute. - Replaced "optional" attribute with "required" attribute. - Replaced "maximumCanEqual" attribute with "exclusiveMaximum" attribute. - Replaced "minimumCanEqual" attribute with "exclusiveMinimum" attribute. - Replaced "requires" attribute with "dependencies" attribute. - Moved "contentEncoding" attribute to hyper schema. - Added "additionalItems" attribute. - Added "id" attribute. - Switched self-referencing variable substitution from "-this" to "@" to align with reserved characters in URI template. - Added "patternProperties" attribute. - Schema URIs are now namespace versioned. - Added "$ref" and "$schema" attributes. - - - - - - Replaced "maxDecimal" attribute with "divisibleBy" attribute. - Added slash-delimited fragment resolution protocol and made it the default. - Added language about using links outside of schemas by referencing its normative URI. - Added "uniqueItems" attribute. - Added "targetSchema" attribute to link description object. - - - - - - Fixed category and updates from template. - - - - - - Initial draft. - - - - -
-
-
+ + + + + + + + + + + + + + +]> + + + + + + + + + A JSON Media Type for Describing the Structure and Meaning of JSON Documents + + + SitePen (USA) +
+ + 530 Lytton Avenue + Palo Alto, CA 94301 + USA + + +1 650 968 8787 + kris@sitepen.com +
+
+ + +
+ + + Calgary, AB + Canada + + gary.court@gmail.com +
+
+ + + Internet Engineering Task Force + JSON + Schema + JavaScript + Object + Notation + Hyper Schema + Hypermedia + + + + JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", + a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data. + + +
+ + +
+ + JSON (JavaScript Object Notation) Schema is a JSON media type for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data. + +
+ +
+ + + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", + "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be + interpreted as described in RFC 2119. + + + + The terms "JSON", "JSON text", "JSON value", "member", "element", "object", + "array", "number", "string", "boolean", "true", "false", and "null" in this + document are to be interpreted as defined in RFC 4627. + + + + This specification also uses the following defined terms: + + + A JSON Schema object. + Equivalent to "JSON value" as defined in RFC 4627. + Equivalent to "member" as defined in RFC 4627. + Equivalent to "element" as defined in RFC 4627. + A property of a JSON Schema object. + + +
+ +
+ + JSON Schema defines the media type "application/schema+json" for + describing the structure of JSON text. JSON Schemas are also written in JSON and includes facilities + for describing the structure of JSON in terms of + allowable values, descriptions, and interpreting relations with other resources. + + + This document is organized into several separate definitions. The first + definition is the core schema specification. This definition is primary + concerned with describing a JSON structure and specifying valid elements + in the structure. The second definition is the Hyper Schema specification + which is intended to define elements in a structure that can be interpreted as + hyperlinks. + Hyper Schema builds on JSON Schema to describe the hyperlink structure of + JSON values. This allows user agents to be able to successfully navigate + documents containing JSON based on their schemas. + + + Cumulatively JSON Schema acts as meta-JSON that can be used to define the + required type and constraints on JSON values, as well as define the meaning + of the JSON values for the purpose of describing a resource and determining + hyperlinks within the representation. + +
+ An example JSON Schema that describes products might look like: + + + + + This schema defines the properties of the instance, + the required properties (id, name, and price), as well as an optional + property (tags). This also defines the link relations of the instance. + +
+ +
+ + The JSON Schema media type does not attempt to dictate the structure of JSON + values that contain data, but rather provides a separate format + for flexibly communicating how a JSON value should be + interpreted and validated, such that user agents can properly understand + acceptable structures and extrapolate hyperlink information + from the JSON. It is acknowledged that JSON values come + in a variety of structures, and JSON is unique in that the structure + of stored data structures often prescribes a non-ambiguous definite + JSON representation. Attempting to force a specific structure is generally + not viable, and therefore JSON Schema allows for a great flexibility + in the structure of the JSON data that it describes. + + + This specification is protocol agnostic. + The underlying protocol (such as HTTP) should sufficiently define the + semantics of the client-server interface, the retrieval of resource + representations linked to by JSON representations, and modification of + those resources. The goal of this + format is to sufficiently describe JSON structures such that one can + utilize existing information available in existing JSON + representations from a large variety of services that leverage a representational state transfer + architecture using existing protocols. + +
+
+ +
+ + JSON values are correlated to their schema by the "describedby" + relation, where the schema is the target of the relation. + JSON values MUST be of the "application/json" media type or + any other subtype. Consequently, dictating how a JSON value should + specify the relation to the schema is beyond the normative scope + of this document since this document specifically defines the JSON + Schema media type, and no other. It is RECOMMNENDED that JSON values + specify their schema so that user agents can interpret the instance + and retain the self-descriptive characteristics. This avoides the need for out-of-band information about + instance data. Two approaches are recommended for declaring the + relation to the schema that describes the meaning of a JSON instance's (or collection + of instances) structure. A MIME type parameter named + "profile" or a relation of "describedby" (which could be specified by a Link header) may be used: + +
+ + + +
+ + or if the content is being transferred by a protocol (such as HTTP) that + provides headers, a Link header can be used: + +
+ +; rel="describedby" +]]> + +
+ + Instances MAY specify multiple schemas, to indicate all the schemas that + are applicable to the data, and the data SHOULD be valid by all the schemas. + The instance data MAY have multiple schemas + that it is described by (the instance data SHOULD be valid for those schemas). + Or if the document is a collection of instances, the collection MAY contain + instances from different schemas. The mechanism for referencing a schema is + determined by the media type of the instance (if it provides a method for + referencing schemas). +
+ +
+ + JSON Schemas can themselves be described using JSON Schemas. + A self-describing JSON Schema for the core JSON Schema can + be found at http://json-schema.org/schema for the latest version or + http://json-schema.org/draft-04/schema for the draft-04 version. The hyper schema + self-description can be found at http://json-schema.org/hyper-schema + or http://json-schema.org/draft-04/hyper-schema. All schemas + used within a protocol with a media type specified SHOULD include a MIME parameter that refers to the self-descriptive + hyper schema or another schema that extends this hyper schema: + +
+ + + +
+
+
+
+ +
+ + A JSON Schema is a JSON object that defines various attributes + (including usage and valid values) of a JSON value. JSON + Schema has recursive capabilities; there are a number of elements + in the structure that allow for nested JSON Schemas. + + +
+ An example JSON Schema could look like: + + + +
+ + + A JSON Schema object MAY have any of the following optional properties: + + + + + +
+ + This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. + This attribute can take one of two forms: + + + + A string indicating a primitive or simple type. The string MUST be one of the following values: + + + Instance MUST be an object. + Instance MUST be an array. + Instance MUST be a string. + Instance MUST be a number, including floating point numbers. + Instance MUST be the JSON literal "true" or "false". + Instance MUST be the JSON literal "null". Note that without this type, null values are not allowed. + Instance MAY be of any type, including null. + + + + + An array of one or more simple or schema types. + The instance value is valid if it is of the same type as one of the simple types, or valid by one of the schemas, in the array. + + + + If this attribute is not specified, then all value types are accepted. + + +
+ For example, a schema that defines if an instance can be a string or a number would be: + + +
+
+ +
+ + This attribute is an object with properties that specify the schemas for the properties of the instance object. + In this attribute's object, each property value MUST be a schema. + When the instance value is an object, the value of the instance's properties MUST be valid according to the schemas with the same property names specified in this attribute. + Objects are unordered, so therefore the order of the instance properties or attribute properties MUST NOT determine validation success. + +
+ +
+ + This attribute is an object that defines the schema for a set of property names of an object instance. + The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. + If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value. + +
+ +
+ This attribute specifies how any instance property that is not explicitly defined by either the "properties" or "patternProperties" attributes (hereafter referred to as "additional properties") is handled. If specified, the value MUST be a schema or a boolean. + If a schema is provided, then all additional properties MUST be valid according to the schema. + If false is provided, then no additional properties are allowed. + The default value is an empty schema, which allows any value for additional properties. +
+ +
+ This attribute provides the allowed items in an array instance. If specified, this attribute MUST be a schema or an array of schemas. + When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. + When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST be valid according to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute the same way as "additionalProperties" for objects is. +
+ +
+ This attribute specifies how any item in the array instance that is not explicitly defined by "items" (hereafter referred to as "additional items") is handled. If specified, the value MUST be a schema or a boolean. + If a schema is provided: + + If the "items" attribute is unspecified, then all items in the array instance must be valid against this schema. + If the "items" attribute is a schema, then this attribute is ignored. + If the "items" attribute is an array (during tuple typing), then any additional items MUST be valid against this schema. + + + If false is provided, then any additional items in the array are not allowed. + The default value is an empty schema, which allows any value for additional items. +
+ +
+ This attribute is an array of strings that defines all the property names that must exist on the object instance. +
+ +
+ This attribute is an object that specifies the requirements of a property on an object instance. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). + + The dependency value can take one of two forms: + + + + If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. + If the dependency value is an array of strings, then the instance object MUST have a property with the same name as each string in the dependency value's array. + + + If the dependency value is a schema, then the instance object MUST be valid against the schema. + + + +
+ +
+ This attribute defines the minimum value of the instance property when the type of the instance value is a number. +
+ +
+ This attribute defines the maximum value of the instance property when the type of the instance value is a number. +
+ +
+ This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value. +
+ +
+ This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value. +
+ +
+ This attribute defines the minimum number of values in an array when the array is the instance value. +
+ +
+ This attribute defines the maximum number of values in an array when the array is the instance value. +
+ +
+ This attribute defines the minimum number of properties required on an object instance. +
+ +
+ This attribute defines the maximum number of properties the object instance can have. +
+ +
+ This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). + + Two instance are consider equal if they are both of the same type and: + + + are null; or + are booleans/numbers/strings and have the same value; or + are arrays, contains the same number of items, and each item in the array is equal to the item at the corresponding index in the other array; or + are objects, contains the same property names, and each property in the object is equal to the corresponding property in the other object. + + +
+ +
+ When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5 +
+ +
+ When the instance value is a string, this defines the minimum length of the string. +
+ +
+ When the instance value is a string, this defines the maximum length of the string. +
+ +
+ This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems". +
+ +
+ This attribute defines the default value of the instance when the instance is undefined. +
+ +
+ This attribute is a string that provides a short description of the instance property. +
+ +
+ This attribute is a string that provides a full description of the of purpose the instance property. +
+ +
+ This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0. +
+ +
+ This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid. +
+ +
+ The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. + + Conceptually, the behavior of extends can be seen as validating an + instance against all constraints in the extending schema as well as + the extended schema(s). More optimized implementations that merge + schemas are possible, but are not required. Some examples of using "extends": + +
+ + + +
+ +
+ + + +
+
+
+ +
+ + This attribute defines the current URI of this schema (this attribute is + effectively a "self" link). This URI MAY be relative or absolute. If + the URI is relative it is resolved against the current URI of the parent + schema it is contained in. If this schema is not contained in any + parent schema, the current URI of the parent schema is held to be the + URI under which this schema was addressed. If id is missing, the current URI of a schema is + defined to be that of the parent schema. The current URI of the schema + is also used to construct relative references such as for $ref. + +
+ +
+ + This attribute defines a URI of a schema that contains the full representation of this schema. + When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. + This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema. + +
+ +
+ + This attribute defines a URI of a JSON Schema that is the schema of the current schema. + When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. + + + + A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. + Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes. + +
+
+ +
+ + The following attributes are specified in addition to those + attributes that already provided by the core schema with the specific + purpose of informing user agents of relations between resources based + on JSON data. Just as with JSON + schema attributes, all the attributes in hyper schemas are optional. + Therefore, an empty object is a valid (non-informative) schema, and + essentially describes plain JSON (no constraints on the structures). + Addition of attributes provides additive information for user agents. + + +
+ + The value of the links property MUST be an array, where each item + in the array is a link description object which describes the link + relations of the instances. + + + + +
+ + A link description object is used to describe link relations. In + the context of a schema, it defines the link relations of the + instances of the schema, and can be parameterized by the instance + values. The link description format can be used without JSON Schema, + and use of this format can + be declared by referencing the normative link description + schema as the the schema for the data structure that uses the + links. The URI of the normative link description schema is: + http://json-schema.org/links (latest version) or + http://json-schema.org/draft-04/links (draft-04 version). + + +
+ + The value of the "href" link description property + indicates the target URI of the related resource. The value + of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 + and MAY be a relative URI. The base URI to be used for relative resolution + SHOULD be the URI used to retrieve the instance object (not the schema) + when used within a schema. Also, when links are used within a schema, the URI + SHOULD be parametrized by the property values of the instance + object, if property values exist for the corresponding variables + in the template (otherwise they MAY be provided from alternate sources, like user input). + + + + Instance property values SHOULD be substituted into the URIs where + matching braces ('{', '}') are found surrounding zero or more characters, + creating an expanded URI. Instance property value substitutions are resolved + by using the text between the braces to denote the property name + from the instance to get the value to substitute. + +
+ For example, if an href value is defined: + + + + Then it would be resolved by replace the value of the "id" property value from the instance object. +
+ +
+ If the value of the "id" property was "45", the expanded URI would be: + + + +
+ + If matching braces are found with the string "@" (no quotes) between the braces, then the + actual instance value SHOULD be used to replace the braces, rather than a property value. + This should only be used in situations where the instance is a scalar (string, + boolean, or number), and not for objects or arrays. +
+
+ +
+ + The value of the "rel" property indicates the name of the + relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. + + + + Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: + + + + If the relation value is "self", when this property is encountered in + the instance object, the object represents a resource and the instance object is + treated as a full representation of the target resource identified by + the specified URI. + + + + This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. + + + + This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. + + + + This relation indicates that the target of the link + SHOULD be treated as the root or the body of the representation for the + purposes of user agent interaction or fragment resolution. All other + properties of the instance objects can be regarded as meta-data + descriptions for the data. + + + + + + The following relations are applicable for schemas (the schema as the "from" resource in the relation): + + + This indicates the target resource that represents collection of instances of a schema. + This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). + + + + +
+ For example, if a schema is defined: + + + +
+ +
+ And if a collection of instance resource's JSON representation was retrieved: + + + +
+ + This would indicate that for the first item in the collection, its own + (self) URI would resolve to "/Resource/thing" and the first item's "up" + relation SHOULD be resolved to the resource at "/Resource/parent". + The "children" collection would be located at "/Resource/?upId=thing". +
+
+ +
+ This property value is a string that defines the templating language used in the "href" attribute. If no templating language is defined, then the default Link Description Object templating langauge is used. +
+ +
+ This property value is a schema that defines the expected structure of the JSON representation of the target of the link. +
+ +
+ + The following properties also apply to link definition objects, and + provide functionality analogous to HTML forms, in providing a + means for submitting extra (often user supplied) information to send to a server. + + +
+ + This attribute defines which method can be used to access the target resource. + In an HTTP environment, this would be "GET" or "POST" (other HTTP methods + such as "PUT" and "DELETE" have semantics that are clearly implied by + accessed resources, and do not need to be defined here). + This defaults to "GET". + +
+ +
+ + If present, this property indicates a query media type format that the server + supports for querying or posting to the collection of instances at the target + resource. The query can be + suffixed to the target URI to query the collection with + property-based constraints on the resources that SHOULD be returned from + the server or used to post data to the resource (depending on the method). + +
+ For example, with the following schema: + + + + This indicates that the client can query the server for instances that have a specific name. +
+ +
+ For example: + + + +
+ + If no enctype or method is specified, only the single URI specified by + the href property is defined. If the method is POST, "application/json" is + the default media type. +
+
+ +
+ + This attribute contains a schema which defines the acceptable structure of the submitted + request (for a GET request, this schema would define the properties for the query string + and for a POST request, this would define the body). + +
+
+
+
+ +
+ + This property indicates the fragment resolution protocol to use for + resolving fragment identifiers in URIs within the instance + representations. This applies to the instance object URIs and all + children of the instance object's URIs. The default fragment resolution + protocol is "json-pointer", which is defined below. Other fragment + resolution protocols MAY be used, but are not defined in this document. + + + + The fragment identifier is based on RFC 3986, Sec 5, and defines the + mechanism for resolving references to entities within a document. + + +
+ The "json-pointer" fragment resolution protocol uses a JSON Pointer to resolve fragment identifiers in URIs within instance representations. +
+
+ + + +
+ This attribute indicates that the instance value SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server. +
+ +
+ If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property. +
+ +
+ + This attribute is a URI that defines what the instance's URI MUST start with in order to validate. + The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, + and is relative to the instance's URI. + + + + When multiple schemas have been referenced for an instance, the user agent + can determine if this schema is applicable for a particular instance by + determining if the URI of the instance begins with the the value of the "pathStart" + attribute. If the URI of the instance does not start with this URI, + or if another schema specifies a starting URI that is longer and also matches the + instance, this schema SHOULD NOT be applied to the instance. Any schema + that does not have a pathStart attribute SHOULD be considered applicable + to all the instances for which it is referenced. + +
+ +
+ This attribute defines the media type of the instance representations that this schema is defining. +
+
+ +
+ + This specification is a sub-type of the JSON format, and + consequently the security considerations are generally the same as RFC 4627. + However, an additional issue is that when link relation of "self" + is used to denote a full representation of an object, the user agent + SHOULD NOT consider the representation to be the authoritative representation + of the resource denoted by the target URI if the target URI is not + equivalent to or a sub-path of the the URI used to request the resource + representation which contains the target URI with the "self" link. + +
+ For example, if a hyper schema was defined: + + + +
+ +
+ And a resource was requested from somesite.com: + + + +
+ +
+ With a response of: + + + +
+
+
+ +
+ The proposed MIME media type for JSON Schema is "application/schema+json". + Type name: application + Subtype name: schema+json + Required parameters: profile + + The value of the profile parameter SHOULD be a URI (relative or absolute) that + refers to the schema used to define the structure of this structure (the + meta-schema). Normally the value would be http://json-schema.org/draft-04/hyper-schema, + but it is allowable to use other schemas that extend the hyper schema's meta- + schema. + + Optional parameters: pretty + The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. + +
+ + This registry is maintained by IANA per RFC 4287 and this specification adds + four values: "full", "create", "instances", "root". New + assignments are subject to IESG Approval, as outlined in RFC 5226. + Requests should be made by email to IANA, which will then forward the + request to the IESG, requesting approval. + +
+
+
+ + + + + &rfc2045; + &rfc2119; + &rfc3339; + &rfc3986; + &rfc4287; + + + JSON Pointer + + ForgeRock US, Inc. + + + SitePen (USA) + + + + + + + &rfc2616; + &rfc4627; + &rfc5226; + &iddiscovery; + &uritemplate; + &linkheader; + &html401; + &css21; + + +
+ + + + + Changed "required" attribute to an array of strings. + Removed "format" attribute. + Added "minProperties" and "maxProperties" attributes. + Replaced "slash-delimited" fragment resolution with "json-pointer". + Added "template" LDO attribute. + Removed irrelevant "Open Issues" section. + Merged Conventions and Terminology sections. + Defined terms used in specification. + Removed "integer" type in favor of {"type":"number", "divisibleBy":1}. + Restricted "type" to only the core JSON types. + Improved wording of many sections. + + + + + + Added example and verbiage to "extends" attribute. + Defined slash-delimited to use a leading slash. + Made "root" a relation instead of an attribute. + Removed address values, and MIME media type from format to reduce confusion (mediaType already exists, so it can be used for MIME types). + Added more explanation of nullability. + Removed "alternate" attribute. + Upper cased many normative usages of must, may, and should. + Replaced the link submission "properties" attribute to "schema" attribute. + Replaced "optional" attribute with "required" attribute. + Replaced "maximumCanEqual" attribute with "exclusiveMaximum" attribute. + Replaced "minimumCanEqual" attribute with "exclusiveMinimum" attribute. + Replaced "requires" attribute with "dependencies" attribute. + Moved "contentEncoding" attribute to hyper schema. + Added "additionalItems" attribute. + Added "id" attribute. + Switched self-referencing variable substitution from "-this" to "@" to align with reserved characters in URI template. + Added "patternProperties" attribute. + Schema URIs are now namespace versioned. + Added "$ref" and "$schema" attributes. + + + + + + Replaced "maxDecimal" attribute with "divisibleBy" attribute. + Added slash-delimited fragment resolution protocol and made it the default. + Added language about using links outside of schemas by referencing its normative URI. + Added "uniqueItems" attribute. + Added "targetSchema" attribute to link description object. + + + + + + Fixed category and updates from template. + + + + + + Initial draft. + + + + +
+
+
diff --git a/deps/npm/node_modules/json-schema/lib/links.js b/deps/npm/node_modules/json-schema/lib/links.js index 2ef3f9fb7d0afe..8a87f02d16216d 100644 --- a/deps/npm/node_modules/json-schema/lib/links.js +++ b/deps/npm/node_modules/json-schema/lib/links.js @@ -1,66 +1,66 @@ -/** - * JSON Schema link handler - * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) - * Licensed under the MIT (MIT-LICENSE.txt) license. - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], function () { - return factory(); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals - root.jsonSchemaLinks = factory(); - } -}(this, function () {// setup primitive classes to be JSON Schema types -var exports = {}; -exports.cacheLinks = true; -exports.getLink = function(relation, instance, schema){ - // gets the URI of the link for the given relation based on the instance and schema - // for example: - // getLink( - // "brother", - // {"brother_id":33}, - // {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) -> - // "Brother/33" - var links = schema.__linkTemplates; - if(!links){ - links = {}; - var schemaLinks = schema.links; - if(schemaLinks && schemaLinks instanceof Array){ - schemaLinks.forEach(function(link){ - /* // TODO: allow for multiple same-name relations - if(links[link.rel]){ - if(!(links[link.rel] instanceof Array)){ - links[link.rel] = [links[link.rel]]; - } - }*/ - links[link.rel] = link.href; - }); - } - if(exports.cacheLinks){ - schema.__linkTemplates = links; - } - } - var linkTemplate = links[relation]; - return linkTemplate && exports.substitute(linkTemplate, instance); -}; - -exports.substitute = function(linkTemplate, instance){ - return linkTemplate.replace(/\{([^\}]*)\}/g, function(t, property){ - var value = instance[decodeURIComponent(property)]; - if(value instanceof Array){ - // the value is an array, it should produce a URI like /Table/(4,5,8) and store.get() should handle that as an array of values - return '(' + value.join(',') + ')'; - } - return value; - }); -}; -return exports; +/** + * JSON Schema link handler + * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) + * Licensed under the MIT (MIT-LICENSE.txt) license. + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], function () { + return factory(); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals + root.jsonSchemaLinks = factory(); + } +}(this, function () {// setup primitive classes to be JSON Schema types +var exports = {}; +exports.cacheLinks = true; +exports.getLink = function(relation, instance, schema){ + // gets the URI of the link for the given relation based on the instance and schema + // for example: + // getLink( + // "brother", + // {"brother_id":33}, + // {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) -> + // "Brother/33" + var links = schema.__linkTemplates; + if(!links){ + links = {}; + var schemaLinks = schema.links; + if(schemaLinks && schemaLinks instanceof Array){ + schemaLinks.forEach(function(link){ + /* // TODO: allow for multiple same-name relations + if(links[link.rel]){ + if(!(links[link.rel] instanceof Array)){ + links[link.rel] = [links[link.rel]]; + } + }*/ + links[link.rel] = link.href; + }); + } + if(exports.cacheLinks){ + schema.__linkTemplates = links; + } + } + var linkTemplate = links[relation]; + return linkTemplate && exports.substitute(linkTemplate, instance); +}; + +exports.substitute = function(linkTemplate, instance){ + return linkTemplate.replace(/\{([^\}]*)\}/g, function(t, property){ + var value = instance[decodeURIComponent(property)]; + if(value instanceof Array){ + // the value is an array, it should produce a URI like /Table/(4,5,8) and store.get() should handle that as an array of values + return '(' + value.join(',') + ')'; + } + return value; + }); +}; +return exports; })); \ No newline at end of file diff --git a/deps/npm/node_modules/json-schema/lib/validate.js b/deps/npm/node_modules/json-schema/lib/validate.js index 4b6108800aafb5..e4dc1511611152 100644 --- a/deps/npm/node_modules/json-schema/lib/validate.js +++ b/deps/npm/node_modules/json-schema/lib/validate.js @@ -1,273 +1,273 @@ -/** - * JSONSchema Validator - Validates JavaScript objects using JSON Schemas - * (http://www.json.com/json-schema-proposal/) - * - * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) - * Licensed under the MIT (MIT-LICENSE.txt) license. -To use the validator call the validate function with an instance object and an optional schema object. -If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), -that schema will be used to validate and the schema parameter is not necessary (if both exist, -both validations will occur). -The validate method will return an array of validation errors. If there are no errors, then an -empty list will be returned. A validation error will have two properties: -"property" which indicates which property had the error -"message" which indicates what the error was - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], function () { - return factory(); - }); - } else if (typeof module === 'object' && module.exports) { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals - root.jsonSchema = factory(); - } -}(this, function () {// setup primitive classes to be JSON Schema types -var exports = validate -exports.Integer = {type:"integer"}; -var primitiveConstructors = { - String: String, - Boolean: Boolean, - Number: Number, - Object: Object, - Array: Array, - Date: Date -} -exports.validate = validate; -function validate(/*Any*/instance,/*Object*/schema) { - // Summary: - // To use the validator call JSONSchema.validate with an instance object and an optional schema object. - // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), - // that schema will be used to validate and the schema parameter is not necessary (if both exist, - // both validations will occur). - // The validate method will return an object with two properties: - // valid: A boolean indicating if the instance is valid by the schema - // errors: An array of validation errors. If there are no errors, then an - // empty list will be returned. A validation error will have two properties: - // property: which indicates which property had the error - // message: which indicates what the error was - // - return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); - }; -exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { - // Summary: - // The checkPropertyChange method will check to see if an value can legally be in property with the given schema - // This is slightly different than the validate method in that it will fail if the schema is readonly and it will - // not check for self-validation, it is assumed that the passed in value is already internally valid. - // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for - // information. - // - return validate(value, schema, {changing: property || "property"}); - }; -var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { - - if (!options) options = {}; - var _changing = options.changing; - - function getType(schema){ - return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); - } - var errors = []; - // validate a value against a property definition - function checkProp(value, schema, path,i){ - - var l; - path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; - function addError(message){ - errors.push({property:path,message:message}); - } - - if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ - if(typeof schema == 'function'){ - if(!(value instanceof schema)){ - addError("is not an instance of the class/constructor " + schema.name); - } - }else if(schema){ - addError("Invalid schema/property definition " + schema); - } - return null; - } - if(_changing && schema.readonly){ - addError("is a readonly field, it can not be changed"); - } - if(schema['extends']){ // if it extends another schema, it must pass that schema as well - checkProp(value,schema['extends'],path,i); - } - // validate a value against a type definition - function checkType(type,value){ - if(type){ - if(typeof type == 'string' && type != 'any' && - (type == 'null' ? value !== null : typeof value != type) && - !(value instanceof Array && type == 'array') && - !(value instanceof Date && type == 'date') && - !(type == 'integer' && value%1===0)){ - return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; - } - if(type instanceof Array){ - var unionErrors=[]; - for(var j = 0; j < type.length; j++){ // a union type - if(!(unionErrors=checkType(type[j],value)).length){ - break; - } - } - if(unionErrors.length){ - return unionErrors; - } - }else if(typeof type == 'object'){ - var priorErrors = errors; - errors = []; - checkProp(value,type,path); - var theseErrors = errors; - errors = priorErrors; - return theseErrors; - } - } - return []; - } - if(value === undefined){ - if(schema.required){ - addError("is missing and it is required"); - } - }else{ - errors = errors.concat(checkType(getType(schema),value)); - if(schema.disallow && !checkType(schema.disallow,value).length){ - addError(" disallowed value was matched"); - } - if(value !== null){ - if(value instanceof Array){ - if(schema.items){ - var itemsIsArray = schema.items instanceof Array; - var propDef = schema.items; - for (i = 0, l = value.length; i < l; i += 1) { - if (itemsIsArray) - propDef = schema.items[i]; - if (options.coerce) - value[i] = options.coerce(value[i], propDef); - errors.concat(checkProp(value[i],propDef,path,i)); - } - } - if(schema.minItems && value.length < schema.minItems){ - addError("There must be a minimum of " + schema.minItems + " in the array"); - } - if(schema.maxItems && value.length > schema.maxItems){ - addError("There must be a maximum of " + schema.maxItems + " in the array"); - } - }else if(schema.properties || schema.additionalProperties){ - errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); - } - if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ - addError("does not match the regex pattern " + schema.pattern); - } - if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ - addError("may only be " + schema.maxLength + " characters long"); - } - if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ - addError("must be at least " + schema.minLength + " characters long"); - } - if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum && - schema.minimum > value){ - addError("must have a minimum value of " + schema.minimum); - } - if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && - schema.maximum < value){ - addError("must have a maximum value of " + schema.maximum); - } - if(schema['enum']){ - var enumer = schema['enum']; - l = enumer.length; - var found; - for(var j = 0; j < l; j++){ - if(enumer[j]===value){ - found=1; - break; - } - } - if(!found){ - addError("does not have a value in the enumeration " + enumer.join(", ")); - } - } - if(typeof schema.maxDecimal == 'number' && - (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ - addError("may only have " + schema.maxDecimal + " digits of decimal places"); - } - } - } - return null; - } - // validate an object against a schema - function checkObj(instance,objTypeDef,path,additionalProp){ - - if(typeof objTypeDef =='object'){ - if(typeof instance != 'object' || instance instanceof Array){ - errors.push({property:path,message:"an object is required"}); - } - - for(var i in objTypeDef){ - if(objTypeDef.hasOwnProperty(i)){ - var value = instance[i]; - // skip _not_ specified properties - if (value === undefined && options.existingOnly) continue; - var propDef = objTypeDef[i]; - // set default - if(value === undefined && propDef["default"]){ - value = instance[i] = propDef["default"]; - } - if(options.coerce && i in instance){ - value = instance[i] = options.coerce(value, propDef); - } - checkProp(value,propDef,path,i); - } - } - } - for(i in instance){ - if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ - if (options.filter) { - delete instance[i]; - continue; - } else { - errors.push({property:path,message:(typeof value) + "The property " + i + - " is not defined in the schema and the schema does not allow additional properties"}); - } - } - var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; - if(requires && !(requires in instance)){ - errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); - } - value = instance[i]; - if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ - if(options.coerce){ - value = instance[i] = options.coerce(value, additionalProp); - } - checkProp(value,additionalProp,path,i); - } - if(!_changing && value && value.$schema){ - errors = errors.concat(checkProp(value,value.$schema,path,i)); - } - } - return errors; - } - if(schema){ - checkProp(instance,schema,'',_changing || ''); - } - if(!_changing && instance && instance.$schema){ - checkProp(instance,instance.$schema,'',''); - } - return {valid:!errors.length,errors:errors}; -}; -exports.mustBeValid = function(result){ - // summary: - // This checks to ensure that the result is valid and will throw an appropriate error message if it is not - // result: the result returned from checkPropertyChange or validate - if(!result.valid){ - throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); - } -} - -return exports; -})); +/** + * JSONSchema Validator - Validates JavaScript objects using JSON Schemas + * (http://www.json.com/json-schema-proposal/) + * + * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) + * Licensed under the MIT (MIT-LICENSE.txt) license. +To use the validator call the validate function with an instance object and an optional schema object. +If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), +that schema will be used to validate and the schema parameter is not necessary (if both exist, +both validations will occur). +The validate method will return an array of validation errors. If there are no errors, then an +empty list will be returned. A validation error will have two properties: +"property" which indicates which property had the error +"message" which indicates what the error was + */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], function () { + return factory(); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals + root.jsonSchema = factory(); + } +}(this, function () {// setup primitive classes to be JSON Schema types +var exports = validate +exports.Integer = {type:"integer"}; +var primitiveConstructors = { + String: String, + Boolean: Boolean, + Number: Number, + Object: Object, + Array: Array, + Date: Date +} +exports.validate = validate; +function validate(/*Any*/instance,/*Object*/schema) { + // Summary: + // To use the validator call JSONSchema.validate with an instance object and an optional schema object. + // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + // that schema will be used to validate and the schema parameter is not necessary (if both exist, + // both validations will occur). + // The validate method will return an object with two properties: + // valid: A boolean indicating if the instance is valid by the schema + // errors: An array of validation errors. If there are no errors, then an + // empty list will be returned. A validation error will have two properties: + // property: which indicates which property had the error + // message: which indicates what the error was + // + return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false}); + }; +exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) { + // Summary: + // The checkPropertyChange method will check to see if an value can legally be in property with the given schema + // This is slightly different than the validate method in that it will fail if the schema is readonly and it will + // not check for self-validation, it is assumed that the passed in value is already internally valid. + // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for + // information. + // + return validate(value, schema, {changing: property || "property"}); + }; +var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) { + + if (!options) options = {}; + var _changing = options.changing; + + function getType(schema){ + return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase()); + } + var errors = []; + // validate a value against a property definition + function checkProp(value, schema, path,i){ + + var l; + path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; + function addError(message){ + errors.push({property:path,message:message}); + } + + if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){ + if(typeof schema == 'function'){ + if(!(value instanceof schema)){ + addError("is not an instance of the class/constructor " + schema.name); + } + }else if(schema){ + addError("Invalid schema/property definition " + schema); + } + return null; + } + if(_changing && schema.readonly){ + addError("is a readonly field, it can not be changed"); + } + if(schema['extends']){ // if it extends another schema, it must pass that schema as well + checkProp(value,schema['extends'],path,i); + } + // validate a value against a type definition + function checkType(type,value){ + if(type){ + if(typeof type == 'string' && type != 'any' && + (type == 'null' ? value !== null : typeof value != type) && + !(value instanceof Array && type == 'array') && + !(value instanceof Date && type == 'date') && + !(type == 'integer' && value%1===0)){ + return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}]; + } + if(type instanceof Array){ + var unionErrors=[]; + for(var j = 0; j < type.length; j++){ // a union type + if(!(unionErrors=checkType(type[j],value)).length){ + break; + } + } + if(unionErrors.length){ + return unionErrors; + } + }else if(typeof type == 'object'){ + var priorErrors = errors; + errors = []; + checkProp(value,type,path); + var theseErrors = errors; + errors = priorErrors; + return theseErrors; + } + } + return []; + } + if(value === undefined){ + if(schema.required){ + addError("is missing and it is required"); + } + }else{ + errors = errors.concat(checkType(getType(schema),value)); + if(schema.disallow && !checkType(schema.disallow,value).length){ + addError(" disallowed value was matched"); + } + if(value !== null){ + if(value instanceof Array){ + if(schema.items){ + var itemsIsArray = schema.items instanceof Array; + var propDef = schema.items; + for (i = 0, l = value.length; i < l; i += 1) { + if (itemsIsArray) + propDef = schema.items[i]; + if (options.coerce) + value[i] = options.coerce(value[i], propDef); + errors.concat(checkProp(value[i],propDef,path,i)); + } + } + if(schema.minItems && value.length < schema.minItems){ + addError("There must be a minimum of " + schema.minItems + " in the array"); + } + if(schema.maxItems && value.length > schema.maxItems){ + addError("There must be a maximum of " + schema.maxItems + " in the array"); + } + }else if(schema.properties || schema.additionalProperties){ + errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); + } + if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ + addError("does not match the regex pattern " + schema.pattern); + } + if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ + addError("may only be " + schema.maxLength + " characters long"); + } + if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ + addError("must be at least " + schema.minLength + " characters long"); + } + if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum && + schema.minimum > value){ + addError("must have a minimum value of " + schema.minimum); + } + if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum && + schema.maximum < value){ + addError("must have a maximum value of " + schema.maximum); + } + if(schema['enum']){ + var enumer = schema['enum']; + l = enumer.length; + var found; + for(var j = 0; j < l; j++){ + if(enumer[j]===value){ + found=1; + break; + } + } + if(!found){ + addError("does not have a value in the enumeration " + enumer.join(", ")); + } + } + if(typeof schema.maxDecimal == 'number' && + (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ + addError("may only have " + schema.maxDecimal + " digits of decimal places"); + } + } + } + return null; + } + // validate an object against a schema + function checkObj(instance,objTypeDef,path,additionalProp){ + + if(typeof objTypeDef =='object'){ + if(typeof instance != 'object' || instance instanceof Array){ + errors.push({property:path,message:"an object is required"}); + } + + for(var i in objTypeDef){ + if(objTypeDef.hasOwnProperty(i)){ + var value = instance[i]; + // skip _not_ specified properties + if (value === undefined && options.existingOnly) continue; + var propDef = objTypeDef[i]; + // set default + if(value === undefined && propDef["default"]){ + value = instance[i] = propDef["default"]; + } + if(options.coerce && i in instance){ + value = instance[i] = options.coerce(value, propDef); + } + checkProp(value,propDef,path,i); + } + } + } + for(i in instance){ + if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ + if (options.filter) { + delete instance[i]; + continue; + } else { + errors.push({property:path,message:(typeof value) + "The property " + i + + " is not defined in the schema and the schema does not allow additional properties"}); + } + } + var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; + if(requires && !(requires in instance)){ + errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); + } + value = instance[i]; + if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ + if(options.coerce){ + value = instance[i] = options.coerce(value, additionalProp); + } + checkProp(value,additionalProp,path,i); + } + if(!_changing && value && value.$schema){ + errors = errors.concat(checkProp(value,value.$schema,path,i)); + } + } + return errors; + } + if(schema){ + checkProp(instance,schema,'',_changing || ''); + } + if(!_changing && instance && instance.$schema){ + checkProp(instance,instance.$schema,'',''); + } + return {valid:!errors.length,errors:errors}; +}; +exports.mustBeValid = function(result){ + // summary: + // This checks to ensure that the result is valid and will throw an appropriate error message if it is not + // result: the result returned from checkPropertyChange or validate + if(!result.valid){ + throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); + } +} + +return exports; +})); diff --git a/deps/npm/node_modules/json-schema/package.json b/deps/npm/node_modules/json-schema/package.json index d675d571605053..b9b7bac836bce6 100644 --- a/deps/npm/node_modules/json-schema/package.json +++ b/deps/npm/node_modules/json-schema/package.json @@ -1,30 +1,31 @@ -{ - "name": "json-schema", - "version": "0.2.3", - "author": "Kris Zyp", - "description": "JSON Schema validation and specifications", - "maintainers":[ - {"name": "Kris Zyp", "email": "kriszyp@gmail.com"}], - "keywords": [ - "json", - "schema" - ], - "licenses": [ - { - "type": "AFLv2.1", - "url": "http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L43" - }, - { - "type": "BSD", - "url": "http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L13" - } - ], - "repository": { - "type":"git", - "url":"http://github.com/kriszyp/json-schema" - }, - "directories": { "lib": "./lib" }, - "main": "./lib/validate.js", - "devDependencies": { "vows": "*" }, - "scripts": { "test": "echo TESTS DISABLED vows --spec test/*.js" } -} +{ + "name": "json-schema", + "version": "0.2.3", + "author": "Kris Zyp", + "description": "JSON Schema validation and specifications", + "maintainers":[ + {"name": "Kris Zyp", "email": "kriszyp@gmail.com"}], + "keywords": [ + "json", + "schema" + ], + "licenses": [ + { + "type": "AFLv2.1", + "url": "http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L43" + }, + { + "type": "BSD", + "url": "http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L13" + } + ], + "repository": { + "type":"git", + "url":"http://github.com/kriszyp/json-schema" + }, + "directories": { "lib": "./lib" }, + "main": "./lib/validate.js", + "devDependencies": { "vows": "*" }, + "scripts": { "test": "echo TESTS DISABLED vows --spec test/*.js" } +} + diff --git a/deps/npm/node_modules/json-schema/test/tests.js b/deps/npm/node_modules/json-schema/test/tests.js index 40eeda5d9fb38d..2938aea7c74462 100644 --- a/deps/npm/node_modules/json-schema/test/tests.js +++ b/deps/npm/node_modules/json-schema/test/tests.js @@ -1,95 +1,95 @@ -var assert = require('assert'); -var vows = require('vows'); -var path = require('path'); -var fs = require('fs'); - -var validate = require('../lib/validate').validate; - - -var revision = 'draft-03'; -var schemaRoot = path.join(__dirname, '..', revision); -var schemaNames = ['schema', 'hyper-schema', 'links', 'json-ref' ]; -var schemas = {}; - -schemaNames.forEach(function(name) { - var file = path.join(schemaRoot, name); - schemas[name] = loadSchema(file); -}); - -schemaNames.forEach(function(name) { - var s, n = name+'-nsd', f = path.join(schemaRoot, name); - schemas[n] = loadSchema(f); - s = schemas[n]; - delete s['$schema']; -}); - -function loadSchema(path) { - var data = fs.readFileSync(path, 'utf-8'); - var schema = JSON.parse(data); - return schema; -} - -function resultIsValid() { - return function(result) { - assert.isObject(result); - //assert.isBoolean(result.valid); - assert.equal(typeof(result.valid), 'boolean'); - assert.isArray(result.errors); - for (var i = 0; i < result.errors.length; i++) { - assert.notEqual(result.errors[i], null, 'errors['+i+'] is null'); - } - } -} - -function assertValidates(doc, schema) { - var context = {}; - - context[': validate('+doc+', '+schema+')'] = { - topic: validate(schemas[doc], schemas[schema]), - 'returns valid result': resultIsValid(), - 'with valid=true': function(result) { assert.equal(result.valid, true); }, - 'and no errors': function(result) { - // XXX work-around for bug in vows: [null] chokes it - if (result.errors[0] == null) assert.fail('(errors contains null)'); - assert.length(result.errors, 0); - } - }; - - return context; -} - -function assertSelfValidates(doc) { - var context = {}; - - context[': validate('+doc+')'] = { - topic: validate(schemas[doc]), - 'returns valid result': resultIsValid(), - 'with valid=true': function(result) { assert.equal(result.valid, true); }, - 'and no errors': function(result) { assert.length(result.errors, 0); } - }; - - return context; -} - -var suite = vows.describe('JSON Schema').addBatch({ - 'Core-NSD self-validates': assertSelfValidates('schema-nsd'), - 'Core-NSD/Core-NSD': assertValidates('schema-nsd', 'schema-nsd'), - 'Core-NSD/Core': assertValidates('schema-nsd', 'schema'), - - 'Core self-validates': assertSelfValidates('schema'), - 'Core/Core': assertValidates('schema', 'schema'), - - 'Hyper-NSD self-validates': assertSelfValidates('hyper-schema-nsd'), - 'Hyper self-validates': assertSelfValidates('hyper-schema'), - 'Hyper/Hyper': assertValidates('hyper-schema', 'hyper-schema'), - 'Hyper/Core': assertValidates('hyper-schema', 'schema'), - - 'Links-NSD self-validates': assertSelfValidates('links-nsd'), - 'Links self-validates': assertSelfValidates('links'), - 'Links/Hyper': assertValidates('links', 'hyper-schema'), - 'Links/Core': assertValidates('links', 'schema'), - - 'Json-Ref self-validates': assertSelfValidates('json-ref'), - 'Json-Ref/Hyper': assertValidates('json-ref', 'hyper-schema'), - 'Json-Ref/Core': assertValidates('json-ref', 'schema') -}).export(module); +var assert = require('assert'); +var vows = require('vows'); +var path = require('path'); +var fs = require('fs'); + +var validate = require('../lib/validate').validate; + + +var revision = 'draft-03'; +var schemaRoot = path.join(__dirname, '..', revision); +var schemaNames = ['schema', 'hyper-schema', 'links', 'json-ref' ]; +var schemas = {}; + +schemaNames.forEach(function(name) { + var file = path.join(schemaRoot, name); + schemas[name] = loadSchema(file); +}); + +schemaNames.forEach(function(name) { + var s, n = name+'-nsd', f = path.join(schemaRoot, name); + schemas[n] = loadSchema(f); + s = schemas[n]; + delete s['$schema']; +}); + +function loadSchema(path) { + var data = fs.readFileSync(path, 'utf-8'); + var schema = JSON.parse(data); + return schema; +} + +function resultIsValid() { + return function(result) { + assert.isObject(result); + //assert.isBoolean(result.valid); + assert.equal(typeof(result.valid), 'boolean'); + assert.isArray(result.errors); + for (var i = 0; i < result.errors.length; i++) { + assert.notEqual(result.errors[i], null, 'errors['+i+'] is null'); + } + } +} + +function assertValidates(doc, schema) { + var context = {}; + + context[': validate('+doc+', '+schema+')'] = { + topic: validate(schemas[doc], schemas[schema]), + 'returns valid result': resultIsValid(), + 'with valid=true': function(result) { assert.equal(result.valid, true); }, + 'and no errors': function(result) { + // XXX work-around for bug in vows: [null] chokes it + if (result.errors[0] == null) assert.fail('(errors contains null)'); + assert.length(result.errors, 0); + } + }; + + return context; +} + +function assertSelfValidates(doc) { + var context = {}; + + context[': validate('+doc+')'] = { + topic: validate(schemas[doc]), + 'returns valid result': resultIsValid(), + 'with valid=true': function(result) { assert.equal(result.valid, true); }, + 'and no errors': function(result) { assert.length(result.errors, 0); } + }; + + return context; +} + +var suite = vows.describe('JSON Schema').addBatch({ + 'Core-NSD self-validates': assertSelfValidates('schema-nsd'), + 'Core-NSD/Core-NSD': assertValidates('schema-nsd', 'schema-nsd'), + 'Core-NSD/Core': assertValidates('schema-nsd', 'schema'), + + 'Core self-validates': assertSelfValidates('schema'), + 'Core/Core': assertValidates('schema', 'schema'), + + 'Hyper-NSD self-validates': assertSelfValidates('hyper-schema-nsd'), + 'Hyper self-validates': assertSelfValidates('hyper-schema'), + 'Hyper/Hyper': assertValidates('hyper-schema', 'hyper-schema'), + 'Hyper/Core': assertValidates('hyper-schema', 'schema'), + + 'Links-NSD self-validates': assertSelfValidates('links-nsd'), + 'Links self-validates': assertSelfValidates('links'), + 'Links/Hyper': assertValidates('links', 'hyper-schema'), + 'Links/Core': assertValidates('links', 'schema'), + + 'Json-Ref self-validates': assertSelfValidates('json-ref'), + 'Json-Ref/Hyper': assertValidates('json-ref', 'hyper-schema'), + 'Json-Ref/Core': assertValidates('json-ref', 'schema') +}).export(module); diff --git a/deps/npm/node_modules/just-diff/README.md b/deps/npm/node_modules/just-diff/README.md index f33a8cd8290648..836868fe9043be 100644 --- a/deps/npm/node_modules/just-diff/README.md +++ b/deps/npm/node_modules/just-diff/README.md @@ -1,11 +1,11 @@ ## just-diff -Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing. +Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion. [Try it now](http://anguscroll.com/just/just-diff) -Return an object representing the difference between two other objects +Return an object representing the difference between two other objects Pass converter to format as http://jsonpatch.com ```js diff --git a/deps/npm/node_modules/libnpmaccess/package.json b/deps/npm/node_modules/libnpmaccess/package.json index a727e187214745..2b522e090a89b5 100644 --- a/deps/npm/node_modules/libnpmaccess/package.json +++ b/deps/npm/node_modules/libnpmaccess/package.json @@ -1,6 +1,6 @@ { "name": "libnpmaccess", - "version": "4.0.0", + "version": "4.0.1", "description": "programmatic library for `npm access` commands", "author": "Kat Marchán ", "license": "ISC", @@ -26,7 +26,7 @@ "aproba": "^2.0.0", "minipass": "^3.1.1", "npm-package-arg": "^8.0.0", - "npm-registry-fetch": "^8.0.0" + "npm-registry-fetch": "^9.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/libnpmfund/CHANGELOG.md b/deps/npm/node_modules/libnpmfund/CHANGELOG.md index a50779fcdc430c..b890b58e1405ae 100644 --- a/deps/npm/node_modules/libnpmfund/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmfund/CHANGELOG.md @@ -3,3 +3,4 @@ ## 0.0.0-pre.0 - Initial pre-release. + diff --git a/deps/npm/node_modules/libnpmhook/package.json b/deps/npm/node_modules/libnpmhook/package.json index d8c5c687d5b898..abdac88e2c45fc 100644 --- a/deps/npm/node_modules/libnpmhook/package.json +++ b/deps/npm/node_modules/libnpmhook/package.json @@ -1,6 +1,6 @@ { "name": "libnpmhook", - "version": "6.0.0", + "version": "6.0.1", "description": "programmatic API for managing npm registry hooks", "main": "index.js", "files": [ @@ -28,7 +28,7 @@ "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^8.0.0" + "npm-registry-fetch": "^9.0.0" }, "devDependencies": { "nock": "^9.6.1", diff --git a/deps/npm/node_modules/libnpmorg/package.json b/deps/npm/node_modules/libnpmorg/package.json index f18c43adafaad6..b6074ed8e4a7ce 100644 --- a/deps/npm/node_modules/libnpmorg/package.json +++ b/deps/npm/node_modules/libnpmorg/package.json @@ -1,6 +1,6 @@ { "name": "libnpmorg", - "version": "2.0.0", + "version": "2.0.1", "description": "Programmatic api for `npm org` commands", "author": "Kat Marchán ", "keywords": [ @@ -40,7 +40,7 @@ "homepage": "https://npmjs.com/package/libnpmorg", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^8.0.0" + "npm-registry-fetch": "^9.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/libnpmpack/CHANGELOG.md b/deps/npm/node_modules/libnpmpack/CHANGELOG.md index 25daf9e3342bb4..2c078c63b0b09f 100644 --- a/deps/npm/node_modules/libnpmpack/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmpack/CHANGELOG.md @@ -7,7 +7,7 @@ * [`cb2ecf2`](https://github.com/npm/libnpmpack/commit/cb2ecf2) feat: resolve to tarball data Buffer ([@claudiahdz](https://github.com/claudiahdz)) - + # 1.0.0 (2020-03-26) ### Features diff --git a/deps/npm/node_modules/libnpmpack/README.md b/deps/npm/node_modules/libnpmpack/README.md index 15c911a1eaaa88..74b4934b0b7190 100644 --- a/deps/npm/node_modules/libnpmpack/README.md +++ b/deps/npm/node_modules/libnpmpack/README.md @@ -32,7 +32,7 @@ const pack = require('libnpmpack') Packs a tarball from a local directory or from a registry or github spec and returns a Promise that resolves to the tarball data Buffer, with from, resolved, and integrity fields attached. If no options are passed, the tarball file will be saved on the same directory from which `pack` was called in. - + `libnpmpack` uses [`pacote`](https://npm.im/pacote). Most options are passed through directly to that library, so please refer to [its own `opts` diff --git a/deps/npm/node_modules/libnpmpublish/README.md b/deps/npm/node_modules/libnpmpublish/README.md index 7d66958c9c0f4b..0da46e89d3b051 100644 --- a/deps/npm/node_modules/libnpmpublish/README.md +++ b/deps/npm/node_modules/libnpmpublish/README.md @@ -1,13 +1,9 @@ # libnpmpublish -[![npm version](https://img.shields.io/npm/v/libnpmpublish.svg)](https://npm.im/libnpmpublish) -[![license](https://img.shields.io/npm/l/libnpmpublish.svg)](https://npm.im/libnpmpublish) -[![GitHub Actions](https://github.com/npm/libnpmpublish/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmpublish/actions?query=workflow%3A%22Node+CI%22) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmpublish/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmpublish?branch=latest) - -[`libnpmpublish`](https://github.com/npm/libnpmpublish) is a Node.js library for -programmatically publishing and unpublishing npm packages. It takes care -of packing tarballs from source code and putting it up on a nice registry for you. +[`libnpmpublish`](https://github.com/npm/libnpmpublish) is a Node.js +library for programmatically publishing and unpublishing npm packages. Give +it a manifest as an object and a tarball as a Buffer, and it'll put them on +the registry for you. ## Table of Contents @@ -22,7 +18,6 @@ of packing tarballs from source code and putting it up on a nice registry for yo ```js const { publish, unpublish } = require('libnpmpublish') - ``` ## Install @@ -33,39 +28,58 @@ const { publish, unpublish } = require('libnpmpublish') #### `opts` for `libnpmpublish` commands -`libnpmpublish` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). -Most options are passed through directly to that library, so please refer to -[its own `opts` -documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) -for options that can be passed in. +`libnpmpublish` uses +[`npm-registry-fetch`](https://npm.im/npm-registry-fetch). Most options +are passed through directly to that library, so please refer to [its own +`opts` documentation](http://npm.im/npm-registry-fetch#fetch-options) for +options that can be passed in. + +A couple of options of note: + +* `opts.defaultTag` - registers the published package with the given tag, + defaults to `latest`. -A couple of options of note for those in a hurry: -* `opts.defaultTag` - registers the published package with the given tag, defaults to `latest`. +* `opts.access` - tells the registry whether this package should be + published as public or restricted. Only applies to scoped packages, which + default to restricted. -* `opts.access` - tells the registry whether this package should be published as public or restricted. Only applies to scoped packages, which default to restricted. +* `opts.token` - can be passed in and will be used as the authentication + token for the registry. For other ways to pass in auth details, see the + n-r-f docs. -* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. +#### `> libpub.publish(manifest, tarData, [opts]) -> Promise` -#### `> libpub.publish(path, pkgJson, [opts]) -> Promise` +Sends the package represented by the `manifest` and `tarData` to the +configured registry. -Packs a tarball located in `path` and publishes to the appropriate configured registry. `pkgJson` should be -the parsed `package.json` for the package that is being published. +`manifest` should be the parsed `package.json` for the package being +published (which can also be the manifest pulled from a packument, a git +repo, tarball, etc.) -If `opts.npmVersion` is passed in, it will be used as the `_npmVersion` field in -the outgoing packument. It's recommended you add your own user agent string in -there! +`tarData` is a `Buffer` of the tarball being published. -If `opts.algorithms` is passed in, it should be an array of hashing algorithms -to generate `integrity` hashes for. The default is `['sha512']`, which means you -end up with `dist.integrity = 'sha512-deadbeefbadc0ffee'`. Any algorithm -supported by your current node version is allowed -- npm clients that do not -support those algorithms will simply ignore the unsupported hashes. +If `opts.npmVersion` is passed in, it will be used as the `_npmVersion` +field in the outgoing packument. You may put your own user-agent string in +there to identify your publishes. + +If `opts.algorithms` is passed in, it should be an array of hashing +algorithms to generate `integrity` hashes for. The default is `['sha512']`, +which means you end up with `dist.integrity = 'sha512-deadbeefbadc0ffee'`. +Any algorithm supported by your current node version is allowed -- npm +clients that do not support those algorithms will simply ignore the +unsupported hashes. ##### Example -```javascript +```js +// note that pacote.manifest() and pacote.tarball() can also take +// any spec that npm can install. a folder shown here, since that's +// far and away the most common use case. const path = '/a/path/to/your/source/code' -await libpub.publish(path, { +const pacote = require('pacote') // see: http://npm.im/pacote +const manifest = await pacote.manifest(path) +const tarData = await pacote.tarball(path) +await libpub.publish(manifest, tarData, { npmVersion: 'my-pub-script@1.0.2', token: 'my-auth-token-here' }, opts) @@ -84,15 +98,8 @@ expected. `range` specs will fail silently in most cases. ##### Example -```javascript +```js await libpub.unpublish('lodash', { token: 'i-am-the-worst'}) // -// `lodash` has now been unpublished, along with all its versions, and the world -// devolves into utter chaos. -// -// That, or we all go home to our friends and/or family and have a nice time -// doing nothing having to do with programming or JavaScript and realize our -// lives are just so much happier now, and we just can't understand why we ever -// got so into this JavaScript thing but damn did it pay well. I guess you'll -// settle for gardening or something. +// `lodash` has now been unpublished, along with all its versions ``` diff --git a/deps/npm/node_modules/libnpmpublish/index.js b/deps/npm/node_modules/libnpmpublish/index.js index 38de9ece14e4e9..35687e0262559e 100644 --- a/deps/npm/node_modules/libnpmpublish/index.js +++ b/deps/npm/node_modules/libnpmpublish/index.js @@ -1,4 +1,4 @@ module.exports = { publish: require('./publish.js'), - unpublish: require('./unpublish.js') + unpublish: require('./unpublish.js'), } diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index 91d918ef22d998..8476717a1c8e66 100644 --- a/deps/npm/node_modules/libnpmpublish/package.json +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "3.0.2", + "version": "4.0.0", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "npm Inc. ", "contributors": [ @@ -13,10 +13,12 @@ ], "license": "ISC", "scripts": { + "eslint": "eslint", + "lint": "npm run eslint -- \"*.js\"", + "lintfix": "npm run lint -- --fix", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "lint": "standard", "test": "tap", "posttest": "npm run lint" }, @@ -24,6 +26,13 @@ "check-coverage": true }, "devDependencies": { + "eslint": "^7.11.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.2", + "libnpmpack": "^2.0.0", + "lodash.clonedeep": "^4.5.0", "nock": "^12.0.2", "standard": "^14.3.1", "tap": "^14.10.6" @@ -35,11 +44,9 @@ "bugs": "https://github.com/npm/libnpmpublish/issues", "homepage": "https://npmjs.com/package/libnpmpublish", "dependencies": { - "libnpmpack": "^2.0.0", - "lodash.clonedeep": "^4.5.0", "normalize-package-data": "^3.0.0", "npm-package-arg": "^8.1.0", - "npm-registry-fetch": "^8.1.5", + "npm-registry-fetch": "^9.0.0", "semver": "^7.1.3", "ssri": "^8.0.0" }, diff --git a/deps/npm/node_modules/libnpmpublish/publish.js b/deps/npm/node_modules/libnpmpublish/publish.js index 8a382e4ad9a9c3..bed0f27246faa6 100644 --- a/deps/npm/node_modules/libnpmpublish/publish.js +++ b/deps/npm/node_modules/libnpmpublish/publish.js @@ -1,25 +1,15 @@ -'use strict' - const { fixer } = require('normalize-package-data') const npmFetch = require('npm-registry-fetch') -const cloneDeep = require('lodash.clonedeep') const npa = require('npm-package-arg') -const pack = require('libnpmpack') const semver = require('semver') const { URL } = require('url') -const util = require('util') const ssri = require('ssri') -const statAsync = util.promisify(require('fs').stat) - -module.exports = publish -async function publish (folder, manifest, opts) { +const publish = async (manifest, tarballData, opts) => { if (manifest.private) { throw Object.assign( - new Error( - `This package has been marked as private\n - Remove the 'private' field from the package.json to publish it.` - ), + new Error(`This package has been marked as private +Remove the 'private' field from the package.json to publish it.`), { code: 'EPRIVATE' } ) } @@ -32,16 +22,7 @@ async function publish (folder, manifest, opts) { access: spec.scope ? 'restricted' : 'public', algorithms: ['sha512'], ...opts, - spec - } - - const stat = await statAsync(folder) - // checks if it's a dir - if (!stat.isDirectory()) { - throw Object.assign( - new Error('not a directory'), - { code: 'ENOTDIR' } - ) + spec, } const reg = npmFetch.pickRegistry(spec, opts) @@ -56,7 +37,6 @@ async function publish (folder, manifest, opts) { ) } - const tarballData = await pack(`file:${folder}`, { ...opts }) const metadata = buildMetadata(reg, pubManifest, tarballData, opts) try { @@ -64,36 +44,37 @@ async function publish (folder, manifest, opts) { ...opts, method: 'PUT', body: metadata, - ignoreBody: true + ignoreBody: true, }) } catch (err) { - if (err.code !== 'E409') { throw err } + if (err.code !== 'E409') + throw err // if E409, we attempt exactly ONE retry, to protect us // against malicious activity like trying to publish // a bunch of new versions of a package at the same time // and/or spamming the registry const current = await npmFetch.json(spec.escapedName, { ...opts, - query: { write: true } + query: { write: true }, }) const newMetadata = patchMetadata(current, metadata, opts) return npmFetch(spec.escapedName, { ...opts, method: 'PUT', body: newMetadata, - ignoreBody: true + ignoreBody: true, }) } } -function patchManifest (_manifest, opts) { +const patchManifest = (_manifest, opts) => { const { npmVersion } = opts - const manifest = cloneDeep(_manifest) + // we only update top-level fields, so a shallow clone is fine + const manifest = { ..._manifest } manifest._nodeVersion = process.versions.node - if (npmVersion) { + if (npmVersion) manifest._npmVersion = npmVersion - } fixer.fixNameField(manifest, { strict: true, allowLegacyCase: true }) const version = semver.clean(manifest.version) @@ -107,7 +88,7 @@ function patchManifest (_manifest, opts) { return manifest } -function buildMetadata (registry, manifest, tarballData, opts) { +const buildMetadata = (registry, manifest, tarballData, opts) => { const { access, defaultTag, algorithms } = opts const root = { _id: manifest.name, @@ -116,7 +97,6 @@ function buildMetadata (registry, manifest, tarballData, opts) { 'dist-tags': {}, versions: {}, access, - readme: manifest.readme || '' } root.versions[manifest.version] = manifest @@ -126,7 +106,7 @@ function buildMetadata (registry, manifest, tarballData, opts) { const tarballName = `${manifest.name}-${manifest.version}.tgz` const tarballURI = `${manifest.name}/-/${tarballName}` const integrity = ssri.fromData(tarballData, { - algorithms: [...new Set(['sha1'].concat(algorithms))] + algorithms: [...new Set(['sha1'].concat(algorithms))], }) manifest._id = `${manifest.name}@${manifest.version}` @@ -146,18 +126,18 @@ function buildMetadata (registry, manifest, tarballData, opts) { root._attachments[tarballName] = { content_type: 'application/octet-stream', data: tarballData.toString('base64'), - length: tarballData.length + length: tarballData.length, } return root } -function patchMetadata (current, newData) { - const curVers = Object.keys(current.versions || {}).map(v => { - return semver.clean(v, true) - }).concat(Object.keys(current.time || {}).map(v => { - if (semver.valid(v, true)) { return semver.clean(v, true) } - })).filter(v => v) +const patchMetadata = (current, newData) => { + const curVers = Object.keys(current.versions || {}) + .map(v => semver.clean(v, true)) + .concat(Object.keys(current.time || {}) + .map(v => semver.valid(v, true) && semver.clean(v, true)) + .filter(v => v)) const newVersion = Object.keys(newData.versions)[0] @@ -169,19 +149,19 @@ function patchMetadata (current, newData) { ), { code: 'EPUBLISHCONFLICT', pkgid, - version + version, }) } current.versions = current.versions || {} current.versions[newVersion] = newData.versions[newVersion] - for (var i in newData) { + for (const i in newData) { switch (i) { // objects that copy over the new stuffs case 'dist-tags': case 'versions': case '_attachments': - for (var j in newData[i]) { + for (const j in newData[i]) { current[i] = current[i] || {} current[i][j] = newData[i][j] } @@ -190,8 +170,11 @@ function patchMetadata (current, newData) { // copy default: current[i] = newData[i] + break } } return current } + +module.exports = publish diff --git a/deps/npm/node_modules/libnpmpublish/unpublish.js b/deps/npm/node_modules/libnpmpublish/unpublish.js index 3fe3860420bbfb..937e4b849636d9 100644 --- a/deps/npm/node_modules/libnpmpublish/unpublish.js +++ b/deps/npm/node_modules/libnpmpublish/unpublish.js @@ -5,21 +5,20 @@ const npmFetch = require('npm-registry-fetch') const semver = require('semver') const { URL } = require('url') -module.exports = unpublish -async function unpublish (spec, opts) { +const unpublish = async (spec, opts) => { spec = npa(spec) // spec is used to pick the appropriate registry/auth combo. opts = { force: false, ...opts, - spec + spec, } try { const pkgUri = spec.escapedName const pkg = await npmFetch.json(pkgUri, { ...opts, - query: { write: true } + query: { write: true }, }) const version = spec.rawSpec @@ -32,9 +31,8 @@ async function unpublish (spec, opts) { // if missing specific version, // assumed unpublished - if (!versionData && !rawSpecs && !noVersions) { + if (!versionData && !rawSpecs && !noVersions) return true - } // unpublish all versions of a package: // - no specs supplied "npm unpublish foo" @@ -45,7 +43,7 @@ async function unpublish (spec, opts) { await npmFetch(`${pkgUri}/-rev/${pkg._rev}`, { ...opts, method: 'DELETE', - ignoreBody: true + ignoreBody: true, }) return true } else { @@ -56,9 +54,8 @@ async function unpublish (spec, opts) { // deleting dist tags associated to version Object.keys(pkg['dist-tags']).forEach(tag => { - if (pkg['dist-tags'][tag] === version) { + if (pkg['dist-tags'][tag] === version) delete pkg['dist-tags'][tag] - } }) if (latestVer === version) { @@ -75,26 +72,28 @@ async function unpublish (spec, opts) { ...opts, method: 'PUT', body: pkg, - ignoreBody: true + ignoreBody: true, }) // Remove the tarball itself const { _rev } = await npmFetch.json(pkgUri, { ...opts, - query: { write: true } + query: { write: true }, }) const tarballUrl = new URL(dist.tarball).pathname.substr(1) await npmFetch(`${tarballUrl}/-rev/${_rev}`, { ...opts, method: 'DELETE', - ignoreBody: true + ignoreBody: true, }) return true } } catch (err) { - if (err.code !== 'E404') { + if (err.code !== 'E404') throw err - } + return true } } + +module.exports = unpublish diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json index 0007a7fcc4a8d4..5b86d77d5cb2ba 100644 --- a/deps/npm/node_modules/libnpmsearch/package.json +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -1,6 +1,6 @@ { "name": "libnpmsearch", - "version": "3.0.0", + "version": "3.0.1", "description": "Programmatic API for searching in npm and compatible registries.", "author": "Kat Marchán ", "files": [ @@ -37,7 +37,7 @@ "bugs": "https://github.com/npm/libnpmsearch/issues", "homepage": "https://npmjs.com/package/libnpmsearch", "dependencies": { - "npm-registry-fetch": "^8.0.0" + "npm-registry-fetch": "^9.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/libnpmteam/package.json b/deps/npm/node_modules/libnpmteam/package.json index 1834be77732efc..fc3bf5b3392d6f 100644 --- a/deps/npm/node_modules/libnpmteam/package.json +++ b/deps/npm/node_modules/libnpmteam/package.json @@ -1,7 +1,7 @@ { "name": "libnpmteam", "description": "npm Team management APIs", - "version": "2.0.1", + "version": "2.0.2", "author": "Kat Marchán ", "license": "ISC", "scripts": { @@ -27,7 +27,7 @@ "homepage": "https://npmjs.com/package/libnpmteam", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^8.0.0" + "npm-registry-fetch": "^9.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/lodash.clonedeep/LICENSE b/deps/npm/node_modules/lodash.clonedeep/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.clonedeep/README.md b/deps/npm/node_modules/lodash.clonedeep/README.md deleted file mode 100644 index fee48e4706a972..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.clonedeep v4.5.0 - -The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.clonedeep -``` - -In Node.js: -```js -var cloneDeep = require('lodash.clonedeep'); -``` - -See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/index.js b/deps/npm/node_modules/lodash.clonedeep/index.js deleted file mode 100644 index 1b0e50298222d6..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/index.js +++ /dev/null @@ -1,1748 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeKeys = overArg(Object.keys, Object); - -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - this.__data__ = new ListCache(entries); -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - return this.__data__['delete'](key); -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - return this; - } - cache = this.__data__ = new MapCache(pairs); - } - cache.set(key, value); - return this; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; -} - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return result; -} - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; -} - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} - -/** - * The base implementation of `getTag`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - return objectToString.call(value); -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; -} - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); -} - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - assignValue(object, key, newValue === undefined ? source[key] : newValue); - } - return object; -} - -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Creates an array of the own enumerable symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11, -// for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ -function cloneDeep(value) { - return baseClone(value, true, true); -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -/** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ -function stubArray() { - return []; -} - -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = cloneDeep; diff --git a/deps/npm/node_modules/lodash.clonedeep/package.json b/deps/npm/node_modules/lodash.clonedeep/package.json deleted file mode 100644 index fb1d626d5c6039..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.clonedeep", - "version": "4.5.0", - "description": "The lodash method `_.cloneDeep` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, clonedeep", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/deps/npm/node_modules/minipass-json-stream/README.md b/deps/npm/node_modules/minipass-json-stream/README.md index ab7ab087d09ef2..79864a778fa338 100644 --- a/deps/npm/node_modules/minipass-json-stream/README.md +++ b/deps/npm/node_modules/minipass-json-stream/README.md @@ -142,9 +142,9 @@ stream.on('data', function(data) { ### recursive patterns (..) -`JSONStream.parse('docs..value')` +`JSONStream.parse('docs..value')` (or `JSONStream.parse(['docs', {recurse: true}, 'value'])` using an array) -will emit every `value` object that is a child, grand-child, etc. of the +will emit every `value` object that is a child, grand-child, etc. of the `docs` object. In this example, it will match exactly 5 times at various depth levels, emitting 0, 1, 2, 3 and 4 as results. diff --git a/deps/npm/node_modules/node-gyp/.github/workflows/tests.yml b/deps/npm/node_modules/node-gyp/.github/workflows/tests.yml index 13650b29e4f0fa..651b1a9f49ce3a 100644 --- a/deps/npm/node_modules/node-gyp/.github/workflows/tests.yml +++ b/deps/npm/node_modules/node-gyp/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: Tests: strategy: - fail-fast: false + fail-fast: false max-parallel: 15 matrix: node: [10.x, 12.x, 14.x] diff --git a/deps/npm/node_modules/node-gyp/gyp/gyp.bat b/deps/npm/node_modules/node-gyp/gyp/gyp.bat index ad797c30814fbb..c0b4ca24e5df02 100755 --- a/deps/npm/node_modules/node-gyp/gyp/gyp.bat +++ b/deps/npm/node_modules/node-gyp/gyp/gyp.bat @@ -1,5 +1,5 @@ -@rem Copyright (c) 2009 Google Inc. All rights reserved. -@rem Use of this source code is governed by a BSD-style license that can be -@rem found in the LICENSE file. - -@python "%~dp0gyp_main.py" %* +@rem Copyright (c) 2009 Google Inc. All rights reserved. +@rem Use of this source code is governed by a BSD-style license that can be +@rem found in the LICENSE file. + +@python "%~dp0gyp_main.py" %* diff --git a/deps/npm/node_modules/node-gyp/update-gyp.py b/deps/npm/node_modules/node-gyp/update-gyp.py index c71d2376c0cb21..aa2bcb9eb991ff 100755 --- a/deps/npm/node_modules/node-gyp/update-gyp.py +++ b/deps/npm/node_modules/node-gyp/update-gyp.py @@ -35,7 +35,7 @@ print("Unzipping...") with tarfile.open(tar_file, "r:gz") as tar_ref: tar_ref.extractall(unzip_target) - + print("Moving to current checkout (" + CHECKOUT_PATH + ")...") if os.path.exists(CHECKOUT_GYP_PATH): shutil.rmtree(CHECKOUT_GYP_PATH) diff --git a/deps/npm/node_modules/npm-profile/package.json b/deps/npm/node_modules/npm-profile/package.json index 41cac1ed679465..233381a38ec7b6 100644 --- a/deps/npm/node_modules/npm-profile/package.json +++ b/deps/npm/node_modules/npm-profile/package.json @@ -1,12 +1,12 @@ { "name": "npm-profile", - "version": "5.0.1", + "version": "5.0.2", "description": "Library for updating an npmjs.com profile", "keywords": [], "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", "dependencies": { - "npm-registry-fetch": "^8.0.0" + "npm-registry-fetch": "^9.0.0" }, "main": "index.js", "repository": { diff --git a/deps/npm/node_modules/npm-registry-fetch/README.md b/deps/npm/node_modules/npm-registry-fetch/README.md index e660940e30dc47..f5ae9cac31a03e 100644 --- a/deps/npm/node_modules/npm-registry-fetch/README.md +++ b/deps/npm/node_modules/npm-registry-fetch/README.md @@ -1,11 +1,5 @@ # npm-registry-fetch -[![npm version](https://img.shields.io/npm/v/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) -[![license](https://img.shields.io/npm/l/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) -[![Travis](https://img.shields.io/travis/npm/npm-registry-fetch/latest.svg)](https://travis-ci.org/npm/npm-registry-fetch) -[![AppVeyor](https://img.shields.io/appveyor/ci/npm/npm-registry-fetch/latest.svg)](https://ci.appveyor.com/project/npm/npm-registry-fetch) -[![Coverage Status](https://coveralls.io/repos/github/npm/npm-registry-fetch/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-registry-fetch?branch=latest) - [`npm-registry-fetch`](https://github.com/npm/npm-registry-fetch) is a Node.js library that implements a `fetch`-like API for accessing npm registry APIs consistently. It's able to consume npm-style configuration values and has all diff --git a/deps/npm/node_modules/npm-registry-fetch/auth.js b/deps/npm/node_modules/npm-registry-fetch/auth.js index 11c3bde6b4e6c6..e096a6f98f9a43 100644 --- a/deps/npm/node_modules/npm-registry-fetch/auth.js +++ b/deps/npm/node_modules/npm-registry-fetch/auth.js @@ -5,7 +5,8 @@ const url = require('url') module.exports = getAuth function getAuth (registry, opts_ = {}) { - if (!registry) { throw new Error('registry is required') } + if (!registry) + throw new Error('registry is required') const opts = opts_.forceAuth ? opts_.forceAuth : { ...defaultOpts, ...opts_ } const AUTH = {} const regKey = registry && registryKey(registry) @@ -19,9 +20,9 @@ function getAuth (registry, opts_ = {}) { doKey('_auth') doKey('otp') doKey('always-auth', 'alwaysAuth') - if (AUTH.password) { + if (AUTH.password) AUTH.password = Buffer.from(AUTH.password, 'base64').toString('utf8') - } + if (AUTH._auth && !(AUTH.username && AUTH.password)) { let auth = Buffer.from(AUTH._auth, 'base64').toString() auth = auth.split(':') @@ -33,12 +34,11 @@ function getAuth (registry, opts_ = {}) { } function addKey (opts, obj, scope, key, objKey) { - if (opts[key]) { + if (opts[key]) obj[objKey || key] = opts[key] - } - if (scope && opts[`${scope}:${key}`]) { + + if (scope && opts[`${scope}:${key}`]) obj[objKey || key] = opts[`${scope}:${key}`] - } } // Called a nerf dart in the main codebase. Used as a "safe" @@ -49,7 +49,7 @@ function registryKey (registry) { protocol: parsed.protocol, host: parsed.host, pathname: parsed.pathname, - slashes: true + slashes: true, }) return url.format(new url.URL('.', formatted)).replace(/^[^:]+:/, '') } diff --git a/deps/npm/node_modules/npm-registry-fetch/check-response.js b/deps/npm/node_modules/npm-registry-fetch/check-response.js index f151711f301606..5154da5349f76e 100644 --- a/deps/npm/node_modules/npm-registry-fetch/check-response.js +++ b/deps/npm/node_modules/npm-registry-fetch/check-response.js @@ -8,9 +8,9 @@ const defaultOpts = require('./default-opts.js') module.exports = checkResponse function checkResponse (method, res, registry, startTime, opts_ = {}) { const opts = { ...defaultOpts, ...opts_ } - if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) { + if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) opts.log.notice('', res.headers.get('npm-notice')) - } + checkWarnings(res, registry, opts) if (res.status >= 400) { logRequest(method, res, startTime, opts) @@ -35,9 +35,9 @@ function logRequest (method, res, startTime, opts) { try { const { URL } = require('url') const url = new URL(res.url) - if (url.password) { + if (url.password) url.password = '***' - } + urlStr = url.toString() } catch (er) { urlStr = res.url @@ -58,7 +58,8 @@ function checkWarnings (res, registry, opts) { // note: headers.raw() will preserve case, so we might have a // key on the object like 'WaRnInG' if that was used first for (const [key, value] of Object.entries(res.headers.raw())) { - if (key.toLowerCase() !== 'warning') { continue } + if (key.toLowerCase() !== 'warning') + continue value.forEach(w => { const match = w.match(WARNING_REGEXP) if (match) { @@ -66,18 +67,17 @@ function checkWarnings (res, registry, opts) { code: match[1], host: match[2], message: match[3], - date: new Date(match[4]) + date: new Date(match[4]), } } }) } BAD_HOSTS.set(registry, true) if (warnings['199']) { - if (warnings['199'].message.match(/ENOTFOUND/)) { + if (warnings['199'].message.match(/ENOTFOUND/)) opts.log.warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`) - } else { + else opts.log.warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`) - } } if (warnings['111']) { // 111 Revalidation failed -- we're using stale data diff --git a/deps/npm/node_modules/npm-registry-fetch/default-opts.js b/deps/npm/node_modules/npm-registry-fetch/default-opts.js index b742fd5a5fcd46..fb8021d6b742ff 100644 --- a/deps/npm/node_modules/npm-registry-fetch/default-opts.js +++ b/deps/npm/node_modules/npm-registry-fetch/default-opts.js @@ -18,5 +18,5 @@ module.exports = { process.arch } (${ process.platform - })` + })`, } diff --git a/deps/npm/node_modules/npm-registry-fetch/errors.js b/deps/npm/node_modules/npm-registry-fetch/errors.js index c41947e29952da..69671551dc6190 100644 --- a/deps/npm/node_modules/npm-registry-fetch/errors.js +++ b/deps/npm/node_modules/npm-registry-fetch/errors.js @@ -8,11 +8,10 @@ function packageName (href) { if (!basePath.match(/^-/)) { basePath = basePath.split('/') var index = basePath.indexOf('_rewrite') - if (index === -1) { + if (index === -1) index = basePath.length - 1 - } else { + else index++ - } return decodeURIComponent(basePath[index]) } } catch (_) { diff --git a/deps/npm/node_modules/npm-registry-fetch/index.js b/deps/npm/node_modules/npm-registry-fetch/index.js index 2324e7fbfd00be..df3b49eb52969c 100644 --- a/deps/npm/node_modules/npm-registry-fetch/index.js +++ b/deps/npm/node_modules/npm-registry-fetch/index.js @@ -25,11 +25,10 @@ module.exports = regFetch function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { const opts = { ...defaultOpts, - ...opts_ + ...opts_, } const registry = opts.registry = ( (opts.spec && pickRegistry(opts.spec, opts)) || - (opts.publishConfig && opts.publishConfig.registry) || opts.registry || /* istanbul ignore next */ 'https://registry.npmjs.org/' @@ -57,9 +56,8 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { if (body && !bodyIsStream && !bodyIsPromise && typeof body !== 'string' && !Buffer.isBuffer(body)) { headers['content-type'] = headers['content-type'] || 'application/json' body = JSON.stringify(body) - } else if (body && !headers['content-type']) { + } else if (body && !headers['content-type']) headers['content-type'] = 'application/octet-stream' - } if (opts.gzip) { headers['content-encoding'] = 'gzip' @@ -68,22 +66,19 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { body.on('error', /* istanbul ignore next: unlikely and hard to test */ err => gz.emit('error', err)) body = body.pipe(gz) - } else if (!bodyIsPromise) { + } else if (!bodyIsPromise) body = new zlib.Gzip().end(body).concat() - } } const parsed = new url.URL(uri) if (opts.query) { - const q = typeof opts.query === 'string' - ? qs.parse(opts.query) + const q = typeof opts.query === 'string' ? qs.parse(opts.query) : opts.query Object.keys(q).forEach(key => { - if (q[key] !== undefined) { + if (q[key] !== undefined) parsed.searchParams.set(key, q[key]) - } }) uri = url.format(parsed) } @@ -118,10 +113,10 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { retries: opts.fetchRetries, factor: opts.fetchRetryFactor, minTimeout: opts.fetchRetryMintimeout, - maxTimeout: opts.fetchRetryMaxtimeout + maxTimeout: opts.fetchRetryMaxtimeout, }, strictSSL: opts.strictSSL, - timeout: opts.timeout || 30 * 1000 + timeout: opts.timeout || 30 * 1000, }).then(res => checkResponse( method, res, registry, startTime, opts )) @@ -152,48 +147,36 @@ function pickRegistry (spec, opts = {}) { let registry = spec.scope && opts[spec.scope.replace(/^@?/, '@') + ':registry'] - if (!registry && opts.scope) { + if (!registry && opts.scope) registry = opts[opts.scope.replace(/^@?/, '@') + ':registry'] - } - - if (!registry && opts.publishConfig) { - registry = opts.publishConfig.registry - } - if (!registry) { + if (!registry) registry = opts.registry || 'https://registry.npmjs.org/' - } return registry } function getCacheMode (opts) { - return opts.offline - ? 'only-if-cached' - : opts.preferOffline - ? 'force-cache' - : opts.preferOnline - ? 'no-cache' - : 'default' + return opts.offline ? 'only-if-cached' + : opts.preferOffline ? 'force-cache' + : opts.preferOnline ? 'no-cache' + : 'default' } function getHeaders (registry, uri, opts) { const headers = Object.assign({ 'npm-in-ci': !!opts.isFromCI, - 'user-agent': opts.userAgent + 'user-agent': opts.userAgent, }, opts.headers || {}) - if (opts.projectScope) { + if (opts.projectScope) headers['npm-scope'] = opts.projectScope - } - if (opts.npmSession) { + if (opts.npmSession) headers['npm-session'] = opts.npmSession - } - if (opts.npmCommand) { + if (opts.npmCommand) headers['npm-command'] = opts.npmCommand - } const auth = getAuth(registry, opts) // If a tarball is hosted on a different place than the manifest, only send @@ -202,18 +185,18 @@ function getHeaders (registry, uri, opts) { auth.alwaysAuth || new url.URL(uri).host === new url.URL(registry).host ) - if (shouldAuth && auth.token) { + if (shouldAuth && auth.token) headers.authorization = `Bearer ${auth.token}` - } else if (shouldAuth && auth.username && auth.password) { + else if (shouldAuth && auth.username && auth.password) { const encoded = Buffer.from( `${auth.username}:${auth.password}`, 'utf8' ).toString('base64') headers.authorization = `Basic ${encoded}` - } else if (shouldAuth && auth._auth) { + } else if (shouldAuth && auth._auth) headers.authorization = `Basic ${auth._auth}` - } - if (shouldAuth && auth.otp) { + + if (shouldAuth && auth.otp) headers['npm-otp'] = auth.otp - } + return headers } diff --git a/deps/npm/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/npm-registry-fetch/package.json index 5aeddc5b39102b..40e0067b4aedb9 100644 --- a/deps/npm/node_modules/npm-registry-fetch/package.json +++ b/deps/npm/node_modules/npm-registry-fetch/package.json @@ -1,21 +1,22 @@ { "name": "npm-registry-fetch", - "version": "8.1.5", + "version": "9.0.0", "description": "Fetch-based http client for use with npm registry APIs", "main": "index.js", "files": [ - "*.js", - "lib" + "*.js" ], "scripts": { - "postrelease": "npm publish", - "posttest": "standard", - "prepublishOnly": "git push --follow-tags", - "prerelease": "npm t", - "release": "standard-version -s", - "test": "tap" + "eslint": "eslint", + "lint": "npm run eslint -- *.js test/*.js", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "postversion": "npm publish", + "test": "tap", + "posttest": "npm run lint" }, - "repository": "https://github.com/npm/registry-fetch", + "repository": "https://github.com/npm/npm-registry-fetch", "keywords": [ "npm", "registry", @@ -39,14 +40,17 @@ }, "devDependencies": { "cacache": "^15.0.0", + "eslint": "^6.8.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "mkdirp": "^0.5.1", "nock": "^11.7.0", "npmlog": "^4.1.2", "require-inject": "^1.4.4", "rimraf": "^2.6.2", "ssri": "^8.0.0", - "standard": "^14.3.3", - "standard-version": "^7.1.0", "tap": "^14.10.7" }, "tap": { diff --git a/deps/npm/node_modules/npm-registry-fetch/silentlog.js b/deps/npm/node_modules/npm-registry-fetch/silentlog.js index 886c5d55b2dbb2..483bd44c7086af 100644 --- a/deps/npm/node_modules/npm-registry-fetch/silentlog.js +++ b/deps/npm/node_modules/npm-registry-fetch/silentlog.js @@ -10,5 +10,5 @@ module.exports = { silly: noop, http: noop, pause: noop, - resume: noop + resume: noop, } diff --git a/deps/npm/node_modules/p-map/readme.md b/deps/npm/node_modules/p-map/readme.md index 6c2638ee130a00..53a3715747c2cc 100644 --- a/deps/npm/node_modules/p-map/readme.md +++ b/deps/npm/node_modules/p-map/readme.md @@ -28,7 +28,7 @@ const sites = [ return requestUrl; }; - const result = await pMap(sites, mapper, {concurrency: 2}); + const result = await pMap(sites, mapper, {concurrency: 2}); console.log(result); //=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/'] diff --git a/deps/npm/node_modules/pacote/README.md b/deps/npm/node_modules/pacote/README.md index 49dbde6a929122..81cd437efcd994 100644 --- a/deps/npm/node_modules/pacote/README.md +++ b/deps/npm/node_modules/pacote/README.md @@ -1,6 +1,6 @@ # pacote -JavaScript Package Handler +Fetches package manifests and tarballs from the npm registry. ## USAGE @@ -21,10 +21,20 @@ pacote.tarball('https://server.com/package.tgz').then(data => { }) ``` -Anything that you can do to with kind of package, you can do to any kind of -package. Data that isn't relevant (like a packument for a tarball) will be +`pacote` works with any kind of package specifier that npm can install. If +you can pass it to the npm CLI, you can pass it to pacote. (In fact, that's +exactly what the npm CLI does.) + +Anything that you can do with one kind of package, you can do with another. + +Data that isn't relevant (like a packument for a tarball) will be simulated. +`prepare` scripts will be run when generating tarballs from `git` and +`directory` locations, to simulate what _would_ be published to the +registry, so that you get a working package instead of just raw source +code that might need to be transpiled. + ## CLI This module exports a command line interface that can do most of what is diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index 9cddf610995243..7f38a193f7cb94 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,9 +1,11 @@ { "name": "pacote", - "version": "11.1.11", + "version": "11.1.12", "description": "JavaScript package downloader", "author": "Isaac Z. Schlueter (https://izs.me)", - "bin": "lib/bin.js", + "bin": { + "pacote": "lib/bin.js" + }, "license": "ISC", "main": "lib/index.js", "scripts": { @@ -23,7 +25,7 @@ "mutate-fs": "^2.1.1", "npm-registry-mock": "^1.3.1", "require-inject": "^1.4.4", - "tap": "^14.10.6" + "tap": "^14.10.8" }, "files": [ "lib/**/*.js" @@ -47,7 +49,7 @@ "npm-package-arg": "^8.0.1", "npm-packlist": "^2.1.0", "npm-pick-manifest": "^6.0.0", - "npm-registry-fetch": "^8.1.3", + "npm-registry-fetch": "^9.0.0", "promise-retry": "^1.1.1", "read-package-json-fast": "^1.1.3", "rimraf": "^3.0.2", diff --git a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index 56684125a2089c..9da0eb7d893a33 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -685,7 +685,7 @@ request.get({ The `ca` value can be an array of certificates, in the event you have a private or internal corporate public-key infrastructure hierarchy. For example, if you want to connect to https://api.some-server.com which presents a key chain consisting of: 1. its own public key, which is signed by: -2. an intermediate "Corp Issuing Server", that is in turn signed by: +2. an intermediate "Corp Issuing Server", that is in turn signed by: 3. a root CA "Corp Root CA"; you can configure your request as follows: @@ -950,7 +950,7 @@ Function that returns the specified response header field using a [case-insensit ```js request('http://www.google.com', function (error, response, body) { // print the Content-Type header even if the server returned it as 'content-type' (lowercase) - console.log('Content-Type is:', response.caseless.get('Content-Type')); + console.log('Content-Type is:', response.caseless.get('Content-Type')); }); ``` diff --git a/deps/npm/node_modules/request/node_modules/uuid/README.md b/deps/npm/node_modules/request/node_modules/uuid/README.md index 6bccc345ee08e4..1752e4751fc920 100644 --- a/deps/npm/node_modules/request/node_modules/uuid/README.md +++ b/deps/npm/node_modules/request/node_modules/uuid/README.md @@ -127,13 +127,13 @@ Example: In-place generation of two binary IDs ```javascript // Generate two ids in an array const arr = new Array(); -uuidv1(null, arr, 0); // ⇨ +uuidv1(null, arr, 0); // ⇨ // [ // 44, 94, 164, 192, 64, 103, // 17, 233, 146, 52, 155, 29, // 235, 77, 59, 125 // ] -uuidv1(null, arr, 16); // ⇨ +uuidv1(null, arr, 16); // ⇨ // [ // 44, 94, 164, 192, 64, 103, 17, 233, // 146, 52, 155, 29, 235, 77, 59, 125, @@ -208,14 +208,14 @@ Example: Generate two IDs in a single buffer ```javascript const buffer = new Array(); -uuidv4(null, buffer, 0); // ⇨ +uuidv4(null, buffer, 0); // ⇨ // [ // 155, 29, 235, 77, 59, // 125, 75, 173, 155, 221, // 43, 13, 123, 61, 203, // 109 // ] -uuidv4(null, buffer, 16); // ⇨ +uuidv4(null, buffer, 16); // ⇨ // [ // 155, 29, 235, 77, 59, 125, 75, 173, // 155, 221, 43, 13, 123, 61, 203, 109, diff --git a/deps/npm/node_modules/resolve/test/resolver/cup.coffee b/deps/npm/node_modules/resolve/test/resolver/cup.coffee index e69de29bb2d1d6..8b137891791fe9 100644 --- a/deps/npm/node_modules/resolve/test/resolver/cup.coffee +++ b/deps/npm/node_modules/resolve/test/resolver/cup.coffee @@ -0,0 +1 @@ + diff --git a/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js index 3d2c6b8e10bf0c..9b4846a82a77be 100644 --- a/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +++ b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js @@ -23,3 +23,4 @@ require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result c = result.replace(process.cwd(), '$CWD'); if (b && c) { test(); } }); + diff --git a/deps/npm/node_modules/resolve/test/shadowed_core.js b/deps/npm/node_modules/resolve/test/shadowed_core.js index 3b4739898d1cc9..98c52a760b966a 100644 --- a/deps/npm/node_modules/resolve/test/shadowed_core.js +++ b/deps/npm/node_modules/resolve/test/shadowed_core.js @@ -35,3 +35,4 @@ test('shadowed core modules return shadow when appending `/` [sync]', function ( t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); }); + diff --git a/deps/npm/node_modules/retry/Makefile b/deps/npm/node_modules/retry/Makefile index 98e7167bbe359f..eee21a99dfc9ec 100644 --- a/deps/npm/node_modules/retry/Makefile +++ b/deps/npm/node_modules/retry/Makefile @@ -19,3 +19,4 @@ release-patch: test npm publish .PHONY: test + diff --git a/deps/npm/node_modules/uuid/CONTRIBUTING.md b/deps/npm/node_modules/uuid/CONTRIBUTING.md new file mode 100644 index 00000000000000..4a4503d02ca583 --- /dev/null +++ b/deps/npm/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/deps/npm/node_modules/uuid/README.md b/deps/npm/node_modules/uuid/README.md index 4579a2892d5adf..6cea039335280e 100644 --- a/deps/npm/node_modules/uuid/README.md +++ b/deps/npm/node_modules/uuid/README.md @@ -94,7 +94,7 @@ import { parse as uuidParse } from 'uuid'; const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // Convert to hex strings to show byte order (for documentation purposes) -[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨ +[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨ // [ // '6e', 'c0', 'bd', '7f', // '11', 'c0', '43', 'da', diff --git a/deps/npm/package.json b/deps/npm/package.json index ef00418446c85e..d0ca0bf91a7dd5 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "7.0.7", + "version": "7.0.8", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -42,7 +42,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@npmcli/arborist": "^1.0.6", + "@npmcli/arborist": "^1.0.8", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.2.1", "@npmcli/run-script": "^1.7.4", @@ -68,14 +68,14 @@ "init-package-json": "^2.0.1", "is-cidr": "^4.0.2", "leven": "^3.1.0", - "libnpmaccess": "^4.0.0", + "libnpmaccess": "^4.0.1", "libnpmfund": "^1.0.1", - "libnpmhook": "^6.0.0", - "libnpmorg": "^2.0.0", + "libnpmhook": "^6.0.1", + "libnpmorg": "^2.0.1", "libnpmpack": "^2.0.0", - "libnpmpublish": "^3.0.2", - "libnpmsearch": "^3.0.0", - "libnpmteam": "^2.0.1", + "libnpmpublish": "^4.0.0", + "libnpmsearch": "^3.0.1", + "libnpmteam": "^2.0.2", "libnpmversion": "^1.0.6", "make-fetch-happen": "^8.0.9", "mkdirp": "^1.0.4", @@ -87,12 +87,12 @@ "npm-audit-report": "^2.1.4", "npm-package-arg": "^8.1.0", "npm-pick-manifest": "^6.1.0", - "npm-profile": "^5.0.1", - "npm-registry-fetch": "^8.1.4", + "npm-profile": "^5.0.2", + "npm-registry-fetch": "^9.0.0", "npm-user-validate": "^1.0.1", "npmlog": "~4.1.2", "opener": "^1.5.2", - "pacote": "^11.1.10", + "pacote": "^11.1.12", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", diff --git a/deps/npm/scripts/changelog.js b/deps/npm/scripts/changelog.js index c770b4ac400d5d..f36ad56c9c5bf9 100644 --- a/deps/npm/scripts/changelog.js +++ b/deps/npm/scripts/changelog.js @@ -32,12 +32,12 @@ function shortname (url) { function printCommit (c) { console.log(`* [\`${c.shortid}\`](https://github.com/npm/cli/commit/${c.fullid})`) - if (c.fixes) { - let label = shortname(c.fixes) - if (label) { - console.log(` [${label}](${c.fixes})`) - } else { - console.log(` [npm.community#${c.fixes}](https://npm.community/t/${c.fixes})`) + if (c.fixes.length) { + for (const fix of c.fixes) { + let label = shortname(fix) + if (label) { + console.log(` [${label}](${fix})`) + } } } else if (c.prurl) { let label = shortname(c.prurl) @@ -51,20 +51,23 @@ function printCommit (c) { .replace(/^\s+/mg, '') .replace(/^[-a-z]+: /, '') .replace(/^/mg, ' ') + .replace(/^ Reviewed-by: @.*/mg, '') .replace(/\n$/, '') // backtickify package@version - .replace(/^(\s*[^@\s]+@\d+[.]\d+[.]\d+)(\s*\S)/g, '$1:$2') - .replace(/\b([^@\s]+@\d+[.]\d+[.]\d+)\b/g, '`$1`') + .replace(/^(\s*@?[^@\s]+@\d+[.]\d+[.]\d+)\b(\s*\S)/g, '$1:$2') + .replace(/((?:\b|@)[^@\s]+@\d+[.]\d+[.]\d+)\b/g, '`$1`') // linkify commitids .replace(/\b([a-f0-9]{7,8})\b/g, '[`$1`](https://github.com/npm/cli/commit/$1)') - .replace(/\b#(\d+)\b/g, '[#$1](https://npm.community/t/$1)') console.log(msg) - if (c.credit) { - c.credit.forEach(function (credit) { - console.log(` ([@${credit}](https://github.com/${credit}))`) - }) - } else { - console.log(` ([@${c.author}](https://github.com/${c.author}))`) + // don't assign credit for dep updates + if (!/^ `[^`]+@\d+\.\d+\.\d+[^`]*`:?$/m.test(msg)) { + if (c.credit) { + c.credit.forEach(function (credit) { + console.log(` ([@${credit}](https://github.com/${credit}))`) + }) + } else { + console.log(` ([@${c.author}](https://github.com/${c.author}))`) + } } } @@ -84,7 +87,7 @@ function main () { message: m[4], author: m[5], prurl: null, - fixes: null, + fixes: [], credit: null } } else if (m = line.match(/^PR-URL: (.*)/)) { @@ -92,8 +95,12 @@ function main () { } else if (m = line.match(/^Credit: @(.*)/)) { if (!commit.credit) commit.credit = [] commit.credit.push(m[1]) - } else if (m = line.match(/^Fixes: #?(.*)/)) { - commit.fixes = m[1] + } else if (m = line.match(/^(?:Fix(?:es)|Closes?): #?([0-9]+)/)) { + commit.fixes.push(`https://github.com/npm/cli/issues/${m[1]}`) + } else if (m = line.match(/^(?:Fix(?:es)|Closes?): ([^#]+)#([0-9]*)/)) { + commit.fixes.push(`https://github.com/${m[1]}/issues/${m[2]}`) + } else if (m = line.match(/^(?:Fix(?:es)|Closes?): (https?:\/\/.*)/)) { + commit.fixes.push(m[1]) } else if (m = line.match(/^Reviewed-By: @(.*)/)) { commit.reviewed = m[1] } else if (/\S/.test(line)) { diff --git a/deps/npm/tap-snapshots/test-lib-config.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-config.js-TAP.test.js index eb396d98dba443..1794dc4fadfb88 100644 --- a/deps/npm/tap-snapshots/test-lib-config.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-config.js-TAP.test.js @@ -88,10 +88,10 @@ exports[`test/lib/config.js TAP config edit > should write config file 2`] = ` exports[`test/lib/config.js TAP config get no args > should list configs on config get no args 1`] = ` ; "cli" config from command line options -editor = "vi" -global = false -json = false -long = false +editor = "vi" +global = false +json = false +long = false ; node bin location = /path/to/node ; cwd = {CWD} @@ -102,26 +102,26 @@ long = false exports[`test/lib/config.js TAP config list --long > should list all configs 1`] = ` ; "default" config from default values -init-author-name = "" -init-version = "1.0.0" -init.author.name = "" -init.version = "1.0.0" +init-author-name = "" +init-version = "1.0.0" +init.author.name = "" +init.version = "1.0.0" ; "cli" config from command line options -editor = "vi" -global = false -json = false +editor = "vi" +global = false +json = false long = true ` exports[`test/lib/config.js TAP config list > should list configs 1`] = ` ; "cli" config from command line options -editor = "vi" -global = false -json = false -long = false +editor = "vi" +global = false +json = false +long = false ; node bin location = /path/to/node ; cwd = {CWD} @@ -132,11 +132,11 @@ long = false exports[`test/lib/config.js TAP config list overrides > should list overriden configs 1`] = ` ; "cli" config from command line options -editor = "vi" -global = false -init.author.name = "Bar" -json = false -long = false +editor = "vi" +global = false +init.author.name = "Bar" +json = false +long = false ; "user" config from ~/.npmrc diff --git a/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js index 472f7f1cfe5750..b135b1001bcec6 100644 --- a/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js @@ -26,7 +26,7 @@ exports[`test/lib/dist-tag.js TAP add new tag > should return success msg 1`] = ` exports[`test/lib/dist-tag.js TAP add using valid semver range as name > should return success msg 1`] = ` -dist-tag add 1.0.0 to @scoped/another@7.7.7 +dist-tag add 1.0.0 to @scoped/another@7.7.7 ` @@ -53,7 +53,7 @@ alias: dist-tags ` exports[`test/lib/dist-tag.js TAP ls on missing package > should log no dist-tag found msg 1`] = ` -dist-tag ls Couldn't get dist-tag data for foo@latest +dist-tag ls Couldn't get dist-tag data for foo@latest ` @@ -80,7 +80,7 @@ latest: 2.0.0 ` exports[`test/lib/dist-tag.js TAP remove existing tag > should log remove info 1`] = ` -dist-tag del c from @scoped/another +dist-tag del c from @scoped/another ` @@ -97,13 +97,13 @@ alias: dist-tags ` exports[`test/lib/dist-tag.js TAP remove non-existing tag > should log error msg 1`] = ` -dist-tag del nonexistent from @scoped/another -dist-tag del nonexistent is not a dist-tag on @scoped/another +dist-tag del nonexistent from @scoped/another +dist-tag del nonexistent is not a dist-tag on @scoped/another ` exports[`test/lib/dist-tag.js TAP set existing version > should log warn msg 1`] = ` -dist-tag add b to @scoped/another@0.6.0 -dist-tag add b is already set to version 0.6.0 +dist-tag add b to @scoped/another@0.6.0 +dist-tag add b is already set to version 0.6.0 ` diff --git a/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js index 795c7e508ba97d..cded6fa5a6333f 100644 --- a/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js @@ -37,11 +37,11 @@ test-npm-ls@1.0.0 {CWD}/ls-ls--link exports[`test/lib/ls.js TAP ls --long --depth=0 > should output tree containing top-level deps with descriptions 1`] = ` test-npm-ls@1.0.0 | {CWD}/ls-ls--long-depth-0 -| +| +-- dev-dep@1.0.0 | A DEV dep kind of dep +-- lorem@1.0.0 -| +| +-- optional-dep@1.0.0 | Maybe a dep? +-- peer-dep@1.0.0 @@ -54,15 +54,15 @@ test-npm-ls@1.0.0 exports[`test/lib/ls.js TAP ls --long > should output tree info with descriptions 1`] = ` test-npm-ls@1.0.0 | {CWD}/ls-ls--long -| +| +-- dev-dep@1.0.0 | | A DEV dep kind of dep | \`-- foo@1.0.0 -| | +| | | \`-- bar@1.0.0 -| +| +-- lorem@1.0.0 -| +| +-- optional-dep@1.0.0 | Maybe a dep? +-- peer-dep@1.0.0 diff --git a/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js index 3522084e67c713..0e6c053b2f452e 100644 --- a/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js @@ -21,11 +21,6 @@ Object { "browser": "browser", "ca": "ca", "cache": "cache/_cacache", - "cacheLockRetries": "cache-lock-retries", - "cacheLockStale": "cache-lock-stale", - "cacheLockWait": "cache-lock-wait", - "cacheMax": "cache-max", - "cacheMin": "cache-min", "cafile": "cafile", "call": "call", "cert": "cert", @@ -55,11 +50,6 @@ Object { "legacyBundling": "legacy-bundling", "legacyPeerDeps": undefined, "localPrefix": "/path/to/npm/cli", - "lockFile": Object { - "retries": "cache-lock-retries", - "stale": "cache-lock-stale", - "wait": "cache-lock-wait", - }, "log": Object {}, "long": undefined, "message": "message", diff --git a/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js index fd325a1e70a0e5..402a0e735afc40 100644 --- a/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js @@ -17,17 +17,17 @@ package: my-cool-pkg@1.0.0 bundle-dep === Tarball Details === -name: my-cool-pkg -version: 1.0.0 -filename: my-cool-pkg-1.0.0.tgz -package size: 222 B -unpacked size: 101 B +name: my-cool-pkg +version: 1.0.0 +filename: my-cool-pkg-1.0.0.tgz +package size: 222 B +unpacked size: 101 B shasum: fe3a2f6064ade3bc21640874530586343f2d832f integrity: sha512-ehndP8xBQL4yo[...]kWinZ4k1SCqUA== -bundled deps: 1 -bundled files: 0 -own files: 2 -total files: 2 +bundled deps: 1 +bundled files: 0 +own files: 2 +total files: 2 ` diff --git a/deps/npm/test/lib/cli.js b/deps/npm/test/lib/cli.js index e90ca69c42c27e..0d9b6ad6a5a8a6 100644 --- a/deps/npm/test/lib/cli.js +++ b/deps/npm/test/lib/cli.js @@ -177,3 +177,4 @@ t.test('load error calls error handler', t => { LOAD_ERROR = null t.end() }) + diff --git a/deps/npm/test/lib/dedupe.js b/deps/npm/test/lib/dedupe.js index 7f55c0e30ead7a..a88c41f6e9c674 100644 --- a/deps/npm/test/lib/dedupe.js +++ b/deps/npm/test/lib/dedupe.js @@ -46,3 +46,4 @@ test('should remove dupes using Arborist - no arguments', (t) => { t.end() }) }) + diff --git a/deps/npm/test/lib/explain.js b/deps/npm/test/lib/explain.js index e3a67b6513c4a5..a9db344f8b20ca 100644 --- a/deps/npm/test/lib/explain.js +++ b/deps/npm/test/lib/explain.js @@ -174,3 +174,4 @@ t.test('explain some nodes', async t => { }) }) }) + diff --git a/deps/npm/test/lib/find-dupes.js b/deps/npm/test/lib/find-dupes.js index cb320559fc6fc8..2f6272b90c1296 100644 --- a/deps/npm/test/lib/find-dupes.js +++ b/deps/npm/test/lib/find-dupes.js @@ -14,3 +14,4 @@ test('should run dedupe in dryRun mode', (t) => { t.end() }) }) + diff --git a/deps/npm/test/lib/pack.js b/deps/npm/test/lib/pack.js index 5a268882f9e26d..097204ea92bea3 100644 --- a/deps/npm/test/lib/pack.js +++ b/deps/npm/test/lib/pack.js @@ -119,7 +119,7 @@ t.test('should log pack contents', (t) => { ...require('../../lib/utils/tar.js'), logTar: () => { t.ok(true, 'logTar is called') - } + } }, '../../lib/npm.js': { flatOptions: { diff --git a/deps/npm/test/lib/prune.js b/deps/npm/test/lib/prune.js index 9c5024499da50b..27c16355fa6412 100644 --- a/deps/npm/test/lib/prune.js +++ b/deps/npm/test/lib/prune.js @@ -26,3 +26,4 @@ test('should prune using Arborist', (t) => { t.end() }) }) + diff --git a/deps/npm/test/lib/publish.js b/deps/npm/test/lib/publish.js index e26fdb382ce539..14e2179816394e 100644 --- a/deps/npm/test/lib/publish.js +++ b/deps/npm/test/lib/publish.js @@ -1,14 +1,75 @@ -const { test, cleanSnapshot } = require('tap') +const t = require('tap') const requireInject = require('require-inject') -test('should publish with libnpmpublish', (t) => { +// mock config +const {defaults} = require('../../lib/utils/config.js') +const config = { list: [defaults] } +const fs = require('fs') + +t.test('should publish with libnpmpublish, respecting publishConfig', (t) => { + t.plan(5) + + const publishConfig = { registry: 'https://some.registry' } + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0', + publishConfig, + }, null, 2), + }) + + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: true, + defaultTag: 'latest', + }, + config, + }, + '../../lib/utils/tar.js': { + getContents: () => ({ + id: 'someid', + }), + logTar: () => {}, + }, + '../../lib/utils/output.js': () => {}, + '../../lib/utils/otplease.js': (opts, fn) => { + return Promise.resolve().then(() => fn(opts)) + }, + // verify that we do NOT remove publishConfig if it was there originally + // and then removed during the script/pack process + libnpmpack: async () => { + fs.writeFileSync(`${testDir}/package.json`, JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0', + })) + return Buffer.from('') + }, + libnpmpublish: { + publish: (manifest, tarData, opts) => { + t.match(manifest, { name: 'my-cool-pkg', version: '1.0.0' }, 'gets manifest') + t.isa(tarData, Buffer, 'tarData is a buffer') + t.ok(opts, 'gets opts object') + t.same(opts.registry, publishConfig.registry, 'publishConfig is passed through') + }, + }, + }) + + publish([testDir], (er) => { + if (er) + throw er + t.pass('got to callback') + }) +}) + +t.test('re-loads publishConfig if added during script process', (t) => { + t.plan(5) const publishConfig = { registry: 'https://some.registry' } const testDir = t.testdir({ 'package.json': JSON.stringify({ name: 'my-cool-pkg', version: '1.0.0', - publishConfig - }, null, 2) + }, null, 2), }) const publish = requireInject('../../lib/publish.js', { @@ -16,41 +77,52 @@ test('should publish with libnpmpublish', (t) => { flatOptions: { json: true, defaultTag: 'latest', - } + }, + config, }, '../../lib/utils/tar.js': { - 'getContents': () => ({ - id: 'someid' + getContents: () => ({ + id: 'someid', }), - 'logTar': () => {} + logTar: () => {}, }, '../../lib/utils/output.js': () => {}, '../../lib/utils/otplease.js': (opts, fn) => { return Promise.resolve().then(() => fn(opts)) }, - 'libnpmpack': () => '', - 'libnpmpublish': { - publish: (arg, manifest, opts) => { - t.ok(arg, 'gets path') - t.ok(manifest, 'gets manifest') + libnpmpack: async () => { + fs.writeFileSync(`${testDir}/package.json`, JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0', + publishConfig, + })) + return Buffer.from('') + }, + libnpmpublish: { + publish: (manifest, tarData, opts) => { + t.match(manifest, { name: 'my-cool-pkg', version: '1.0.0' }, 'gets manifest') + t.isa(tarData, Buffer, 'tarData is a buffer') t.ok(opts, 'gets opts object') - t.same(opts.publishConfig, publishConfig, 'publishConfig is passed through') - t.ok(true, 'libnpmpublish is called') - } + t.same(opts.registry, publishConfig.registry, 'publishConfig is passed through') + }, }, }) - publish([testDir], () => { - t.end() + publish([testDir], (er) => { + if (er) + throw er + t.pass('got to callback') }) }) -test('should not log if silent', (t) => { +t.test('should not log if silent', (t) => { + t.plan(2) + const testDir = t.testdir({ 'package.json': JSON.stringify({ name: 'my-cool-pkg', - version: '1.0.0' - }, null, 2) + version: '1.0.0', + }, null, 2), }) const publish = requireInject('../../lib/publish.js', { @@ -58,37 +130,49 @@ test('should not log if silent', (t) => { flatOptions: { json: false, defaultTag: 'latest', - dryRun: true - } + dryRun: true, + }, + config, }, '../../lib/utils/tar.js': { - 'getContents': () => ({}), - 'logTar': () => {} + getContents: () => ({}), + logTar: () => { + t.pass('called logTar (but nothing actually printed)') + }, }, '../../lib/utils/otplease.js': (opts, fn) => { return Promise.resolve().then(() => fn(opts)) }, - 'npmlog': { - 'verbose': () => {}, - 'level': 'silent' + '../../lib/utils/output.js': () => { + throw new Error('should not output in silent mode') + }, + npmlog: { + verbose: () => {}, + notice: () => {}, + level: 'silent', }, - 'libnpmpack': () => '', - 'libnpmpublish': { - publish: () => {} + libnpmpack: async () => '', + libnpmpublish: { + publish: (manifest, tarData, opts) => { + throw new Error('should not call libnpmpublish!') + }, }, }) - publish([testDir], () => { - t.end() + publish([testDir], (er) => { + if (er) + throw er + t.pass('got to callback') }) }) -test('should log tarball contents', (t) => { +t.test('should log tarball contents', (t) => { + t.plan(3) const testDir = t.testdir({ 'package.json': JSON.stringify({ name: 'my-cool-pkg', - version: '1.0.0' - }, null, 2) + version: '1.0.0', + }, null, 2), }) const publish = requireInject('../../lib/publish.js', { @@ -96,62 +180,127 @@ test('should log tarball contents', (t) => { flatOptions: { json: false, defaultTag: 'latest', - dryRun: true - } + dryRun: true, + }, + config, }, '../../lib/utils/tar.js': { - 'getContents': () => ({ - id: 'someid' + getContents: () => ({ + id: 'someid', }), - 'logTar': () => { - t.ok(true, 'logTar is called') - } + logTar: () => { + t.pass('logTar is called') + }, }, '../../lib/utils/output.js': () => { - t.ok(true, 'output fn is called') + t.pass('output fn is called') }, '../../lib/utils/otplease.js': (opts, fn) => { return Promise.resolve().then(() => fn(opts)) }, - 'libnpmpack': () => '', - 'libnpmpublish': { - publish: () => {} + libnpmpack: async () => '', + libnpmpublish: { + publish: () => { + throw new Error('should not call libnpmpublish!') + }, }, }) - publish([testDir], () => { - t.end() + publish([testDir], (er) => { + if (er) + throw er + t.pass('got to callback') }) }) -test('shows usage with wrong set of arguments', (t) => { +t.test('shows usage with wrong set of arguments', (t) => { + t.plan(1) const publish = requireInject('../../lib/publish.js', { '../../lib/npm.js': { flatOptions: { json: false, - defaultTag: '0.0.13' - } - } + defaultTag: '0.0.13', + }, + config, + }, }) - publish(['a', 'b', 'c'], (result) => { - t.matchSnapshot(result, 'should print usage') - t.end() - }) + publish(['a', 'b', 'c'], (er) => t.matchSnapshot(er, 'should print usage')) }) -test('throws when invalid tag', (t) => { +t.test('throws when invalid tag', (t) => { + t.plan(1) const publish = requireInject('../../lib/publish.js', { '../../lib/npm.js': { flatOptions: { json: false, - defaultTag: '0.0.13' - } - } + defaultTag: '0.0.13', + }, + config, + }, }) publish([], (err) => { - t.ok(err, 'throws when tag name is a valid SemVer range') - t.end() + t.match(err, { + message: /Tag name must not be a valid SemVer range: /, + }, 'throws when tag name is a valid SemVer range') + }) +}) + +t.test('can publish a tarball', t => { + t.plan(3) + const testDir = t.testdir({ + package: { + 'package.json': JSON.stringify({ + name: 'my-cool-tarball', + version: '1.2.3', + }), + }, + }) + const tar = require('tar') + tar.c({ + cwd: testDir, + file: `${testDir}/package.tgz`, + sync: true, + }, ['package']) + + // no cheating! read it from the tarball. + fs.unlinkSync(`${testDir}/package/package.json`) + fs.rmdirSync(`${testDir}/package`) + + const tarFile = fs.readFileSync(`${testDir}/package.tgz`) + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: true, + defaultTag: 'latest', + }, + config, + }, + '../../lib/utils/tar.js': { + getContents: () => ({ + id: 'someid', + }), + logTar: () => {}, + }, + '../../lib/utils/output.js': () => {}, + '../../lib/utils/otplease.js': (opts, fn) => { + return Promise.resolve().then(() => fn(opts)) + }, + libnpmpublish: { + publish: (manifest, tarData, opts) => { + t.match(manifest, { + name: 'my-cool-tarball', + version: '1.2.3', + }, 'sent manifest to lib pub') + t.strictSame(tarData, tarFile, 'sent the tarball data to lib pub') + }, + }, + }) + + publish([`${testDir}/package.tgz`], (er) => { + if (er) + throw er + t.pass('got to callback') }) }) diff --git a/deps/npm/test/lib/utils/flat-options.js b/deps/npm/test/lib/utils/flat-options.js index f18ce828c3e1d8..d3b8b89bc865ab 100644 --- a/deps/npm/test/lib/utils/flat-options.js +++ b/deps/npm/test/lib/utils/flat-options.js @@ -163,7 +163,7 @@ t.test('get preferOffline from cache-min', t => { const opts = flatOptions(npm) t.equal(opts.preferOffline, true, 'got preferOffline from cache min') logs.length = 0 - t.equal(opts.cacheMin, 9999999, 'opts.cacheMin is set') + t.equal(opts.cacheMin, undefined, 'opts.cacheMin is not set') t.match(logs, []) logs.length = 0 t.end() @@ -177,7 +177,7 @@ t.test('get preferOnline from cache-max', t => { const opts = flatOptions(npm) t.equal(opts.preferOnline, true, 'got preferOnline from cache min') logs.length = 0 - t.equal(opts.cacheMax, -1, 'opts.cacheMax is set') + t.equal(opts.cacheMax, undefined, 'opts.cacheMax is not set') t.match(logs, []) logs.length = 0 t.end() diff --git a/deps/npm/test/lib/utils/tar.js b/deps/npm/test/lib/utils/tar.js index cfb195f08d4a90..827bc9262db825 100644 --- a/deps/npm/test/lib/utils/tar.js +++ b/deps/npm/test/lib/utils/tar.js @@ -51,11 +51,11 @@ test('should log tarball contents with unicode', async (t) => { } } }) - - logTar({ - files: [], + + logTar({ + files: [], bundled: [], - integrity: '' + integrity: '' }, { unicode: true }) t.end() }) diff --git a/deps/npm/test/lib/view.js b/deps/npm/test/lib/view.js index f355b9bd751cc5..88b2769a058990 100644 --- a/deps/npm/test/lib/view.js +++ b/deps/npm/test/lib/view.js @@ -46,7 +46,7 @@ const packument = (nv, opts) => { 'tarball': 'http://hm.blue.com/1.0.0.tgz', 'integrity': '---', 'fileCount': 1, - 'unpackedSize': 1 + 'unpackedSize': 1 } }, '1.0.1': {} @@ -590,3 +590,4 @@ t.test('no registry completion', (t) => { t.end() }) }) +